/* ==========================================================================
   Beyaz Saray Boza & Dondurma — storefront design system (v3)
   Warm cream / gold, fully sans-serif (Plus Jakarta Sans), mobile-first, RTL-aware.
   ========================================================================== */

:root {
    --cream:       #FBF7EF;
    --cream-2:     #F4ECDB;
    --surface:     #FFFFFF;
    --gold:        #C8A24B;
    --gold-deep:   #A9822F;
    --gold-soft:   #FBF3DE;
    --ink:         #2E2A24;
    --ink-soft:    #6B5D49;
    --ink-faint:   #9A8C76;
    --line:        #EAE0CD;
    --line-strong: #DDCFB2;
    --green:       #25D366;
    --green-deep:  #1EA855;
    --danger:      #C0392B;
    --danger-bg:   #FBE7E4;

    --r-sm: 10px; --r: 14px; --r-lg: 20px; --pill: 999px;
    --sh-sm: 0 2px 8px rgba(46, 42, 36, .06);
    --sh:    0 6px 20px rgba(46, 42, 36, .09);
    --sh-lg: 0 18px 44px rgba(46, 42, 36, .16);

    --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
    --header-h: 64px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--cream);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---- Header ------------------------------------------------------------ */
.site-header {
    position: sticky; top: 0; z-index: 40;
    background: rgba(255, 253, 248, .92);
    backdrop-filter: saturate(140%) blur(8px);
    border-bottom: 1px solid var(--line);
}
.header-inner { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { min-width: 0; display: block; }
.brand-title { font-weight: 800; font-size: clamp(1.05rem, 4.2vw, 1.55rem); letter-spacing: -.3px; color: var(--ink); line-height: 1.1; }
.brand-tagline { font-size: clamp(.68rem, 2.4vw, .82rem); font-weight: 600; letter-spacing: .2px; color: var(--gold-deep); margin-top: 2px; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.lang-switch { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pill); padding: 3px; }
.lang-switch a { font-size: .75rem; font-weight: 700; padding: 5px 8px; border-radius: var(--pill); color: var(--ink-soft); line-height: 1; display: inline-flex; align-items: center; gap: 5px; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a.active { background: var(--gold); color: #fff; }
.lang-switch .code { text-transform: uppercase; }
.lang-switch .flag { display: inline-flex; }
.flag-svg { width: 20px; height: 13px; display: block; border-radius: 2.5px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .07); }

.acct-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: var(--pill); padding: 8px 13px; font-size: .8rem; font-weight: 700; max-width: 150px; }
.acct-btn:hover { background: var(--cream-2); }
.acct-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.acct-name { line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cart-toggle { position: relative; border: none; background: var(--gold); color: #fff; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--sh-sm); transition: transform .15s, background .15s; }
.cart-toggle:hover { background: var(--gold-deep); }
.cart-toggle:active { transform: scale(.94); }
.cart-toggle svg { width: 21px; height: 21px; }
.cart-count { position: absolute; top: -4px; inset-inline-end: -4px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 800; min-width: 20px; height: 20px; border-radius: var(--pill); display: none; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid var(--cream); }
.cart-count.show { display: inline-flex; }

/* ---- Layout & hero ----------------------------------------------------- */
.container { max-width: 1180px; margin: 0 auto; padding: 8px 16px 64px; }

.build-cta { text-align: center; padding: 30px 16px 26px; margin: 12px 0 8px; background: radial-gradient(120% 100% at 50% 0%, var(--gold-soft), var(--cream)); border-radius: var(--r-lg); border: 1px solid var(--line); }
.build-cta .eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: 1.2px; color: var(--gold-deep); text-transform: uppercase; margin-bottom: 14px; }
.btn-builder { background: var(--gold); color: #fff; border: none; border-radius: var(--r); padding: 15px 28px; font-size: 1.08rem; font-weight: 800; letter-spacing: -.2px; display: inline-flex; align-items: center; gap: 10px; box-shadow: 0 10px 26px rgba(200, 162, 75, .38); transition: transform .12s, background .15s; }
.btn-builder:hover { background: var(--gold-deep); }
.btn-builder:active { transform: scale(.98); }
.btn-builder svg { width: 24px; height: 24px; }
.build-sub { color: var(--ink-soft); font-size: .9rem; margin: 14px 0 0; }

.section-title { font-weight: 800; font-size: clamp(1.15rem, 4.5vw, 1.5rem); letter-spacing: .3px; text-transform: uppercase; color: var(--ink); margin: 30px 0 16px; display: flex; align-items: center; gap: 12px; }
.section-title::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--gold), transparent); }
[dir="rtl"] .section-title::after { background: linear-gradient(270deg, var(--gold), transparent); }

/* ---- Product grid & cards --------------------------------------------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }

.flavor-card, .card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--sh-sm);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.flavor-card { cursor: pointer; }
.flavor-card:hover, .card:hover { transform: translateY(-3px); box-shadow: var(--sh); }
.flavor-card:hover, .flavor-card:focus-visible { border-color: var(--gold); outline: none; }
.card-media { position: relative; aspect-ratio: 1 / 1; background: var(--cream-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.flavor-name, .card-title { font-weight: 600; font-size: 1rem; color: var(--ink); line-height: 1.2; }
.flavor-name { padding: 11px 12px 3px; }
.flavor-add { display: flex; align-items: center; gap: 5px; color: var(--gold-deep); font-size: .8rem; font-weight: 700; padding: 0 12px 12px; }
.flavor-add svg { width: 15px; height: 15px; }

.card-body { padding: 12px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card-title { margin: 0; }
.extra-price { font-weight: 800; color: var(--gold-deep); font-size: 1.05rem; }

/* GRAMLA AL cards reuse the .flavor-card look (big photo + name + Sepete Ekle);
   the by-weight size selection now happens in the builder modal. */

/* ---- Buttons ----------------------------------------------------------- */
.btn { border: none; border-radius: var(--r-sm); padding: 11px 15px; font-weight: 700; font-size: .92rem; transition: background .15s, transform .1s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--gold); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--gold-deep); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #443d31; }
.btn-add { background: var(--ink); color: #fff; margin-top: auto; }
.btn-add:hover { background: #443d31; }
.btn-add.added { background: var(--green-deep); }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--cream-2); }
.btn-wa { background: var(--green); color: #fff; }
.btn-wa:hover { background: var(--green-deep); }
.btn-wa svg { width: 20px; height: 20px; }
.btn-wa.used { background: #9fd9b3; pointer-events: none; }

/* ---- Drawer (cart / checkout) ----------------------------------------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(30, 24, 16, .48); opacity: 0; visibility: hidden; transition: opacity .25s; z-index: 50; }
.drawer-overlay.open { opacity: 1; visibility: visible; }
.drawer { position: fixed; top: 0; inset-inline-end: 0; height: 100%; width: 420px; max-width: 100%; background: var(--cream); z-index: 60; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s cubic-bezier(.4, 0, .2, 1); box-shadow: -14px 0 40px rgba(0, 0, 0, .18); }
[dir="rtl"] .drawer { transform: translateX(-100%); box-shadow: 14px 0 40px rgba(0, 0, 0, .18); }
.drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.drawer-header h2 { margin: 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -.2px; }
.drawer-close { border: none; background: none; font-size: 1.7rem; line-height: 1; color: var(--ink-soft); width: 36px; height: 36px; border-radius: 50%; }
.drawer-close:hover { background: var(--cream-2); }
.drawer-step { flex: 1; display: flex; flex-direction: column; overflow-y: auto; padding: 16px; gap: 12px; }

.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px; }
.ci-main { min-width: 0; }
.ci-name { font-weight: 700; font-size: .95rem; }
.ci-meta { font-size: .8rem; color: var(--ink-soft); margin-top: 2px; line-height: 1.35; }
.ci-note { font-size: .78rem; color: var(--gold-deep); margin-top: 2px; }
.ci-unit { font-size: .8rem; color: var(--gold-deep); font-weight: 700; margin-top: 4px; }
.ci-line { font-weight: 800; white-space: nowrap; }
.ci-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
/* One stepper component, used everywhere (cart qty, scoops, add-ons) */
.qty, .stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--pill); overflow: hidden; background: var(--surface); }
.qty button, .stepper button { width: 30px; height: 30px; border: none; background: var(--cream-2); font-size: 1.05rem; font-weight: 700; color: var(--ink); line-height: 1; }
.qty button:hover, .stepper button:hover { background: var(--gold); color: #fff; }
.qty > span, .stepper > span { min-width: 30px; text-align: center; font-weight: 700; font-size: .9rem; }
.ci-actions { display: flex; gap: 10px; align-items: center; }
.ci-edit { border: none; background: none; color: var(--gold-deep); font-size: .74rem; font-weight: 700; padding: 0; }
.ci-remove { border: none; background: none; color: var(--danger); font-size: .74rem; font-weight: 700; padding: 0; }
.cart-empty { text-align: center; color: var(--ink-soft); padding: 44px 10px; }

.drawer-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.drawer-footer[hidden] { display: none !important; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.25rem; font-weight: 800; }
.total-row .amount { color: var(--gold-deep); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: .82rem; font-weight: 700; color: var(--ink-soft); }
.field input, .field textarea { font-family: inherit; font-size: .95rem; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); width: 100%; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.field textarea { resize: vertical; min-height: 70px; }
.pay-opts { display: flex; gap: 10px; }
.pay-opt { flex: 1; cursor: pointer; position: relative; }
.pay-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.pay-card { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px 10px; background: var(--surface); font-weight: 600; font-size: .92rem; color: var(--ink); transition: all .12s; }
.pay-card svg { width: 20px; height: 20px; color: var(--ink-soft); }
.pay-opt input:checked + .pay-card { border: 2px solid var(--gold); background: var(--gold-soft); color: var(--gold-deep); padding: 12px 10px; }
.pay-opt input:checked + .pay-card svg { color: var(--gold-deep); }
.pay-opt input:focus-visible + .pay-card { outline: 2px solid var(--gold); }
.hint { font-size: .82rem; padding: 10px 12px; border-radius: var(--r-sm); }
.hint.info { background: var(--gold-soft); color: var(--gold-deep); }
.hint.ok { background: #E6F6EC; color: #1f7a44; }
.hint.error { background: var(--danger-bg); color: var(--danger); }
.checkout-intro { font-size: .84rem; color: var(--ink-soft); margin: 0 0 2px; }
.login-cta { font-size: .85rem; color: var(--ink-soft); margin: 0 0 4px; }
.login-cta a { color: var(--gold-deep); font-weight: 700; text-decoration: underline; }
.checkout-summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; }
.sum-line { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.sum-line:last-child { border-bottom: none; }
.sum-line .muted { color: var(--ink-soft); font-weight: 400; }
.sum-total { font-weight: 800; font-size: .98rem; padding-top: 8px; }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.form-actions .btn { flex: 1; }

.success-box { text-align: center; margin: auto; padding: 26px 10px; }
.success-box .tick { width: 72px; height: 72px; border-radius: 50%; background: var(--green); color: #fff; font-size: 2.4rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.success-box .tick svg { width: 34px; height: 34px; }
.success-box h3 { margin: 0 0 8px; font-size: 1.4rem; font-weight: 800; }
.success-box .btn { width: 100%; margin-top: 10px; }
.wa-info { font-size: .85rem; color: var(--ink-soft); margin: 6px 0 10px; }

/* ---- Builder modal ----------------------------------------------------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(30, 24, 16, .52); opacity: 0; visibility: hidden; transition: opacity .25s; z-index: 70; }
.modal-overlay.open { opacity: 1; visibility: visible; }
.builder { position: fixed; z-index: 80; background: var(--cream); left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.98); width: 460px; max-width: calc(100% - 24px); max-height: 90vh; border-radius: var(--r-lg); display: flex; flex-direction: column; overflow: hidden; opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s; box-shadow: var(--sh-lg); }
.builder.open { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.builder-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.builder-head h2 { margin: 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -.2px; }
.builder-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.builder-foot { padding: 13px 18px; border-top: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; gap: 12px; }
.builder-foot .btn { flex: 1; }
.b-total { font-size: 1.35rem; font-weight: 800; color: var(--gold-deep); }
.b-label { font-weight: 700; font-size: .9rem; margin-bottom: 9px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.scoops-left { font-size: .8rem; color: var(--gold-deep); font-weight: 700; }
.scoops-left.full { color: var(--danger); }
.vessel-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; }
.size-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vessel-opt, .size-opt { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 11px 6px; text-align: center; cursor: pointer; font-weight: 700; transition: all .12s; }
.vessel-opt:hover, .size-opt:hover { border-color: var(--gold); }
.vessel-opt.active, .size-opt.active { border: 2px solid var(--gold); background: var(--gold-soft); }
.vessel-opt .v-name { display: block; font-weight: 700; font-size: .88rem; }
.vessel-opt .v-meta { display: block; font-size: .68rem; color: var(--ink-soft); margin-top: 2px; font-weight: 500; }
.flavor-picker { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.fp-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 7px 9px; }
.fp-row.active { border-color: var(--gold); background: var(--gold-soft); }
.fp-row img { width: 42px; height: 42px; border-radius: var(--r-sm); object-fit: cover; flex-shrink: 0; }
.fp-name { flex: 1; font-size: .9rem; font-weight: 500; }
.fp-sc { min-width: 30px; text-align: center; font-weight: 800; color: var(--gold-deep); }
.stepper { margin-inline-start: auto; }
.addon-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; }
.addon-row em { color: var(--gold-deep); font-style: normal; font-weight: 700; font-size: .85rem; }
.opt-toggle { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.opt-toggle:last-child { border-bottom: none; }
.free-tag { color: #1f7a44; font-style: normal; font-size: .78rem; font-weight: 700; }
.switch { position: relative; width: 46px; height: 26px; display: inline-block; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch > span { position: absolute; inset: 0; background: var(--line-strong); border-radius: var(--pill); transition: background .2s; }
.switch > span::before { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(20px); }
[dir="rtl"] .switch input:checked + span::before { transform: translateX(-20px); }
.serving-note { width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 12px; font-family: inherit; font-size: .92rem; resize: vertical; min-height: 56px; background: var(--surface); }

/* ---- Footer / socials -------------------------------------------------- */
.site-footer { background: var(--cream-2); border-top: 1px solid var(--line); padding: 30px 16px 42px; text-align: center; }
.footer-title { font-weight: 800; color: var(--ink); margin-bottom: 12px; font-size: 1rem; }
.socials { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.social-ic { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--sh-sm); transition: transform .15s; }
.social-ic:hover { transform: translateY(-3px); }
.social-ic svg { width: 22px; height: 22px; }
.footer-copy { margin-top: 20px; font-size: .78rem; color: var(--ink-soft); }

/* ---- WhatsApp float ---------------------------------------------------- */
.wa-float { position: fixed; bottom: 20px; inset-inline-end: 20px; width: 58px; height: 58px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(37, 211, 102, .5); z-index: 45; animation: wa-pulse 2.6s infinite; }
.wa-float svg { width: 32px; height: 32px; }
@keyframes wa-pulse { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .5); } 70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); } 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); } }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 560px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .drawer { width: 100%; }
    .brand-tagline { display: none; }
    .lang-switch { padding: 2px; }
    .lang-switch a { padding: 5px 6px; }
    .lang-switch a .code { display: none; }
    .acct-name { display: none; }
    .acct-btn { padding: 8px; }
    /* Builder: full-width, near-full-height centered sheet on phones */
    .builder { width: 100%; max-width: 100%; max-height: 94vh; }
}
@media (min-width: 561px) and (max-width: 820px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
