/* Product detail page (prefix: prod-) */

/* ---------------- layout ---------------- */

.prod-layout {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 48px;
    align-items: start;
    margin-top: 12px;
}

.prod-info {
    position: sticky;
    top: 88px;
}

@media (max-width: 900px) {
    .prod-layout { grid-template-columns: 1fr; gap: 26px; }
    .prod-info { position: static; }
}

/* ---------------- gallery ---------------- */

.prod-gallery { display: flex; gap: 14px; min-width: 0; }

.prod-thumbs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 72px;
    flex: none;
    max-height: 660px;
    overflow-y: auto;
    scrollbar-width: none;
}
.prod-thumbs::-webkit-scrollbar { display: none; }

.prod-thumb {
    width: 72px;
    aspect-ratio: 5 / 6;
    flex: none;
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color 0.25s ease, transform 0.3s var(--ease-spring), opacity 0.25s ease;
    opacity: 0.75;
}
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod-thumb:hover { transform: translateY(-2px); opacity: 1; }
.prod-thumb.is-active { border-color: var(--gold); opacity: 1; }

.prod-stage {
    position: relative;
    flex: 1;
    min-width: 0;
    aspect-ratio: 5 / 6;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--surface-2);
    box-shadow: var(--shadow-card);
    cursor: zoom-in;
}
.prod-stage .badge { position: absolute; top: 14px; left: 14px; z-index: 3; }

.prod-stage__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s var(--ease-out), transform 0.6s var(--ease-out);
}
.prod-stage__img--enter { opacity: 0; transform: scale(1.045); }
.prod-stage__img--exit { opacity: 0; }

@media (max-width: 900px) {
    .prod-gallery { flex-direction: column-reverse; }
    .prod-thumbs {
        flex-direction: row;
        width: 100%;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 2px;
    }
}

/* skeleton */
.prod-layout--skel .prod-stage { cursor: default; }
.prod-layout--skel .prod-thumb { pointer-events: none; }

/* ---------------- info column ---------------- */

.prod-brand {
    color: var(--gold-deep);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 12.5px;
    font-weight: 800;
}
[data-theme="dark"] .prod-brand { color: var(--gold-soft); }

.prod-name {
    font-family: var(--font-display);
    font-size: clamp(26px, 3.2vw, 38px);
    font-weight: 700;
    line-height: 1.12;
    margin-top: 8px;
}

.prod-rating { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.prod-rating__link {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}
.prod-rating__link:hover { color: var(--gold-deep); }
[data-theme="dark"] .prod-rating__link:hover { color: var(--gold-soft); }

.prod-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 12px;
    font-size: 12.5px;
    color: var(--text-3);
}
.prod-meta b { color: var(--text-2); font-weight: 700; }

.prod-price { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.prod-price__now { font-size: 27px; font-weight: 800; letter-spacing: -0.01em; }
.prod-price__now--sale { color: var(--danger); }
.prod-price__old { font-size: 16px; color: var(--text-3); text-decoration: line-through; }

/* ---------------- option rows ---------------- */

.prod-opt { margin-top: 20px; }
.prod-opt__label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-2);
}
.prod-opt__value {
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 700;
}

.prod-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.prod-swatch {
    width: 34px;
    height: 34px;
    padding: 3px;
    border: 2px solid var(--hairline-strong);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.25s ease, transform 0.3s var(--ease-spring);
}
.prod-swatch__dot {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}
.prod-swatch:hover { transform: scale(1.1); }
.prod-swatch.is-active { border-color: var(--gold); transform: scale(1.1); box-shadow: var(--shadow-gold); }

.prod-sizes { display: flex; gap: 8px; flex-wrap: wrap; }
.prod-size-chip:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    text-decoration: line-through;
}

.prod-hint {
    min-height: 18px;
    margin-top: 8px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--gold-deep);
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
[data-theme="dark"] .prod-hint { color: var(--gold-soft); }
.prod-hint.is-on { opacity: 1; transform: none; }

/* size-row swap / error animations */
.prod-pop { animation: prod-fadeup 0.35s var(--ease-out); }
@keyframes prod-fadeup {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: none; }
}
.prod-shake { animation: prod-shake 0.45s ease; }
@keyframes prod-shake {
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* ---------------- action card ---------------- */

.prod-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 26px;
    padding: 14px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}
.prod-add { flex: 1; }
.prod-add--done { background: var(--success); color: #fff; opacity: 1 !important; }
.prod-add--done::after { display: none; }

.prod-like {
    width: 52px;
    height: 52px;
    flex: none;
    display: grid;
    place-items: center;
    border: 1.5px solid var(--hairline-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease-spring);
}
.prod-like .icon svg { width: 22px; height: 22px; }
.prod-like:hover { color: var(--danger); border-color: var(--danger); transform: scale(1.07); }
.prod-like.is-liked { color: var(--danger); border-color: var(--danger); }
.prod-like.is-liked .icon svg { fill: currentColor; }
.prod-like--pop { animation: prod-like-pop 0.45s var(--ease-spring); }
@keyframes prod-like-pop {
    0% { transform: scale(0.7); }
    55% { transform: scale(1.22); }
    100% { transform: scale(1); }
}

/* ---------------- sections ---------------- */

.prod-stepper { display: flex; }
.prod-details { max-width: 860px; }
.prod-reviews { scroll-margin-top: 84px; }
.prod-reviews__body { min-height: 60px; }
.prod-similar { margin-bottom: 20px; }

/* ---------------- accordions ---------------- */

.prod-acc { border-bottom: 1px solid var(--hairline); }
.prod-acc:first-child { border-top: 1px solid var(--hairline); }
.prod-acc__head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 4px;
    border: 0;
    background: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    transition: color 0.2s ease;
}
.prod-acc__head:hover { color: var(--gold-deep); }
[data-theme="dark"] .prod-acc__head:hover { color: var(--gold-soft); }
.prod-acc__chev { flex: none; color: var(--text-3); }
.prod-acc__chev svg {
    width: 18px;
    height: 18px;
    transform: rotate(90deg);
    transition: transform 0.35s var(--ease-out);
}
.prod-acc.is-open .prod-acc__chev svg { transform: rotate(-90deg); }
.prod-acc__body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.45s var(--ease-out);
}
.prod-acc.is-open .prod-acc__body { grid-template-rows: 1fr; }
.prod-acc__inner { overflow: hidden; min-height: 0; }
.prod-acc__text {
    padding: 0 4px 20px;
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--text-2);
    white-space: pre-line;
}

/* ---------------- reviews ---------------- */

.prod-rev-sum {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 26px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}
.prod-rev-sum__score {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-right: 1px solid var(--hairline);
    padding-right: 22px;
}
.prod-rev-sum__avg {
    font-family: var(--font-display);
    font-size: 54px;
    font-weight: 700;
    line-height: 1;
}
.prod-rev-sum__count { font-size: 12.5px; color: var(--text-2); font-weight: 600; }

.prod-rev-bars { display: flex; flex-direction: column; gap: 9px; justify-content: center; min-width: 0; }
.prod-rev-bar {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-2);
}
.prod-rev-bar__label { display: inline-flex; align-items: center; gap: 3px; }
.prod-rev-bar__label .icon svg { width: 12px; height: 12px; color: var(--gold); }
.prod-rev-bar__track {
    height: 7px;
    border-radius: var(--r-pill);
    background: var(--hairline);
    overflow: hidden;
}
.prod-rev-bar__fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: var(--r-pill);
    background: var(--gold-grad);
    transition: width 0.9s var(--ease-out);
}
.prod-rev-bar__num { text-align: right; color: var(--text-3); }

@media (max-width: 640px) {
    .prod-rev-sum { grid-template-columns: 1fr; gap: 18px; }
    .prod-rev-sum__score {
        border-right: 0;
        border-bottom: 1px solid var(--hairline);
        padding-right: 0;
        padding-bottom: 18px;
    }
}

.prod-comments { display: flex; flex-direction: column; gap: 14px; }
.prod-comment {
    display: flex;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg);
    background: var(--surface);
    transition: box-shadow 0.3s ease, transform 0.3s var(--ease-out),
        opacity 0.6s var(--ease-out);
}
.prod-comment:hover { box-shadow: var(--shadow-card); }
.prod-comment__avatar {
    width: 42px;
    height: 42px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--gold-grad);
    color: #221803;
    font-weight: 800;
    font-size: 16px;
}
.prod-comment__main { flex: 1; min-width: 0; }
.prod-comment__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.prod-comment__name { font-weight: 800; font-size: 14px; }
.prod-comment__date { font-size: 12px; color: var(--text-3); }
.prod-comment .stars { margin-top: 5px; }
.prod-comment .stars .icon svg { width: 13px; height: 13px; }
.prod-comment__text {
    margin-top: 7px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-2);
    white-space: pre-line;
    overflow-wrap: break-word;
}
.prod-rev-more { display: flex; justify-content: center; margin-top: 18px; }

/* review modal */
.prod-rev-form { display: flex; flex-direction: column; gap: 14px; width: min(400px, 100%); }
.prod-rev-form__title { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.prod-rev-form__sub { font-size: 13px; color: var(--text-2); margin-top: -6px; }
.prod-rate { display: flex; gap: 4px; }
.prod-rate__star {
    padding: 4px;
    border: 0;
    background: none;
    cursor: pointer;
    color: var(--hairline-strong);
    transition: color 0.2s ease, transform 0.25s var(--ease-spring);
}
.prod-rate__star svg { width: 30px; height: 30px; display: block; }
.prod-rate__star:hover { transform: scale(1.18); }
.prod-rate__star.is-on { color: var(--gold); }

/* ---------------- lightbox ---------------- */

.prod-lb {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: grid;
    place-items: center;
    background: rgba(8, 8, 11, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.28s ease;
    cursor: zoom-out;
}
.prod-lb--in { opacity: 1; }

.prod-lb__img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-pop);
    cursor: zoom-in;
    transform: scale(0.95);
    transition: transform 0.4s var(--ease-out), opacity 0.2s ease;
}
.prod-lb--in .prod-lb__img { transform: scale(1); }
.prod-lb--in .prod-lb__img--zoom { transform: scale(1.7); cursor: zoom-out; }
.prod-lb__img--flash { opacity: 0.35; }

.prod-lb__close,
.prod-lb__nav {
    position: fixed;
    z-index: 2;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.3s var(--ease-spring);
}
.prod-lb__close:hover,
.prod-lb__nav:hover { background: rgba(255, 255, 255, 0.26); }
.prod-lb__close { top: 18px; right: 18px; }
.prod-lb__close:hover { transform: rotate(90deg); }
.prod-lb__close .icon svg { width: 20px; height: 20px; }
.prod-lb__nav { top: 50%; transform: translateY(-50%); }
.prod-lb__nav:hover { transform: translateY(-50%) scale(1.08); }
.prod-lb__nav .icon svg { width: 20px; height: 20px; }
.prod-lb__nav--prev { left: 18px; }
.prod-lb__nav--prev .icon svg { transform: rotate(180deg); }
.prod-lb__nav--next { right: 18px; }
.prod-lb__count {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

@media (max-width: 640px) {
    .prod-lb__nav { width: 40px; height: 40px; }
    .prod-lb__nav--prev { left: 10px; }
    .prod-lb__nav--next { right: 10px; }
}
