/* =========================================================
   PRODUCT DETAIL PAGE
   ========================================================= */
.product-top {
    display: grid;
    grid-template-columns: 76px 340px minmax(220px, 260px) 340px;
    grid-template-areas: "header header header installment"
                          "thumbs main buy installment";
    gap: 20px;
    align-items: start;
}
.product-header   { grid-area: header; }
.thumbs           { grid-area: thumbs; }
.main-image       { grid-area: main; }
.buy-core         { grid-area: buy; }
.installment-full { grid-area: installment; margin-top: 0; }

.thumbs { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.thumbs .t { cursor: pointer; aspect-ratio: 1; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.thumbs .t img { width: 55px; }

.main-image { aspect-ratio: 1; min-width: 0; border-radius: 14px; background: var(--surface); display: flex; align-items: center; justify-content: center; color: var(--accent); position: relative; border: 1px solid var(--border); }
.main-image > svg { width: 96px; height: 96px; }
.main-image img { max-width: 90%; max-height: 90%; object-fit: contain; }
.main-image > img { max-height: 480px; }

.buy-core { min-width: 0; }

.crumb { font-size: 13px; color: var(--text-muted); padding: 16px 0 4px; }
.crumb a { color: var(--text-secondary); }
h1.title { font-size: 30px; margin: 6px 0 4px; color: var(--text); }
.subtitle { color: var(--text-secondary); font-size: 14px; margin: 0 0 20px; }

.fav { position: absolute; top: 14px; right: 14px; color: var(--text-muted); }

.stars { color: var(--accent); font-size: 14px; margin: 8px 0 14px; }
.price-row { font-size: 32px; font-weight: 700; margin: 0 0 14px; color: var(--text); }
.price-qty-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.price-qty-row .price-row { margin: 0; }
.price-qty-row .qty { margin: 0; }

.size-pill { display: inline-block; border: 1px solid var(--accent); color: var(--accent); border-radius: 8px; padding: 6px 16px; font-size: 13px; font-weight: 600; margin-bottom: 16px; cursor: pointer; }
.size-pill.active-size-amount { background: var(--accent); color: var(--on-accent); }

.qty { display: flex; align-items: center; gap: 14px; border: 1px solid var(--border); border-radius: 999px; width: fit-content; padding: 6px 16px; margin-bottom: 16px; font-size: 15px; color: var(--text); }
.qty button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 2px 6px; }

/* Tabs */
.tabs { margin-top: 24px; }
.tab-list { display: flex; gap: 28px; border-bottom: 1px solid var(--border); }
.tab-btn { background: none; border: none; padding: 0 0 14px; font-size: 15px; font-weight: 600; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab-btn.active { color: var(--text); border-color: var(--accent); }
.tab-count { color: var(--text-muted); font-weight: 400; }
.tab-panel { padding-top: 24px; font-size: 14px; line-height: 1.7; color: var(--text-secondary); }
.tab-panel h2 { font-size: 18px; color: var(--text); margin: 0 0 16px; }
.tab-panel[hidden] { display: none !important; }
.product-description { white-space: normal; overflow-wrap: anywhere; }

/* Reviews (product page) */
.review-summary { display: flex; align-items: flex-start; gap: 40px; flex-wrap: wrap; margin-bottom: 24px; }
.review-score { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.score-num { font-size: 40px; font-weight: 700; color: var(--text); }
.score-stars { color: var(--accent); display: flex; gap: 2px; }
.review-bars { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; }
.review-bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-secondary); }
.bar-track { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); }
.bar-count { width: 18px; text-align: right; }

.review-write-btn { width: auto; padding: 0 24px; }

.review-accordion { border-top: 1px solid var(--border); margin-top: 8px; }
.accordion-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: none; padding: 16px 0; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; }
.accordion-toggle .chevron { transition: transform 0.15s; }
.review-accordion.open .chevron { transform: rotate(180deg); }
.accordion-body { display: none; padding-bottom: 16px; }
.accordion-body[hidden] { display: none !important; }
.review-accordion.open .accordion-body { display: block; }
.review-item { padding: 12px 0; border-top: 1px solid var(--border); }
.review-author { font-weight: 600; color: var(--text); margin: 0 0 4px; font-size: 13px; }
.review-text { margin: 0; }
.review-empty { padding-top: 12px; }

.review-notice { padding: 12px 14px; border-radius: 8px; background: var(--surface-2); color: var(--text); margin: 0 0 18px; }
.review-notice--error { border: 1px solid var(--danger); }
.review-item-stars { color: var(--accent); margin: 4px 0; letter-spacing: 2px; }

.review-dialog { width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); }
.review-dialog::backdrop { background: rgba(0,0,0,.65); }
.review-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.review-dialog-head h2 { margin: 0; font-size: 20px; }
.review-dialog-head button { border: 0; background: none; color: var(--text); font-size: 28px; cursor: pointer; }
.review-form { display: flex; flex-direction: column; gap: 12px; }
.review-form textarea { width: 100%; resize: vertical; padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
.review-rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 5px; border: 0; margin: 0; padding: 0; }
.review-rating legend { margin-bottom: 8px; }
.review-rating input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.review-rating label { font-size: 30px; color: var(--text-muted); cursor: pointer; }
.review-rating input:checked ~ label, .review-rating label:hover, .review-rating label:hover ~ label { color: var(--accent); }
.review-rating input:focus-visible + label { outline: 2px solid var(--accent); }
.review-hint { margin: 0; font-size: 12px; color: var(--text-secondary); }

/* Installment table (product page) */
.installment-full { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-top: 20px; }

.installment-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 16px; }
.installment-table th { text-align: left; color: var(--text-secondary); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.installment-table td { padding: 10px 6px; border-bottom: 1px solid var(--border); color: var(--text); }
.installment-table tr { cursor: pointer; }
.installment-table tr.active { background: var(--surface-2); }
.installment-table tr.active td { color: var(--accent); font-weight: 700; }
.installment-table input[type=radio] { accent-color: var(--accent); }
.product-header .title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 8px;
}
.title__brand {
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: none;
    transition: color .15s;
}
.title__brand:hover { color: var(--accent); }
.title__sep { color: var(--text-muted); font-weight: 400; }

@media (max-width: 760px) {
    /* Breadcrumb və başlıq — daha yığcam */
    .crumb { display: none; }
    .product-top { gap: 12px; }

    .product-header .subtitle:first-child {          /* Brend */
        margin: 0 0 2px;
        font-size: 12px;
        letter-spacing: .06em;
        text-transform: uppercase;
    }
    .product-header .title {                          /* Ətir adı */
        margin: 0 0 2px;
        font-size: 22px;
        line-height: 1.2;
    }
    .product-header .subtitle:last-child {            /* Qadın üçün · EDT */
        margin: 0;
        font-size: 13px;
    }

    .product-header .title {
        margin: 0;
        font-size: 22px;
        line-height: 1.25;
    }
    .product-header .subtitle {
        margin: 4px 0 0;
        font-size: 13px;
    }
    .product-header{
        margin-top: 10px;
    }

    /* Şəkil — əvvəlkindən kiçik */
    .main-image {
        aspect-ratio: auto;
        height: clamp(220px, 34svh, 300px);
        padding: 10px;
        background: var(--image-bg);
        border-color: transparent;
    }

    .main-image img,
    .main-image > img {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;           /* kiçik şəkillər də konteyneri doldurur */
    }

    /* Thumbnail-lar */
    .thumbs { margin-top: 0; }
    .thumbs .t { background: var(--image-bg); }
    .thumbs .t img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
}
.product-sticky { display: none; }

@media (max-width: 760px) {
    .product-sticky {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
        display: flex; align-items: center; justify-content: space-between; gap: 16px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: var(--bg);
        border-top: 1px solid var(--border);
        box-shadow: 0 -8px 24px -12px rgba(0, 0, 0, .15);
        transform: translateY(100%);
        transition: transform .2s ease;
    }
    .product-sticky.is-visible { transform: translateY(0); }

    .product-sticky__info { min-width: 0; }
    .product-sticky__size {
        display: block; font-size: 12px; color: var(--text-secondary); white-space: nowrap;
    }
    .product-sticky__price {
        font-size: 18px; font-weight: 800; color: var(--text);
        font-variant-numeric: tabular-nums; white-space: nowrap;
    }
    .product-sticky__btn { flex: 1; max-width: 260px; margin: 0; }

    /* Panel footer-in son hissəsini örtməsin */
    body:has(.product-sticky) footer { padding-bottom: 80px; }
}

@media (prefers-reduced-motion: reduce) {
    .product-sticky { transition: none; }
}

.rating-count { font-size: 12px; color: var(--text-muted); }
.section-head--spaced { margin-top: 40px; }
.one-click-error { display: none; color: var(--danger); }
