/*
 * product.css — NorApotek
 * Styles specific to the product detail page (product.html).
 * Requires: base.css loaded first.
 * ─────────────────────────────────────────────────────────────────────────── */

/* ══════════════════
   PRODUCT PAGE LAYOUT
══════════════════ */
.product-page {
    padding: 0 0 80px;
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: start;
    padding: 32px 0 0;
}

/* ══════════════════
   GALLERY
══════════════════ */
.gallery {
    position: sticky;
    top: 88px;
}

.gallery-main {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 12px;
}

.gallery-main-img {
    font-size: 140px;
    transition: transform .3s ease;
    user-select: none;
    z-index: 1;
}

.gallery-badge, .gallery-badge-rx {
    z-index: 2;
    position: absolute;
}

.gallery-main:hover .gallery-main-img {
    transform: scale(1.06);
}

.gallery-main-img img {
    display: block;
}

.gallery-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--red);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    padding: 4px 12px;
    border-radius: 4px;
    text-transform: uppercase;
}

.gallery-badge-rx {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--g900);
    color: rgba(255,255,255,.8);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .5px;
    padding: 4px 10px;
    border-radius: 4px;
}

.gallery-zoom {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(255,255,255,.85);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background .2s;
}

    .gallery-zoom:hover {
        background: #fff;
    }

.gallery-thumbs {
    display: flex;
    gap: 8px;
}

.thumb {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    cursor: pointer;
    transition: border-color .2s;
}

    .thumb:hover, .thumb.active {
        border-color: var(--g600);
    }

/* ══════════════════
   PRODUCT INFO PANEL
══════════════════ */
.prod-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.prod-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.prod-brand-tag {
    font-size: 12px;
    font-weight: 600;
    color: var(--g600);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-decoration: none;
}

    .prod-brand-tag:hover {
        color: var(--g800);
    }

.prod-varenr {
    font-size: 12px;
    color: var(--muted);
}

.prod-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(28px, 3.5vw, 42px);
    font-weight: 700;
    color: var(--g900);
    line-height: 1.1;
    letter-spacing: -.5px;
}

.prod-subtitle {
    font-size: 15px;
    color: var(--muted);
    margin-top: -8px;
}

    .prod-subtitle a {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-weight: 500;
        color: var(--g600);
        text-decoration: none;
        border-bottom: 1px dashed var(--g400);
        padding-bottom: 1px;
        transition: color .2s, border-color .2s;
    }

        .prod-subtitle a:hover {
            color: var(--g800);
            border-color: var(--g700);
        }
/* Rating row */
.prod-rating {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stars {
    color: #c9a84c;
    font-size: 18px;
    letter-spacing: 1px;
}

.rating-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--g900);
}

.rating-count {
    font-size: 14px;
    color: var(--muted);
}

.rating-link {
    font-size: 13px;
    color: var(--g600);
    text-decoration: none;
}

    .rating-link:hover {
        text-decoration: underline;
    }

/* Availability */
.availability {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.avail-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

    .avail-dot.green {
        background: var(--g500);
        box-shadow: 0 0 0 3px rgba(46,155,80,.2);
    }

    .avail-dot.amber {
        background: var(--amber,#d97706);
        box-shadow: 0 0 0 3px rgba(217,119,6,.2);
    }

.avail-text {
    color: var(--g700);
}

.avail-sub {
    color: var(--muted);
    font-weight: 400;
}

/* ══════════════════
   DOSAGE / PRICE TABLE
══════════════════ */
.dosage-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--g600);
    margin-bottom: 14px;
}

.dosage-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    border: 1.5px solid var(--border);
}

    .dosage-table thead {
        background: var(--g900);
    }

        .dosage-table thead th {
            padding: 13px 16px;
            text-align: left;
            font-size: 13px;
            font-weight: 600;
            letter-spacing: .8px;
            text-transform: uppercase;
            color: rgba(255,255,255,.75);
        }

    .dosage-table tbody tr {
        border-bottom: 1px solid var(--border);
        background: var(--white);
        transition: background .15s;
    }

        .dosage-table tbody tr:last-child {
            border-bottom: none;
        }

        .dosage-table tbody tr:hover {
            background: var(--g50);
        }

        .dosage-table tbody tr.selected {
            background: var(--g100);
        }

            .dosage-table tbody tr.selected td {
                color: var(--g800);
            }

    .dosage-table td {
        padding: 14px 16px;
        font-size: 16px;
        vertical-align: middle;
    }

    .dosage-table .td-dosage {
        font-weight: 600;
        color: var(--g900);
    }

    .dosage-table .td-pack {
        color: var(--muted);
        font-size: 15px;
    }

    .dosage-table .td-price {
        font-family: 'Cormorant Garamond', serif;
        font-size: 22px;
        font-weight: 700;
        color: var(--g900);
        white-space: nowrap;
    }

    .dosage-table .td-unit {
        font-size: 13px;
        color: var(--muted);
    }

    .dosage-table .td-old {
        font-size: 13px;
        color: var(--muted);
        text-decoration: line-through;
    }

.badge-sale {
    background: rgba(192,57,43,.1);
    color: var(--red);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-popular {
    background: var(--g100);
    color: var(--g700);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.row-select {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: border-color .2s;
    flex-shrink: 0;
    position: relative;
}

    .row-select:checked {
        border-color: var(--g600);
        background: var(--g600);
        box-shadow: inset 0 0 0 3px #fff;
    }

/* ══════════════════
   BUY BOX
══════════════════ */
.buy-box {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.buy-box-price-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.buy-price-main {
    font-family: 'Cormorant Garamond', serif;
    font-size: 38px;
    font-weight: 700;
    color: var(--g900);
    line-height: 1;
}

.buy-price-old {
    font-size: 16px;
    color: var(--muted);
    text-decoration: line-through;
}

.buy-price-save {
    font-size: 14px;
    font-weight: 600;
    color: var(--red);
}

.qty-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-label {
    font-size: 14px;
    color: var(--muted);
    font-weight: 500;
}

.qty-ctrl {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.qty-btn {
    background: var(--g50);
    border: none;
    width: 38px;
    height: 38px;
    font-size: 18px;
    cursor: pointer;
    color: var(--g700);
    transition: background .2s;
    font-family: 'Jost', sans-serif;
}

    .qty-btn:hover {
        background: var(--g100);
    }

.qty-num {
    width: 44px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--g900);
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Jost', sans-serif;
}

.btn-buy {
    width: 100%;
    background: var(--g700);
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    padding: 15px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Jost', sans-serif;
    transition: background .2s, transform .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .btn-buy:hover {
        background: var(--g800);
        transform: translateY(-1px);
    }

    .btn-buy:active {
        transform: translateY(0);
    }

.btn-wishlist {
    width: 100%;
    background: transparent;
    color: var(--muted);
    border: 1.5px solid var(--border);
    cursor: pointer;
    border-radius: 8px;
    padding: 11px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Jost', sans-serif;
    transition: background .2s, color .2s, border-color .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

    .btn-wishlist:hover {
        background: var(--g50);
        color: var(--g700);
        border-color: var(--g400);
    }

.buy-perks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.buy-perk {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--muted);
}

    .buy-perk .pi {
        font-size: 16px;
    }

    .buy-perk strong {
        color: var(--g800);
    }

/* ══════════════════
   TABS
══════════════════ */
.tabs-section {
    margin-top: 64px;
}

.tabs-nav {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 36px;
}

.tab-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    font-family: 'Jost', sans-serif;
    color: var(--muted);
    white-space: nowrap;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -2px;
    transition: color .2s, border-color .2s;
}

    .tab-btn:hover {
        color: var(--g700);
    }

    .tab-btn.active {
        color: var(--g800);
        border-bottom-color: var(--g700);
        font-weight: 600;
    }

.tab-panel {
    display: none;
}

    .tab-panel.active {
        display: block;
    }

/* Tab: Description */
.desc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.desc-text h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--g900);
    margin-bottom: 12px;
    margin-top: 24px;
}

    .desc-text h3:first-child {
        margin-top: 0;
    }

.desc-text p {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 12px;
}

.desc-text ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

    .desc-text ul li {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        font-size: 15px;
        color: var(--muted);
    }

        .desc-text ul li::before {
            content: '✓';
            color: var(--g500);
            font-weight: 700;
            flex-shrink: 0;
            margin-top: 2px;
        }

.warning-box {
    background: rgba(217,119,6,.08);
    border: 1.5px solid rgba(217,119,6,.3);
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

    .warning-box .wi {
        font-size: 22px;
        flex-shrink: 0;
    }

    .warning-box p {
        font-size: 13px;
        color: #92400e;
        line-height: 1.6;
        margin: 0;
    }

    .warning-box strong {
        display: block;
        margin-bottom: 4px;
        color: #78350f;
        font-size: 14px;
    }

/* Tab: Ingredients */
.ingredients-table {
    width: 100%;
    border-collapse: collapse;
}

    .ingredients-table tr {
        border-bottom: 1px solid var(--border);
    }

        .ingredients-table tr:last-child {
            border-bottom: none;
        }

    .ingredients-table td {
        padding: 12px 0;
        font-size: 15px;
    }

        .ingredients-table td:first-child {
            color: var(--g900);
            font-weight: 500;
            width: 55%;
        }

        .ingredients-table td:last-child {
            color: var(--muted);
            text-align: right;
        }

/* Tab: Reviews */
.reviews-summary {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 28px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.reviews-score {
    text-align: center;
    flex-shrink: 0;
}

    .reviews-score .big {
        font-family: 'Cormorant Garamond', serif;
        font-size: 64px;
        font-weight: 700;
        color: var(--g900);
        line-height: 1;
    }

    .reviews-score .stars-big {
        font-size: 22px;
        color: #c9a84c;
        margin: 4px 0;
    }

    .reviews-score .total {
        font-size: 14px;
        color: var(--muted);
    }

.reviews-bars {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
}

    .bar-row .bar-label {
        width: 14px;
        text-align: right;
        flex-shrink: 0;
    }

.bar-track {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--g500);
    border-radius: 3px;
}

.bar-row .bar-count {
    width: 24px;
    flex-shrink: 0;
}

.review-card {
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 22px;
    background: var(--white);
    margin-bottom: 16px;
}

.review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

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

.reviewer-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--g100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--g700);
    flex-shrink: 0;
}

.reviewer-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--g900);
}

.reviewer-date {
    font-size: 12px;
    color: var(--muted);
}

.review-stars {
    color: #c9a84c;
    font-size: 15px;
}

.review-verified {
    font-size: 11px;
    color: var(--g600);
    font-weight: 600;
    background: var(--g100);
    padding: 2px 8px;
    border-radius: 4px;
}

.review-title {
    font-weight: 600;
    color: var(--g900);
    margin-bottom: 6px;
    font-size: 16px;
}

.review-text {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.7;
}

/* ══════════════════
   RELATED PRODUCTS
══════════════════ */
.related {
    padding: 64px 0 80px;
    background: var(--white);
    border-top: 1px solid var(--border);
}

.related-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--g600);
    margin-bottom: 8px;
}

.related-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 700;
    color: var(--g900);
    letter-spacing: -.3px;
    margin-bottom: 32px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.rel-card {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--off);
    transition: border-color .25s, box-shadow .25s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

    .rel-card:hover {
        border-color: var(--g500);
        box-shadow: 0 6px 24px rgba(11,42,26,.09);
    }

.rel-img {
    height: 120px;
    background: var(--g50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    border-bottom: 1px solid var(--border);
}

.rel-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rel-brand {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rel-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--g900);
    text-decoration: none;
    line-height: 1.35;
    transition: color .2s;
}

    .rel-name:hover {
        color: var(--g700);
    }

.rel-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.rel-price {
    font-family: 'Cormorant Garamond', serif;
    font-size: 19px;
    font-weight: 700;
    color: var(--g900);
}

.btn-rel {
    background: var(--g700);
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Jost', sans-serif;
    transition: background .2s;
}

    .btn-rel:hover {
        background: var(--g800);
    }

/* ══════════════════════════════════════
   RESPONSIVE — product page
══════════════════════════════════════ */
@media (max-width: 960px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .gallery {
        position: static;
    }

    .desc-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .dosage-table thead th:nth-child(4),
    .dosage-table td:nth-child(4) {
        display: none;
    }

    .tabs-nav {
        gap: 0;
    }

    .tab-btn {
        padding: 12px 14px;
        font-size: 14px;
    }

    .reviews-summary {
        flex-direction: column;
        gap: 20px;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .buy-price-main {
        font-size: 30px;
    }

    .gallery-thumbs {
        flex-wrap: wrap;
    }
}

@media (max-width: 380px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}

.qty-num {
    -moz-appearance: textfield;
    padding: 0;
}

    .qty-num::-webkit-outer-spin-button,
    .qty-num::-webkit-inner-spin-button {
        -webkit-appearance: none;
    }

/* ══════════════════
   DOSAGE TABS
══════════════════ */
.dosage-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.dosage-tab {
    background: var(--g50);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 7px 18px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Jost', sans-serif;
    color: var(--g700);
    cursor: pointer;
    transition: all .2s;
}

    .dosage-tab:hover {
        background: var(--g100);
        border-color: var(--g500);
    }

    .dosage-tab.active {
        background: var(--g900);
        border-color: var(--g900);
        color: #fff;
    }
