:root {
    --ink: #1c1210;
    --plum: #4a1049;
    --plum-soft: #6b2a69;
    --cream: #faf7f2;
    --cream-deep: #f1ebe2;
    --white: #ffffff;
    --line: #e7e0d6;
    --stone: #7a7066;
    --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--sans);
}

body {
    color: var(--ink);
    line-height: 1.6;
    background: var(--cream);
    padding-top: 84px;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ---------------- Header ---------------- */
header {
    background: rgba(250, 247, 242, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 84px;
}

.logo-image {
    height: 36px;
    width: auto;
    display: block;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 36px;
}

.nav-right a {
    text-decoration: none;
    color: var(--ink);
    font-weight: 500;
    font-size: 11.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 3px;
}

.nav-right a::after {
    content: '';
    position: absolute;
    left: 0; right: 100%;
    bottom: 0;
    height: 1px;
    background: var(--plum);
    transition: right 0.25s ease;
}

.nav-right a:hover::after { right: 0; }

.cart-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-badge {
    background: var(--plum);
    color: var(--white);
    font-size: 10px;
    font-weight: 600;
    border-radius: 50%;
    min-width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    letter-spacing: 0;
    text-transform: none;
}

/* ---------------- Listing page (lululemon-style) ---------------- */
body.listing-page { background: var(--white); }
body.listing-page header { background: rgba(255, 255, 255, 0.94); }

.listing-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 44px 32px 28px;
    border-bottom: 1px solid var(--line);
}

.listing-head h1 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 40px;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.listing-head h1 .brand { color: var(--plum); }

.listing-head .listing-sub {
    margin-top: 8px;
    font-size: 14px;
    color: var(--stone);
}

.listing-count {
    font-size: 13px;
    color: var(--stone);
    white-space: nowrap;
}

/* Edge-to-edge grid with hairline dividers */
.product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* Hairlines drawn per card so an incomplete last row leaves no filler block */
    overflow: hidden;
}

@media (max-width: 1400px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1100px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .product-grid { grid-template-columns: repeat(2, 1fr); } }

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line), 1px 1px 0 var(--line);
}

.product-media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #ececec;
}

.product-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.product-media img.is-active { opacity: 1; }

.product-info { padding: 16px 18px 22px; }

.product-info .swatch-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.product-info .swatch {
    width: 20px;
    height: 20px;
    border: 2px solid var(--white);
    box-shadow: 0 0 0 1px #cfcac3;
}

.product-info .swatch.is-selected { box-shadow: 0 0 0 1.5px var(--ink); }

.product-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.product-title-row h3 {
    font-family: var(--sans);
    font-weight: 500;
    font-size: 15px;
    line-height: 1.35;
    color: var(--ink);
}

.product-title-row h3 a { text-decoration: none; color: inherit; }
.product-title-row h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }

.wish-btn {
    flex: none;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: none;
    color: var(--ink);
    cursor: pointer;
}

.wish-btn svg { width: 20px; height: 20px; display: block; margin: auto; }
.wish-btn.is-active { color: var(--plum); }
.wish-btn.is-active svg path { fill: currentColor; }

.product-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 13px;
    color: var(--ink);
}

.product-meta-row .product-price { font-weight: 500; }

@media (max-width: 760px) {
    body { padding-top: 64px; }
    .navbar { height: 64px; }
    .container { padding: 0 16px; }
    .logo-image { height: 28px; }
    .nav-right { gap: 18px; }
    .nav-right a { font-size: 10.5px; letter-spacing: 0.08em; }
    .listing-head { flex-direction: column; align-items: flex-start; padding: 28px 16px 20px; gap: 8px; }
    .listing-head h1 { font-size: 28px; }
    .product-info { padding: 12px 10px 18px; }
    .product-info .swatch { width: 16px; height: 16px; }
    .product-title-row h3 { font-size: 13.5px; }
    .product-meta-row { font-size: 12px; }
}

/* Base swatch (also used on product page) */
.swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--white);
    box-shadow: 0 0 0 1px var(--line);
    cursor: pointer;
    padding: 0;
}

.swatch.is-selected {
    box-shadow: 0 0 0 1.5px var(--plum);
}

.btn {
    display: inline-block;
    text-align: center;
    padding: 14px 24px;
    border-radius: 2px;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid var(--ink);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--ink);
    color: var(--white);
    border-color: var(--ink);
}

.btn-primary:hover { background: var(--plum); border-color: var(--plum); }

.btn-outline {
    background: transparent;
    color: var(--ink);
}

.btn-outline:hover { background: var(--ink); color: var(--white); }

.btn-block { width: 100%; }

/* ---------------- Product detail page ---------------- */
.product-detail {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 72px;
    padding: 44px 0 100px;
}

@media (max-width: 860px) {
    .product-detail { grid-template-columns: 1fr; gap: 32px; }
}

.gallery-main {
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--cream-deep);
    margin-bottom: 16px;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

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

.gallery-thumbs img {
    width: 62px;
    height: 78px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.gallery-thumbs img.is-active {
    opacity: 1;
    box-shadow: 0 0 0 1px var(--ink);
}

.pd-breadcrumb {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--stone);
    margin-bottom: 20px;
}

.pd-breadcrumb a { color: var(--stone); text-decoration: none; }
.pd-breadcrumb a:hover { color: var(--plum); }

.product-detail h1 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 34px;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.pd-sku {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--stone);
    margin-bottom: 18px;
}

.pd-price {
    font-size: 19px;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 26px;
}

.pd-desc {
    color: #4a4038;
    margin-bottom: 18px;
    font-size: 15px;
    line-height: 1.7;
    max-width: 460px;
}

.pd-materials {
    background: var(--cream-deep);
    border-radius: 2px;
    padding: 16px 18px;
    margin-bottom: 30px;
    font-size: 12.5px;
    max-width: 460px;
}

.pd-materials-row {
    display: flex;
    gap: 6px;
}

.pd-materials-row + .pd-materials-row {
    margin-top: 6px;
}

.pd-materials-label {
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 10.5px;
    color: var(--ink);
    padding-top: 1px;
}

.pd-materials-pending {
    color: var(--stone);
    font-style: italic;
}

.option-label {
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    gap: 6px;
    color: var(--ink);
}

.option-label .option-value { font-weight: 400; color: var(--stone); text-transform: none; letter-spacing: 0; }

.pd-colors {
    display: flex;
    gap: 11px;
    margin-bottom: 28px;
}

.pd-colors .swatch { width: 28px; height: 28px; }

.size-row {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
}

.size-btn {
    width: 46px;
    height: 42px;
    border-radius: 2px;
    border: 1px solid var(--line);
    background: var(--white);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.size-btn:hover { border-color: var(--ink); }

.size-btn.is-selected {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--white);
}

.qty-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
}

.qty-stepper {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 2px;
    overflow: hidden;
}

.qty-stepper button {
    width: 36px;
    height: 38px;
    border: none;
    background: var(--cream-deep);
    font-size: 15px;
    cursor: pointer;
}

.qty-stepper input {
    width: 40px;
    text-align: center;
    border: none;
    font-size: 14px;
    background: transparent;
}

.pd-actions { display: flex; gap: 12px; margin-bottom: 10px; max-width: 460px; }

.add-toast {
    display: none;
    margin-top: 16px;
    padding: 13px 16px;
    background: var(--cream-deep);
    color: var(--ink);
    border-radius: 2px;
    font-size: 12.5px;
    letter-spacing: 0.04em;
    font-weight: 500;
    max-width: 460px;
}

.add-toast.show { display: block; }

/* ---------------- Cart page ---------------- */
.cart-page { padding: 56px 0 100px; min-height: 50vh; }

.cart-page h1 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 32px;
    margin-bottom: 40px;
}

.cart-item {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
}

.cart-item img {
    width: 70px;
    height: 88px;
    object-fit: cover;
    background: var(--cream-deep);
}

.cart-item-info { flex: 1; }
.cart-item-info h4 { font-family: var(--serif); font-weight: 500; font-size: 16px; margin-bottom: 5px; }
.cart-item-info .meta { font-size: 12px; letter-spacing: 0.03em; color: var(--stone); }

.cart-item-qty {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 2px;
    overflow: hidden;
}

.cart-item-qty button {
    width: 28px; height: 28px; border: none; background: var(--cream-deep); cursor: pointer;
}

.cart-item-qty span { width: 28px; text-align: center; font-size: 13px; }

.cart-item-price { width: 90px; text-align: right; font-weight: 500; font-size: 14px; }

.remove-link {
    color: var(--stone);
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 14px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.remove-link:hover { color: var(--plum); }

.cart-summary {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--ink);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
}

.cart-summary span:last-child {
    font-size: 19px;
    letter-spacing: 0;
    text-transform: none;
    font-family: var(--serif);
    font-weight: 500;
}

.cart-empty {
    text-align: center;
    padding: 70px 0;
    color: var(--stone);
}

.checkout-form {
    max-width: 460px;
    margin-top: 48px;
}

.checkout-form h2 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 21px;
    margin-bottom: 22px;
}

.form-row { margin-bottom: 16px; }

.form-row label {
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--stone);
    margin-bottom: 7px;
}

.form-row input, .form-row textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 2px;
    font-size: 14px;
    background: var(--white);
}

.form-row input:focus, .form-row textarea:focus {
    outline: none;
    border-color: var(--ink);
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.checkout-error {
    margin: 4px 0 14px;
    padding: 12px 14px;
    background: #fbe9ea;
    color: #8a1f2b;
    border-radius: 2px;
    font-size: 13px;
}

.checkout-error[hidden] { display: none; }

.checkout-note a { color: var(--plum); }

.checkout-note {
    font-size: 11.5px;
    color: var(--stone);
    margin-top: 12px;
}

.order-confirm {
    display: none;
    text-align: center;
    padding: 80px 0;
}

.order-confirm.show { display: block; }

.order-confirm h2 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 26px;
    margin-bottom: 10px;
}

.order-confirm .check {
    width: 56px; height: 56px;
    background: var(--cream-deep);
    color: var(--plum);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 22px;
}

/* ---------------- Footer ---------------- */
footer {
    background: var(--ink);
    color: #a89a8f;
    padding: 36px 0;
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

footer a { color: #d8b8d6; text-decoration: none; }
footer a:hover { color: var(--white); }
