/* ===================================
   JEWELLERY SHOP — PHASE 9
   PREMIUM CUSTOMER STOREFRONT
=================================== */

:root {
    --p9-ink: #201b17;
    --p9-muted: #746b61;
    --p9-ivory: #fbf8f1;
    --p9-sand: #f1eadf;
    --p9-line: #e4dbce;
    --p9-gold: #b89035;
    --p9-gold-dark: #8d6b20;
    --p9-shadow: 0 18px 45px rgba(42, 31, 21, .09);
    --p9-shadow-hover: 0 24px 60px rgba(42, 31, 21, .15);
}

body { background: var(--p9-ivory); color: var(--p9-ink); }
.site-header { background: rgba(251,248,241,.96); backdrop-filter: blur(14px); }
.header-inner { min-height: 82px; }
.brand-name { letter-spacing: .02em; }
.main-nav { gap: 1.8rem; }
.nav-link { font-size: .92rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.header-search { flex: 0 1 270px; }
.header-search input, .search-field input, .sort-select, .filter-select {
    width: 100%; border: 1px solid var(--p9-line); background: #fff; color: var(--p9-ink);
    border-radius: 999px; min-height: 44px; padding: .7rem 1rem; outline: none;
}
.header-search input:focus, .search-field input:focus, .sort-select:focus, .filter-select:focus { border-color: var(--p9-gold); box-shadow: 0 0 0 3px rgba(184,144,53,.12); }

.hero-section.p9-hero { padding: 0; background: var(--p9-ivory); }
.p9-hero-grid { min-height: 650px; display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
.p9-hero-copy { display:flex; flex-direction:column; justify-content:center; padding: 5rem 4rem 5rem 0; }
.p9-hero-copy h1 { font-size: clamp(3rem, 6vw, 5.6rem); line-height: .98; max-width: 700px; letter-spacing: -.035em; }
.p9-hero-copy p:not(.eyebrow) { max-width: 560px; color: var(--p9-muted); font-size: 1.08rem; line-height: 1.8; }
.p9-hero-actions { display:flex; flex-wrap:wrap; gap:.8rem; margin-top:1rem; }
.p9-hero-visual { min-height: 650px; position:relative; overflow:hidden; background: linear-gradient(145deg,#efe6d8,#d9c9b3); background-size: cover; background-position: center; }
.p9-hero-visual::before { content:""; position:absolute; inset:0; background: radial-gradient(circle at 50% 42%,rgba(255,255,255,.75),transparent 32%), linear-gradient(135deg,transparent 45%,rgba(255,255,255,.2)); }
.p9-hero-visual.hero-has-image::before { background: linear-gradient(180deg,rgba(0,0,0,.05),rgba(0,0,0,.12)); }
.p9-hero-visual.hero-has-image .p9-hero-ornament { display:none; }
.p9-hero-ornament { position:absolute; inset:12%; border:1px solid rgba(255,255,255,.7); display:grid; place-items:center; }
.p9-hero-ornament::before { content:"◆"; font-size:7rem; color:rgba(255,255,255,.72); text-shadow:0 15px 40px rgba(75,53,28,.18); }

.p9-section-head { display:flex; align-items:end; justify-content:space-between; gap:1rem; margin-bottom:2rem; }
.p9-section-head h2 { margin:0; font-size:clamp(2rem,4vw,3.2rem); letter-spacing:-.02em; }
.p9-link { color:var(--p9-gold-dark); font-weight:800; }
.p9-category-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:1rem; }
.p9-category-card { min-height:270px; position:relative; overflow:hidden; display:flex; align-items:end; border-radius:18px; background:linear-gradient(145deg,#e9dfd1,#cdb99d); box-shadow:var(--p9-shadow); color:#fff; }
.p9-category-card::before { content:""; position:absolute; inset:0; background:linear-gradient(180deg,transparent 30%,rgba(32,24,17,.72)); }
.p9-category-card-content { position:relative; z-index:1; padding:1.4rem; width:100%; }
.p9-category-card h3 { color:#fff; margin:0 0 .35rem; font-size:1.45rem; }
.p9-category-card p { color:rgba(255,255,255,.82); margin:0 0 .8rem; }

.p9-product-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:1.2rem; }
.p9-product-card { position:relative; overflow:hidden; background:#fff; border:1px solid var(--p9-line); border-radius:16px; box-shadow:var(--p9-shadow); transition:transform .22s ease,box-shadow .22s ease; }
.p9-product-card:hover { transform:translateY(-5px); box-shadow:var(--p9-shadow-hover); }
.p9-product-media { aspect-ratio:1/1; position:relative; overflow:hidden; background:#eee7dd; }
.p9-product-media img { width:100%; height:100%; object-fit:cover; transition:opacity .25s ease,transform .45s ease; }
.p9-product-card:hover .p9-product-media img { transform:scale(1.035); }
.p9-product-secondary { position:absolute; inset:0; opacity:0; }
.p9-product-card:hover .p9-product-secondary { opacity:1; }
.p9-wishlist { position:absolute; right:.75rem; top:.75rem; z-index:3; width:40px; height:40px; border:0; border-radius:50%; background:rgba(255,255,255,.92); box-shadow:0 8px 20px rgba(0,0,0,.1); cursor:pointer; font-size:1.15rem; }
.p9-wishlist.is-saved { color:#a13a43; }
.p9-product-info { padding:1.05rem 1.1rem 1.2rem; }
.p9-product-category { margin:0 0 .25rem; color:var(--p9-gold-dark); font-size:.72rem; font-weight:800; letter-spacing:.12em; text-transform:uppercase; }
.p9-product-info h3 { margin:0 0 .45rem; font-size:1.1rem; }
.p9-product-meta { color:var(--p9-muted); margin:0 0 .75rem; }
.p9-product-status { display:flex; justify-content:space-between; align-items:center; gap:.5rem; font-size:.82rem; font-weight:800; }
.p9-status-available { color:#56783f; }
.p9-status-order { color:var(--p9-gold-dark); }
.p9-product-cta { margin-top:.95rem; width:100%; }

.page-hero.p9-page-hero { padding:4.5rem 0 3.5rem; background:linear-gradient(180deg,#f5efe5,#fbf8f1); border-bottom:1px solid var(--p9-line); }
.p9-breadcrumb { color:var(--p9-muted); font-size:.9rem; margin-bottom:1.2rem; }
.p9-page-hero h1 { font-size:clamp(2.5rem,5vw,4.2rem); margin:0 0 .65rem; }
.p9-page-hero > .container > p:last-child { color:var(--p9-muted); max-width:650px; }

.p9-listing-shell { display:grid; grid-template-columns:250px 1fr; gap:2rem; align-items:start; }
.p9-filter-panel { position:sticky; top:105px; background:#fff; border:1px solid var(--p9-line); border-radius:16px; padding:1.2rem; }
.p9-filter-panel h2 { font-size:1rem; margin-bottom:1rem; }
.p9-filter-group { padding:1rem 0; border-top:1px solid var(--p9-line); }
.p9-filter-group:first-of-type { border-top:0; padding-top:0; }
.p9-filter-group h3 { font-size:.78rem; text-transform:uppercase; letter-spacing:.1em; color:var(--p9-muted); margin-bottom:.7rem; }
.p9-check { display:flex; align-items:center; gap:.55rem; padding:.4rem 0; font-size:.92rem; cursor:pointer; }
.p9-check input { accent-color:var(--p9-gold-dark); }
.p9-toolbar { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin-bottom:1.2rem; }
.p9-toolbar-left { display:flex; align-items:center; gap:.7rem; flex:1; }
.p9-mobile-filter { display:none; }
.p9-count { margin:0; color:var(--p9-muted); font-size:.9rem; }
.p9-sort { min-width:190px; }

.p9-detail { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(340px,.9fr); gap:4rem; align-items:start; }
.p9-gallery { display:grid; grid-template-columns:82px 1fr; gap:1rem; position:sticky; top:105px; }
.p9-thumbs { display:flex; flex-direction:column; gap:.7rem; }
.p9-thumb { width:82px; aspect-ratio:1; padding:0; border:1px solid var(--p9-line); border-radius:10px; overflow:hidden; background:#eee7dd; cursor:pointer; }
.p9-thumb.active { border:2px solid var(--p9-gold); }
.p9-thumb img { width:100%; height:100%; object-fit:cover; }
.p9-main-image { aspect-ratio:1/1; overflow:hidden; border-radius:18px; background:#eee7dd; }
.p9-main-image img { width:100%; height:100%; object-fit:cover; }
.p9-detail-copy { padding-top:.5rem; }
.p9-detail-copy .eyebrow { margin-bottom:.8rem; }
.p9-detail-copy h1 { font-size:clamp(2.1rem,4vw,3.5rem); line-height:1.05; margin-bottom:1rem; }
.p9-detail-meta { display:flex; flex-wrap:wrap; gap:.6rem; margin-bottom:1.5rem; }
.p9-pill { padding:.45rem .75rem; border-radius:999px; background:#f2eadc; color:#5f4a2a; font-size:.82rem; font-weight:800; }
.p9-detail-description { color:var(--p9-muted); line-height:1.8; margin:1.5rem 0; }
.p9-detail-table { border-top:1px solid var(--p9-line); margin:1.5rem 0; }
.p9-detail-row { display:flex; justify-content:space-between; gap:1rem; padding:.85rem 0; border-bottom:1px solid var(--p9-line); }
.p9-detail-row span:first-child { color:var(--p9-muted); }
.p9-detail-actions { display:grid; gap:.7rem; margin-top:1.5rem; }

.p9-empty { text-align:center; padding:4rem 1rem; background:#fff; border:1px dashed var(--p9-line); border-radius:16px; color:var(--p9-muted); }
.p9-loading { min-height:250px; display:grid; place-items:center; color:var(--p9-muted); }

@media (max-width: 1000px) {
    .p9-product-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .p9-category-grid { grid-template-columns:repeat(2,1fr); }
    .p9-detail { gap:2rem; }
}
@media (max-width: 800px) {
    .p9-hero-grid { grid-template-columns:1fr; }
    .p9-hero-copy { padding:4rem 0; min-height:500px; }
    .p9-hero-visual { min-height:430px; }
    .p9-listing-shell { grid-template-columns:1fr; }
    .p9-filter-panel { display:none; position:static; }
    .p9-filter-panel.is-open { display:block; }
    .p9-mobile-filter { display:inline-flex; }
    .p9-gallery { position:static; }
    .p9-detail { grid-template-columns:1fr; }
}
@media (max-width: 600px) {
    .p9-product-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:.7rem; }
    .p9-product-info { padding:.8rem; }
    .p9-product-info h3 { font-size:.95rem; }
    .p9-product-status { display:block; }
    .p9-product-status > * { display:block; margin-top:.25rem; }
    .p9-toolbar { align-items:stretch; flex-direction:column; }
    .p9-toolbar-left { flex-direction:column; align-items:stretch; }
    .p9-sort { width:100%; }
    .p9-category-grid { grid-template-columns:1fr; }
    .p9-category-card { min-height:220px; }
    .p9-gallery { grid-template-columns:1fr; }
    .p9-thumbs { order:2; flex-direction:row; overflow:auto; }
    .p9-thumb { flex:0 0 68px; width:68px; }
    .p9-hero-copy h1 { font-size:3rem; }
}

.header-wishlist { white-space: nowrap; font-size:1.1rem; }
.p9-about-visual { min-height:360px; background:linear-gradient(145deg,#eee4d3,#d8c6a9); color:rgba(255,255,255,.7); font-size:7rem; }
@media (max-width:800px){ .header-wishlist { display:none; } .header-search { order:3; width:100%; flex-basis:100%; } .header-search input { width:100%; } }


.p9-product-detail-host {
    width: 100%;
}

/* Phase 9.4 — Product detail image-left/details-right */
.p9-detail {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
}

.p9-gallery {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: 82px minmax(0, 1fr);
}

.p9-detail-copy {
    grid-column: 2;
    grid-row: 1;
}

.p9-detail-rating,
.p9-product-rating {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin: .5rem 0 .8rem;
}
.p9-detail-rating span,
.p9-product-rating span { color: var(--p9-gold-dark); letter-spacing: .06em; }
.p9-detail-rating small,
.p9-product-rating small,
.p9-product-rating.is-empty,
.p9-detail-rating.is-empty { color: var(--p9-muted); font-size: .82rem; }
.p9-review-photo { margin: .8rem 0; }
.p9-review-photo img { display:block; width:min(100%,320px); max-height:320px; object-fit:contain; border:1px solid var(--p9-line); border-radius:12px; background:#fff; }
.p9-review-photo-preview { margin-top:.6rem; }
.p9-review-photo-preview img { display:block; width:min(100%,220px); max-height:220px; object-fit:contain; border:1px solid var(--p9-line); border-radius:12px; }

.p9-main-image {
    min-height: 560px;
    display: grid;
    place-items: center;
    background: #fff;
    border: 1px solid var(--p9-line);
}

.p9-main-image img {
    width: 100%;
    height: 100%;
    max-height: 560px;
    object-fit: contain;
}

.p9-review-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
    gap: 2rem;
    align-items: start;
}

.p9-review-list {
    display: grid;
    gap: .9rem;
}

.p9-review-card,
.p9-review-empty,
.p9-review-form {
    background: #fff;
    border: 1px solid var(--p9-line);
    border-radius: 16px;
    padding: 1.2rem;
}

.p9-review-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: .55rem;
}

.p9-review-card p {
    margin: 0 0 .55rem;
    color: var(--p9-muted);
    line-height: 1.7;
}

.p9-review-card small {
    color: var(--p9-muted);
    font-size: .78rem;
}

.p9-review-stars {
    color: var(--p9-gold-dark);
    letter-spacing: .08em;
    white-space: nowrap;
}

.p9-review-summary {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    color: var(--p9-muted);
    text-align: right;
}

.p9-review-summary strong {
    color: var(--p9-ink);
    font-size: 1.35rem;
}

.p9-review-summary span:last-child {
    font-size: .82rem;
}

.p9-review-form h3 {
    margin-bottom: .35rem;
}

.p9-review-help {
    color: var(--p9-muted);
    margin-bottom: 1.1rem;
}

.p9-review-field {
    margin-bottom: 1rem;
}

.p9-review-field label,
.p9-rating-field legend {
    display: block;
    margin-bottom: .4rem;
    font-weight: 700;
}

.p9-review-field input,
.p9-review-field textarea {
    width: 100%;
    border: 1px solid var(--p9-line);
    border-radius: 10px;
    padding: .75rem .85rem;
    background: var(--p9-ivory);
    color: var(--p9-ink);
    outline: none;
    box-sizing: border-box;
}

.p9-review-field input:focus,
.p9-review-field textarea:focus {
    border-color: var(--p9-gold);
    box-shadow: 0 0 0 3px rgba(184,144,53,.12);
}

.p9-rating-field {
    border: 0;
    padding: 0;
    margin: 0 0 1rem;
}

.p9-star-rating {
    display: inline-flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: .12rem;
}

.p9-star-rating label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .08rem;
    border-radius: .35rem;
}

.p9-star-rating label:focus-within {
    outline: 2px solid var(--p9-gold);
    outline-offset: 2px;
}

.p9-star-rating input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.p9-star-rating span {
    color: #cfc5b6;
    font-size: 2rem;
    line-height: 1;
    transition: color .15s ease, transform .15s ease;
}

.p9-star-rating label:hover span,
.p9-star-rating label:hover ~ label span,
.p9-star-rating label.selected span,
.p9-star-rating label.selected ~ label span {
    color: var(--p9-gold);
}

.p9-star-rating label:hover span {
    transform: scale(1.08);
}

.p9-review-form button[disabled] {
    opacity: .65;
    cursor: wait;
}

.p9-review-empty p {
    margin: .35rem 0 0;
    color: var(--p9-muted);
}

@media (max-width: 900px) {
    .p9-detail {
        grid-template-columns: 1fr;
    }
    .p9-detail-copy,
    .p9-gallery {
        grid-column: 1;
        grid-row: auto;
    }
    .p9-gallery {
        order: 1;
    }
    .p9-detail-copy {
        order: 2;
    }
    .p9-review-layout {
        grid-template-columns: 1fr;
    }
}


/* Phase 9.4.2 — About shop media */
.about-media-display {
    min-height: 360px;
    border: 1px solid var(--p9-line);
    border-radius: 18px;
    overflow: hidden;
    background: var(--p9-ivory);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    padding: 12px;
    align-content: center;
}
.about-media-display > img,
.about-media-display > video {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}
.about-media-display > .content-placeholder {
    min-height: 330px;
    display: grid;
    place-items: center;
}
.whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}
.whatsapp-icon {
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: #25d366;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
}

/* Phase 9.4.3 — unified image/video media presentation */
.p9-hero-media{width:100%;height:100%;display:block;object-fit:cover;border-radius:inherit;}
.p9-product-video,.p9-product-media video,.p9-category-card video,.category-media-video{width:100%;height:100%;object-fit:cover;display:block;}
.p9-product-video{max-height:100%;background:#fff;}
.p9-review-photo video,.p9-review-photo img{max-width:100%;max-height:360px;border-radius:12px;display:block;}
.owner-review-photo{max-width:260px;max-height:220px;border-radius:10px;display:block;}
.owner-review-row video.owner-review-photo{width:260px;height:auto;}
.hero-image-preview video,.about-media-preview-item video{max-width:100%;max-height:240px;border-radius:10px;display:block;}
.owner-category-photo video{width:100%;height:100%;object-fit:cover;border-radius:8px;display:block;}
.owner-media-row video{width:96px;height:72px;object-fit:cover;border-radius:8px;display:block;}

.p9-main-image video,
.p9-product-video { width:100%; height:100%; object-fit:contain; background:#fff; display:block; }
.p9-thumb video { width:100%; height:100%; object-fit:cover; display:block; pointer-events:none; }
.p9-review-photo video,
.p9-review-photo-preview video { display:block; width:min(100%,320px); max-height:320px; object-fit:contain; border:1px solid var(--p9-line); border-radius:12px; background:#000; }
.about-shop-video { display:block; width:100%; max-height:520px; object-fit:cover; border-radius:16px; background:#000; }

/* Phase 9.5 — Discount display */
.p9-product-media { position:relative; }
.p9-discount-badge {
    position:absolute;
    top:.7rem;
    left:.7rem;
    z-index:3;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:28px;
    padding:.28rem .55rem;
    border-radius:999px;
    background:#a67800;
    color:#fff;
    font-size:.72rem;
    font-weight:800;
    letter-spacing:.04em;
    line-height:1;
    box-shadow:0 3px 10px rgba(0,0,0,.16);
    pointer-events:none;
}
.p9-detail-discount-badge {
    position:static;
    width:max-content;
    margin-bottom:.65rem;
}
.p9-product-discount { display:flex; align-items:center; gap:.55rem; margin-bottom:.15rem; font-size:.88rem; }
.p9-product-discount s, .p9-detail-original-price s { color:#8a7d72; }
.p9-product-discount span, .p9-detail-original-price span, .p9-discount-note { color:#a67800; font-weight:700; }
.p9-detail-original-price { margin-bottom:.2rem; font-size:.95rem; }

/* Customer-facing scope discount banners */
.p9-promo-banner {
    background: linear-gradient(90deg, #f5ead8, #fffaf2, #f5ead8);
    border-top: 1px solid var(--p9-line);
    border-bottom: 1px solid var(--p9-line);
}
.p9-promo-inner {
    min-height: 92px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:1rem;
    padding:1rem 0;
}
.p9-promo-inner .eyebrow { margin:0 0 .2rem; }
.p9-promo-inner strong { display:block; font-size:1.05rem; }
.p9-promo-inner [data-discount-label] { display:block; color:var(--p9-gold-dark); font-weight:800; margin-top:.15rem; }
.p9-category-discount-badge {
    position:absolute;
    top:.8rem;
    left:.8rem;
    z-index:4;
    padding:.35rem .65rem;
    border-radius:999px;
    background:#a67800;
    color:#fff;
    font-size:.72rem;
    font-weight:800;
    letter-spacing:.04em;
    line-height:1.1;
    box-shadow:0 3px 10px rgba(0,0,0,.16);
}
.p9-category-promo { margin-bottom:0; }
@media (max-width: 700px) {
    .p9-promo-inner { align-items:flex-start; flex-direction:column; }
    .p9-promo-inner .button { width:100%; }
}
