:root {
  --ink: #2a1520;
  --muted: #705a64;
  --paper: #fbf7f1;
  --surface: #ffffff;
  --line: #e7dcd2;
  --royal: #4a1230;
  --royal-dark: #320a20;
  --gold: #b98a2f;
  --gold-soft: #f0dfba;
  --error: #a4262c;
  --success: #24663f;
  --serif: "Cormorant Garamond", "Noto Serif Malayalam", Georgia, serif;
  --sans: "Jost", "Noto Sans Malayalam", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); font: 400 17px/1.55 var(--sans); }
main { flex: 1; width: 100%; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.page { padding-top: 32px; padding-bottom: 64px; }
.page-title { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 24px; }

.demo-notice { background: var(--gold-soft); color: #4d3808; text-align: center; font-size: 14px; padding: 6px 16px; }

/* Header and footer */
.site-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px var(--gutter); background: var(--royal); color: #fff; border-bottom: 1px solid rgba(240,223,186,.18); transition: box-shadow .25s ease; }
.site-header.scrolled { box-shadow: 0 6px 20px rgba(42,8,26,.22); }
.logo { display: inline-flex; align-items: center; gap: clamp(10px, 1.6vw, 14px); text-decoration: none; }
.logo-crown { flex: none; width: clamp(36px, 5.5vw, 46px); height: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); transition: transform .3s ease; }
.logo:hover .logo-crown { transform: translateY(-2px) rotate(-4deg); }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-name { font: 600 clamp(1.75rem, 5vw, 2.5rem)/1 var(--serif); letter-spacing: .035em; }
.logo-tag { margin-top: 5px; padding-left: 3px; color: var(--gold-soft); font: 500 clamp(9px, 1.4vw, 11px)/1 var(--sans); letter-spacing: .5em; text-transform: uppercase; }
.site-header nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); }
.site-header nav a { position: relative; text-decoration: none; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
.site-header nav a:hover { color: var(--gold-soft); }
.site-header nav a:not(.cart-link)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: var(--gold-soft); transform: scaleX(0); transition: transform .25s ease; }
.site-header nav a:hover::after { transform: scaleX(1); }
.cart-link { display: inline-flex; align-items: center; gap: 6px; }
.cart-count { display: inline-grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 11px; background: var(--gold-soft); color: var(--royal-dark); font-size: 13px; font-weight: 500; }
.site-footer { padding: 48px var(--gutter) 20px; background: var(--royal-dark); color: #eadfe4; border-top: 3px solid var(--gold); }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; max-width: 1240px; margin: 0 auto; }
.footer-brand { font: 600 1.8rem var(--serif); color: #fff; }
.footer-tag { margin: 8px 0 0; max-width: 30ch; color: #cdb9c3; font-size: 15px; }
.footer-head { margin-bottom: 12px; font: 500 13px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-soft); }
.site-footer nav { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.site-footer nav a { text-decoration: none; overflow-wrap: anywhere; }
.site-footer nav a:hover { color: var(--gold-soft); text-decoration: underline; }
.footer-base { max-width: 1240px; margin: 36px auto 0; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); color: #b9a5af; font-size: 13px; }

/* Buttons and messages */
.btn { transition: background .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease; letter-spacing: .03em; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 26px; border: 1px solid var(--royal); border-radius: 2px; background: var(--royal); color: #fff; text-decoration: none; cursor: pointer; font-weight: 500; }
.btn:hover { background: var(--royal-dark); box-shadow: 0 6px 16px rgba(74,18,48,.18); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-outline { background: transparent; color: var(--royal); }
.btn-outline:hover { background: var(--royal); color: #fff; }
.btn-small { min-height: 38px; padding: 5px 14px; font-size: 15px; }
.btn-danger { border-color: var(--error); background: transparent; color: var(--error); }
.btn-danger:hover { background: var(--error); color: #fff; }
.btn-block { width: 100%; }
.link-button { padding: 0; border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 15px; }
.message { margin: 12px 0; padding: 10px 14px; border-left: 3px solid var(--error); background: #fbeeee; color: var(--error); }
.message.ok { border-color: var(--success); background: #edf6f0; color: var(--success); }
.status { padding: 48px 0; text-align: center; color: var(--muted); }

/* Slider basics */
.slider { position: relative; }
.slider-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slider-track::-webkit-scrollbar { display: none; }
.slider-track > * { scroll-snap-align: start; flex: 0 0 auto; }
.slider-arrow { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -22px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.92); color: var(--royal); cursor: pointer; font-size: 24px; line-height: 1; }
.slider-arrow:hover { background: #fff; border-color: var(--royal); }
.slider-arrow[data-prev] { left: 12px; }
.slider-arrow[data-next] { right: 12px; }
.slider-dots { display: flex; justify-content: center; gap: 2px; padding: 8px 0; }
.slider-dots button { width: 26px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer; }
.slider-dots button::before { content: ""; display: block; width: 9px; height: 9px; margin: auto; border-radius: 50%; background: #cdbdb3; }
.slider-dots button[aria-current="true"]::before { background: var(--royal); }

/* Home banner */
.banner-slide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; min-height: min(68vh, 560px); background: var(--royal); color: #fff; }
.banner-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 16px; padding: 40px clamp(68px, 8vw, 110px); }
.banner-kicker { color: var(--gold-soft); font-size: 15px; letter-spacing: .14em; text-transform: uppercase; }
.banner-title { font-size: clamp(2.3rem, 5.4vw, 4.6rem); }
.banner-price { font-size: 1.2rem; }
.banner-copy .btn { border-color: var(--gold-soft); background: var(--gold-soft); color: var(--royal-dark); }
.banner-copy .btn:hover { background: #fff; }
.banner-image { position: relative; min-height: 320px; background: var(--royal-dark); }
.banner-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.banner .slider-dots { position: absolute; left: 0; right: 0; bottom: 4px; }
.banner .slider-dots button::before { background: rgba(255,255,255,.5); }
.banner .slider-dots button[aria-current="true"]::before { background: var(--gold-soft); }

/* Dress sections */
.section { padding-top: 56px; }
.section:last-child { padding-bottom: 72px; }
.section-title { margin-bottom: 24px; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.section-title::after { content: ""; display: block; width: 56px; height: 2px; margin-top: 10px; background: var(--gold); }
.row .slider-track { column-gap: 18px; }
.row .card { width: clamp(190px, 24vw, 280px); }
.row .slider-arrow { top: 40%; }
.card { display: block; text-decoration: none; }
.card-image { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: #efe7df; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, opacity .4s ease; }
.card-image .card-alt { position: absolute; inset: 0; opacity: 0; }
.card:hover .card-image img { transform: scale(1.04); }
.card:hover .card-image .card-alt { opacity: 1; }
.card-name { display: block; margin-top: 12px; font-size: 16px; }
.card:hover .card-name { color: var(--royal); text-decoration: underline; text-underline-offset: 3px; }
.card-price { display: block; font-weight: 500; color: var(--royal); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 32px 20px; }

/* Dress page */
.product { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.gallery .slider-track > * { width: 100%; aspect-ratio: 4 / 5; background: #efe7df; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs button { width: 64px; height: 80px; padding: 0; border: 1px solid var(--line); background: none; cursor: pointer; }
.thumbs button[aria-current="true"] { border: 2px solid var(--royal); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product-name { font-size: clamp(2rem, 4.5vw, 3rem); }
.product-price { margin: 10px 0 18px; color: var(--royal); font-size: 1.5rem; font-weight: 500; }
.product-description { margin: 0 0 22px; white-space: pre-line; }
.option-label { display: block; margin-bottom: 8px; font-weight: 500; }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; border: 0; }
.sizes label { cursor: pointer; }
.sizes input { position: absolute; opacity: 0; }
.sizes span { display: grid; place-items: center; min-width: 50px; height: 46px; padding: 0 12px; border: 1px solid #bcaaa0; background: var(--surface); }
.sizes input:checked + span { border-color: var(--royal); background: var(--royal); color: #fff; }
.sizes input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.product-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.product-actions .btn { flex: 1 1 190px; }

/* Cart */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.cart-line { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 96px; height: 120px; object-fit: cover; background: #efe7df; }
.cart-line h2 { font: 500 1.05rem var(--sans); }
.cart-line h2 a { text-decoration: none; }
.cart-meta { color: var(--muted); font-size: 15px; }
.qty { display: inline-flex; align-items: center; margin: 10px 14px 0 0; border: 1px solid #bcaaa0; }
.qty button { width: 38px; height: 38px; border: 0; background: var(--surface); cursor: pointer; font-size: 18px; }
.qty span { min-width: 34px; text-align: center; }
.line-total { font-weight: 500; white-space: nowrap; }
.summary { position: sticky; top: 90px; padding: 22px; border: 1px solid var(--line); background: var(--surface); }
.summary h2 { margin-bottom: 14px; font-size: 1.6rem; }
.summary-row { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 8px; font-size: 16px; }
.summary-row.total { margin: 14px 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 1.2rem; font-weight: 500; }
.empty { padding: 48px 0; text-align: center; }
.empty p { margin: 0 0 20px; color: var(--muted); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field > span, .field > label { font-size: 15px; font-weight: 500; }
.field input, .field textarea, .field select { width: 100%; min-height: 46px; padding: 9px 12px; border: 1px solid #bcaaa0; border-radius: 2px; background: var(--surface); }
.hint { color: var(--muted); font-size: 14px; font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--royal); }
.check.full { grid-column: 1 / -1; }
.confirmation { padding: 48px 0; text-align: center; }
.confirmation p { color: var(--muted); }
.confirmation strong { color: var(--ink); }

/* Admin */
.admin-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.tabs { display: flex; gap: 6px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.tabs button { min-height: 44px; padding: 8px 16px; border: 0; border-bottom: 3px solid transparent; background: none; cursor: pointer; }
.tabs button[aria-selected="true"] { border-color: var(--royal); color: var(--royal); font-weight: 500; }
.panel { padding: 22px; border: 1px solid var(--line); background: var(--surface); }
.login { max-width: 400px; margin: 24px auto; }
.login .field { margin-bottom: 14px; }
.admin-layout { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 32px; align-items: start; }
.admin-layout h2 { margin-bottom: 14px; font-size: 1.7rem; }
.photo-list { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-item { position: relative; width: 84px; }
.photo-item img { width: 84px; height: 105px; object-fit: cover; background: #efe7df; }
.photo-item button { position: absolute; top: 3px; right: 3px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(30,10,20,.8); color: #fff; cursor: pointer; }
.size-options { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.admin-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.admin-item img { width: 64px; height: 80px; object-fit: cover; background: #efe7df; }
.admin-item-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #efe7df; color: var(--muted); font-size: 13px; }
.tag.paid { background: #e0f0e6; color: var(--success); }
.tag.pending { background: var(--gold-soft); color: #4d3808; }
.order { margin-bottom: 14px; padding: 18px; border: 1px solid var(--line); background: var(--surface); }
.order-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.order-ref { font-weight: 500; }
.order ul { margin: 8px 0; padding-left: 20px; }
.order address { color: var(--muted); font-style: normal; font-size: 15px; }
.order-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.order-actions select { min-height: 40px; padding: 4px 8px; }

/* Policies */
.policy h2 { margin: 32px 0 8px; font-size: 1.8rem; scroll-margin-top: 80px; }
.policy p { margin: 0 0 12px; }

/* Language switch */
.lang-toggle { min-height: 34px; padding: 4px 12px; border: 1px solid rgba(240,223,186,.55); border-radius: 999px; background: transparent; color: var(--gold-soft); cursor: pointer; font-size: 14px; line-height: 1; white-space: nowrap; transition: background .2s ease, color .2s ease; }
.lang-toggle:hover { background: var(--gold-soft); color: var(--royal-dark); }

/* Malayalam needs taller lines and no letter-spacing, or the letters get cramped */
html[lang="ml"] body { line-height: 1.7; }
html[lang="ml"] h1, html[lang="ml"] h2, html[lang="ml"] h3 { line-height: 1.4; }
html[lang="ml"] .site-header nav a, html[lang="ml"] .banner-kicker, html[lang="ml"] .footer-head, html[lang="ml"] .btn { letter-spacing: 0; text-transform: none; }
html[lang="ml"] .banner-title { font-size: clamp(1.9rem, 4.4vw, 3.6rem); }
html[lang="ml"] .page-title { font-size: clamp(1.6rem, 4vw, 2.5rem); }
html[lang="ml"] .section-title { font-size: clamp(1.5rem, 3.4vw, 2.2rem); }
html[lang="ml"] .product-name { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
html[lang="ml"] .footer-head { font-size: 14px; }

/* Perks strip under the banner */
.perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 1240px; margin: 0 auto; padding: 22px var(--gutter); list-style: none; border-bottom: 1px solid var(--line); }
.perks li { display: flex; align-items: center; gap: 12px; justify-content: center; }
.perks svg { flex: none; width: 30px; height: 30px; fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.perks span { display: flex; flex-direction: column; color: var(--muted); font-size: 14px; line-height: 1.35; }
.perks strong { color: var(--ink); font-weight: 500; font-size: 15px; }

/* Banner photo eases in */
.banner-photo { animation: bannerZoom 9s ease-out both; }
@keyframes bannerZoom { from { transform: scale(1.06); } to { transform: scale(1); } }
.banner-copy > * { animation: rise .7s ease both; }
.banner-copy > :nth-child(2) { animation-delay: .1s; }
.banner-copy > :nth-child(3) { animation-delay: .2s; }
.banner-copy > :nth-child(4) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Fade-in on scroll */
.fade { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.fade.in { opacity: 1; transform: none; }

/* Dress page extras */
.back-link { display: inline-block; margin-bottom: 18px; color: var(--muted); font-size: 15px; text-decoration: none; }
.back-link:hover { color: var(--royal); }
.product-info { margin: 26px 0 18px; padding: 16px 0 0; border-top: 1px solid var(--line); list-style: none; color: var(--muted); font-size: 15px; }
.product-info li { position: relative; padding: 4px 0 4px 26px; }
.product-info li::before { content: "✓"; position: absolute; left: 0; color: var(--gold); font-weight: 500; }
.product-info strong { color: var(--ink); font-weight: 500; }
.btn-wa { border-color: #1f8f4e; background: #fff; color: #17703c; }
.btn-wa:hover { background: #1f8f4e; color: #fff; }
.sizes span { transition: border-color .15s ease, background .15s ease; }
.sizes label:hover span { border-color: var(--royal); }
.shake { animation: shake .4s ease; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

/* Cart extras */
.free { color: var(--success); font-weight: 500; }
.secure-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.continue-link { display: block; margin-top: 14px; color: var(--muted); font-size: 15px; text-align: center; }
.cart-count.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.35); } }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; display: flex; align-items: center; gap: 18px; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 4px; background: var(--ink); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 15px; opacity: 0; pointer-events: none; transform: translate(-50%, 20px); transition: opacity .25s ease, transform .25s ease; }
.toast.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.toast a { color: var(--gold-soft); font-weight: 500; white-space: nowrap; }

/* WhatsApp chat button */
.wa-float { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #25d366; color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.2); transition: transform .2s ease; }
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 30px; height: 30px; }

@media (prefers-reduced-motion: reduce) {
  .banner-photo, .banner-copy > *, .shake, .cart-count.bump { animation: none; }
  .fade { opacity: 1; transform: none; }
}

@media (max-width: 860px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-inner > :first-child { grid-column: 1 / -1; }
  .banner-slide, .product, .cart-layout, .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .banner-copy { order: 2; min-height: 250px; padding: 24px var(--gutter) 44px; }
  .banner .slider-arrow { top: 160px; }
  .banner-image { min-height: 320px; }
  .summary { position: static; }
}
@media (max-width: 640px) {
  .perks { grid-template-columns: 1fr; gap: 12px; padding: 18px var(--gutter); }
  .perks li { justify-content: flex-start; }
}
@media (max-width: 430px) {
  .site-header nav .nav-dresses { display: none; }
}
@media (max-width: 520px) {
  .site-header nav a { font-size: 13px; letter-spacing: .04em; }
  .site-header nav { gap: 12px; }
  .lang-toggle { min-height: 30px; padding: 3px 9px; font-size: 12.5px; }
  .logo-crown { width: 32px; }
  .logo-name { font-size: 1.6rem; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .cart-line { grid-template-columns: 76px minmax(0, 1fr); }
  .cart-line img { width: 76px; height: 95px; }
  .line-total { grid-column: 2; }
  .admin-item { grid-template-columns: 56px minmax(0, 1fr); }
  .admin-item img { width: 56px; height: 70px; }
  .admin-item-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
