/* Product detail page — premium monochrome */

.container {
    width: min(1100px, calc(100% - 48px));
    margin: 0 auto;
    padding: 0 24px 32px;
    box-sizing: border-box;
}

/* Hard centering and overflow protection to prevent right-shift */
html, body, main { overflow-x: hidden; }

.product-layout {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    box-sizing: border-box;
    min-width: 0;
}
.product-layout > * {
    min-width: 0;
}

.product-price-row,
.product-meta,
.badge-row,
.product-description,
.product-details-list,
.product-details-list li {
    overflow-wrap: anywhere;
    white-space: normal;
}

.product-price-row > * {
    flex: 1 1 0;
    min-width: 0;
}

.product-stock {
    text-align: right;
    min-width: 0;
    overflow-wrap: anywhere;
}

.product-gallery img,
.product-main-image img,
.thumb img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Ensure container padding uses box-sizing to avoid visual shifts */
.container { box-sizing: border-box; }

main { padding-top: 16px; }

.product-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
    /* prevent implicit min-size from causing overflow */
    grid-auto-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
    .product-layout {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        gap: 48px;
    }
}

.product-gallery {
    background: transparent;
    border-radius: 12px;
    padding: 0;
    border: none;
    box-sizing: border-box;
}

.product-main-image {
    border-radius: 0;
    background: transparent;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: zoom-in;
}

.product-main-image img {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.35s ease, opacity 0.28s ease;
}

.product-main-image img.is-fading {
    opacity: 0;
}

.product-main-image img.is-appearing {
    opacity: 1;
}

.product-main-image.is-zoomed img {
    transform: scale(1.5);
}

/* ===== Variant picker (color circles + size pills) ===== */
.variant-picker {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0 0 18px;
}

.variant-picker__group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.variant-picker__label {
    font-size: 0.82rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.variant-picker__label strong {
    color: var(--text, #111);
    font-weight: 600;
}

.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-swatch {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 2px solid transparent;
    background: var(--swatch, #94a3b8);
    cursor: pointer;
    padding: 0;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-swatch.is-light {
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.22);
}

.color-swatch:hover {
    transform: scale(1.08);
}

.color-swatch.is-active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111;
    transform: scale(1.08);
    animation: swatchPop 0.28s ease;
}

.color-swatch.is-active::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}

.color-swatch.is-light.is-active::after {
    background: #111;
}

@keyframes swatchPop {
    0% { transform: scale(0.92); }
    60% { transform: scale(1.12); }
    100% { transform: scale(1.08); }
}

.size-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.size-pill {
    min-width: 44px;
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--border, #ddd);
    background: transparent;
    color: inherit;
    font-size: 0.88rem;
    font-weight: 560;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.size-pill:hover {
    border-color: var(--border-light, #555);
    transform: translateY(-1px);
}

.size-pill.is-active {
    background: var(--text, #f4f4f4);
    color: #0a0a0a;
    border-color: var(--text, #f4f4f4);
    animation: pillSelect 0.22s ease;
}

.size-pill.is-oos {
    opacity: 0.45;
    text-decoration: line-through;
}

@keyframes pillSelect {
    0% { transform: scale(0.96); }
    70% { transform: scale(1.04); }
    100% { transform: scale(1); }
}

.primary-actions .btn {
    transition: opacity 0.2s ease, transform 0.15s ease, background 0.2s ease;
}

.primary-actions .btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.thumbnail-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
}

.thumb {
    width: 68px;
    height: 84px;
    border-radius: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    flex-shrink: 0;
    cursor: pointer;
    background: var(--bg-glass-light);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb.active { border-color: var(--primary); }

.product-info-card {
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
    box-sizing: border-box;
}

.product-title {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.7rem;
    font-weight: 500;
    margin-bottom: 10px;
    letter-spacing: 0.005em;
    line-height: 1.2;
}

.product-category {
    font-size: 0.66rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-bottom: 12px;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.product-meta > * {
    min-width: 0;
}

.product-price-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}
.product-price-row > * {
    min-width: 0;
}

.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
}

.product-description {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 16px;
}

.product-details-list {
    list-style: none;
    margin-bottom: 24px;
    font-size: 0.88rem;
}

.product-details-list li {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.product-details-list i { color: var(--primary); margin-top: 3px; }

.primary-actions, .secondary-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap; /* allow buttons to wrap instead of overflowing */
}

.primary-actions .btn, .secondary-actions .btn { flex: 1; }
/* Ensure buttons can shrink and don't force overflow */
.primary-actions .btn, .secondary-actions .btn { min-width: 0; flex-basis: 0; box-sizing: border-box; }

.btn-whatsapp {
    background: var(--whatsapp);
    color: #fff;
    border-radius: var(--radius-pill, 999px);
}

.section-title {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.35rem;
    font-weight: 400;
    margin: 24px 0 12px;
    text-transform: none;
    letter-spacing: 0.01em;
}

.details-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.details-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.details-row:last-child { border-bottom: none; }

.details-label { color: var(--text-muted); }
.details-value { font-weight: 500; }

.sticky-atc {
    display: none !important;
}

.trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.trust-row span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.recently-viewed {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.recently-viewed__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 768px) {
    .recently-viewed__grid { grid-template-columns: repeat(4, 1fr); }
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px 20px;
    border-radius: var(--radius-pill, 999px);
    font-size: 0.85rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9999;
    box-shadow: var(--shadow-hover);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success { border-color: rgba(159, 216, 180, 0.4); }
.toast-error { border-color: rgba(224, 138, 138, 0.45); }

/* ── Animations ── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.45s ease forwards;
}

.fade-in-up {
    animation: fadeInUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ── Product info toolbar ── */
.product-info-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.product-toolbar {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.icon-action {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-glass-light);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.icon-action:hover {
    color: var(--text);
    border-color: var(--border-light);
    background: var(--primary-soft, rgba(255,255,255,0.06));
}

.product-sku {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    letter-spacing: 0.04em;
}

.product-sku span {
    font-family: ui-monospace, monospace;
    color: var(--text);
    opacity: 0.85;
}

.product-meta__count {
    opacity: 0.75;
}

/* ── Availability ── */
.availability-block {
    margin-bottom: 16px;
}

.availability-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.availability-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.availability-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill, 999px);
    font-size: 0.78rem;
    font-weight: 500;
    border: none;
    background: transparent;
}

.availability-pill i { font-size: 0.45rem; }

.availability-pill--stock-in {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.35);
    background: rgba(52, 211, 153, 0.08);
}

.availability-pill--stock-in i { color: #34d399; }

.availability-pill--stock-low {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.08);
}

.availability-pill--stock-low i { color: #fbbf24; }

.availability-pill--stock-out {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.08);
}

.availability-pill--stock-out i { color: #f87171; }

.availability-pill--warn {
    color: #fb923c;
    border-color: rgba(251, 146, 60, 0.35);
    background: rgba(251, 146, 60, 0.08);
}

/* ── Delivery ── */
.delivery-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0;
    margin-bottom: 16px;
    border: none;
    background: transparent;
}

.delivery-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.delivery-label i { color: var(--primary); }

.delivery-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

/* ── Thumbnail buttons ── */
button.thumb {
    padding: 0;
    font: inherit;
    color: inherit;
    background: var(--bg-glass-light);
}

/* ── Sections ── */
.pp-section {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pp-section--plain {
    padding-top: 20px;
}

.pp-section__head {
    margin-bottom: 12px;
}

.pp-section__title {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
}

.pp-section__sub {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: -8px 0 16px;
}

.product-description-body {
    margin: 0;
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Specs — minimal rows, no heavy box */
.specs-list {
    margin: 0;
    padding: 0;
}

.specs-list__row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.88rem;
}

.specs-list__row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.specs-list__label {
    margin: 0;
    color: var(--text-muted);
    font-weight: 400;
}

.specs-list__value {
    margin: 0;
    font-weight: 500;
    text-align: right;
}

/* ── Reviews ── */
.reviews-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0;
    border-radius: 0;
    margin-bottom: 16px;
    border: none;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.reviews-summary__score {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}

.reviews-summary__stars {
    font-size: 1rem;
    letter-spacing: 1px;
}

.reviews-summary__avg {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.9rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1;
}

.reviews-summary__count {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.reviews-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reviews-sort label {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.reviews-sort__select {
    appearance: none;
    background: var(--bg-glass-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font: inherit;
    font-size: 0.85rem;
    padding: 8px 32px 8px 12px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.review-form-wrap {
    margin-bottom: 24px;
}

.review-login-gate {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-radius: 0;
    border: none;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.review-login-gate p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--text-muted);
}

.review-compose {
    padding: 16px 0 20px;
    border-radius: 0;
    border: none;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: opacity 0.35s ease;
}

.review-compose.is-success {
    opacity: 0.85;
}

.review-compose__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 16px;
}

.review-compose__stars {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.review-star-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.2s ease, transform 0.2s ease;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.review-star-btn:hover {
    color: var(--card-star, #fbbf24);
    transform: scale(1.12);
}

.review-star-btn.is-active {
    color: var(--card-star, #fbbf24);
}

.review-compose__label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.review-compose__textarea {
    width: 100%;
    min-height: 140px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
    font: inherit;
    font-size: 0.92rem;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.review-compose__textarea:focus {
    outline: none;
    border-color: var(--border-light);
    box-shadow: none;
}

.review-compose__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.review-compose__count {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.review-compose__footer .btn {
    min-width: 160px;
    position: relative;
}

.review-compose__footer .btn-loading,
.review-compose__footer .btn-success {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-card {
    padding: 16px 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    transition: opacity 0.2s ease;
}

.review-card:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.06);
    opacity: 0.92;
}

.review-card__head {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
}

.review-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.review-card__meta {
    min-width: 0;
    flex: 1;
}

.review-card__name {
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 4px;
}

.review-card__rating {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.review-card__rating span {
    margin-left: 4px;
}

.review-card__date {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.85;
}

.review-card__comment {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.reviews-empty {
    text-align: center;
    padding: 32px 0;
    border-radius: 0;
    border: none;
    color: var(--text-muted);
}

.reviews-empty i {
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.6;
}

.reviews-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* ── Related products ── */
.related-products__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
    align-items: stretch;
}

@media (min-width: 768px) {
    .related-products__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px 18px;
    }
}

@media (min-width: 1200px) {
    .related-products__grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 28px 22px;
    }
}

.related-section .product-card {
    animation-delay: calc(var(--card-index, 0) * 0.06s);
}

/* ── Footer spacing on product page ── */
.product-page-footer {
    margin-top: 56px;
}

.product-page-footer .container {
    padding-bottom: 24px;
}

@media (min-width: 900px) {
    .product-title {
        font-size: 2.1rem;
    }

    .product-main-image {
        min-height: 480px;
    }

    .product-main-image img {
        max-height: 620px;
    }
}

@media (max-width: 480px) {
    .container {
        width: calc(100% - 32px);
        padding: 0 16px 24px;
    }

    .reviews-summary {
        padding: 12px 0;
    }

    .review-login-gate {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .review-login-gate .btn {
        width: 100%;
    }
}

