.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}
.flash--success { background: var(--success-bg); color: var(--success-fg); }
.flash--error   { background: var(--error-bg); color: var(--error-fg); }

.flash--btn {
    margin-top: 0.75rem;
    text-align: center;
}

.flash-link {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

.product-layout {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

.product-photo-wrap {
    width: 300px;
    max-width: 100%;
    flex-shrink: 0;
}

.product-main-photo {
    width: 300px;
    max-width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--radius);
    display: block;
    background: var(--divider);
}

.product-main-photo--empty {
    width: 300px;
    max-width: 100%;
    height: 300px;
    background: var(--divider);
    border-radius: var(--radius);
}

.product-info {
    padding-top: 0.5rem;
}

.product-seller {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.6rem;
}

.product-seller a {
    color: var(--primary);
    text-decoration: none;
}

.product-seller a:hover {
    text-decoration: underline;
}

.product-name {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.product-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 1.25rem;
}

.product-desc {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.65;
    margin-bottom: 1.25rem;
}

.product-stock {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1.25rem;
}

.product-stock--low {
    color: var(--error-fg);
    font-weight: 600;
}

.product-qty-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}

.product-qty-row label {
    font-size: 0.85rem;
    color: #444;
}

/* Full width to line up with the add-to-cart button below it, but keeps
   its own natural height. Shape and chevron come from the global
   `select` rule in style.css */
.product-qty-select {
    width: 100%;
}

.cart-form {
    margin: 0;
}

.btn-add-cart {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
}

.btn-add-cart:hover {
    background: var(--primary-hover);
}

.btn-add-cart--disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Looks inactive until a valid variant is chosen, but stays clickable
   so it can surface the "select your options" hint. */
.btn-add-cart--pending {
    background: #b6bcc6;
}
.btn-add-cart--pending:hover {
    background: #a7adb8;
}

.btn-login-to-buy {
    display: block;
    width: 100%;
    padding: 0.75rem;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: #555;
    text-decoration: none;
    box-sizing: border-box;
}

.btn-login-to-buy:hover {
    background: #f5f5f5;
}

.product-thumbs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.product-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.7;
    transition: opacity 0.15s, border-color 0.15s;
}

.product-thumb:hover,
.product-thumb--active {
    opacity: 1;
    border-color: #111;
}

.product-reviews {
    padding: 2rem 0 0;
    max-width: 640px;
}

.product-reviews-heading {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.product-reviews-empty {
    font-size: 0.875rem;
    color: #9ca3af;
}

.product-reviews-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.product-reviews-stars-filled {
    color: #f59e0b;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
}

.product-reviews-avg {
    font-weight: 700;
    font-size: 0.95rem;
}

.product-reviews-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.product-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-review {
    border-top: 1px solid #f3f4f6;
    padding-top: 1rem;
}

.product-review-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.product-review-stars {
    color: #f59e0b;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

.product-review-author {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111;
}

.product-review-date {
    font-size: 0.8rem;
    color: #9ca3af;
}

.product-review-comment {
    font-size: 0.875rem;
    color: var(--text-soft);
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 700px) {
    /* .product-layout is flex, not grid — it stacks with flex-direction */
    .product-layout {
        flex-direction: column;
        gap: 1.5rem;
    }
    .product-photo-wrap {
        width: 100%;
    }
    .product-main-photo,
    .product-main-photo--empty {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }
}
