/* =========================
   F-City Cafe – Café Theme
   ========================= */

:root{
  /* Colors */
  --bg:#0f0f0f;            /* page background */
  --paper:#141414;         /* cards/background */
  --ink:#f5f5f5;           /* primary text */
  --muted:#bdbdbd;         /* secondary text */
  --stroke:#262626;        /* borders */
  --accent:#f4c27f;        /* latte foam */
  --accent-2:#c77752;      /* caramel */

  /* FX */
  --shadow:0 12px 30px rgba(0,0,0,.35);
  --radius:18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color:var(--ink);
  background:
    radial-gradient(80rem 40rem at 10% -20%, #1d1d1d 0%, transparent 60%),
    radial-gradient(80rem 40rem at 110% 0%, #1a120d 0%, transparent 55%),
    var(--bg);
  font-family:"Inter", system-ui, Segoe UI, Roboto, Arial;
}

/* ---------- Header / Brand / Social ---------- */
header{
  position:sticky; top:0; z-index:20;
  backdrop-filter:blur(10px);
  background:linear-gradient(180deg,rgba(20,20,20,.85),rgba(20,20,20,.65));
  border-bottom:1px solid var(--stroke);
  padding:10px 16px 8px;
  display:flex; align-items:center; gap:12px;
}
.brand{display:flex; align-items:center; gap:10px}
.logo{width:34px; height:34px; object-fit:contain; border-radius:8px; box-shadow:0 2px 6px rgba(0,0,0,.25)}
header h1{margin:0; font-size:18px; letter-spacing:.4px}
.badge{
  border:1px solid var(--stroke); background:#1a1a1a; color:var(--muted);
  padding:6px 10px; border-radius:999px; font-size:12px
}
.social{margin-left:auto; display:flex; align-items:center; gap:8px}
.pill{
  display:flex; align-items:center; gap:8px; padding:6px 10px; border-radius:999px;
  font-size:12px; border:1px solid #2a2a2a; background:#141414; color:var(--ink);
  text-decoration:none; transition:.2s background,.2s transform
}
.pill:hover{background:#1b1b1b; transform:translateY(-1px)}
.pill svg{width:16px; height:16px; fill:currentColor}
.pill.zalo{background:#0a68fe1a; border-color:#0a68fe33; color:#cfe0ff}
.pill.fb{background:#1877f21a; border-color:#1877f233; color:#d4e3ff}

/* ---------- Hero ---------- */
.hero{
  max-width:1100px; margin:18px auto 0; padding:0 16px 10px;
  display:grid; grid-template-columns:1.2fr .8fr; gap:18px; align-items:center;
}
.hero .copy h2{margin:8px 0 6px; font-size:28px; font-weight:800}
.hero .copy p{margin:0; color:#cfcfcf}
.hero .image{
  height:180px; border-radius:20px; overflow:hidden; border:1px solid var(--stroke);
  background:url('https://images.unsplash.com/photo-1504754524776-8f4f37790ca0?q=80&w=1600&auto=format&fit=crop') center/cover no-repeat;
  box-shadow:0 20px 50px rgba(0,0,0,.5);
}

/* ---------- Layout ---------- */
.wrap{max-width:1100px; margin:6px auto 24px; padding:0 16px}

/* ---------- Categories & Grid ---------- */
.category{margin:22px 0}
.cat-title{margin:0 0 8px; font-size:18px; letter-spacing:.6px; color:#ffe7c2}
.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:16px}

/* ---------- Product Card ---------- */
.card{
  border:1px solid var(--stroke);
  background:linear-gradient(180deg,#191716,#141414 65%);
  border-radius:var(--radius); overflow:hidden;
  display:flex; flex-direction:column;
  box-shadow:0 1px 0 rgba(255,255,255,.03) inset;
  transition:.25s transform,.25s box-shadow,.25s border-color
}
.card:hover{transform:translateY(-4px); border-color:#2e2e2e; box-shadow:var(--shadow)}
.card img{height:160px; width:100%; object-fit:cover; filter:saturate(1.05)}
.card .c{padding:12px; position:relative}
.card .c:after{content:""; position:absolute; inset:auto 12px 0 12px; height:1px;
  background:linear-gradient(90deg,transparent,#2b2b2b,transparent)}
.name{font-weight:700; letter-spacing:.2px}
.en{font-size:12px; color:var(--muted); margin:2px 0 8px}
.price{font-weight:800; color:var(--accent); margin-bottom:10px}

/* ---------- Buttons ---------- */
.btn{
  border:1px solid var(--stroke); background:#1a1a1a; color:var(--ink);
  border-radius:12px; padding:8px 12px; cursor:pointer;
  transition:.2s background,.2s transform
}
.btn:hover{background:#202020; transform:translateY(-1px)}
.btn.primary{
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  border-color:transparent; color:#1a120d; font-weight:700
}
.btn.primary:hover{filter:brightness(1.05)}

/* ---------- Cart (legacy card layout – kept for safety) ---------- */
.cart{
  position:fixed; right:16px; bottom:16px; width:340px; max-height:75vh;
  background:rgba(22,22,22,.92); border:1px solid var(--stroke);
  border-radius:22px; padding:14px; box-shadow:var(--shadow);
  backdrop-filter:blur(8px); overflow:auto;
}
.cart h3{margin:2px 0 10px; font-size:18px}
.cart h3::before{
  content:""; display:inline-block; width:18px; height:18px; margin-right:8px;
  background:conic-gradient(from 210deg at 50% 50%, var(--accent), var(--accent-2));
  border-radius:4px; vertical-align:-3px
}
.muted{color:var(--muted); font-size:13px}
.line{display:flex; justify-content:space-between; align-items:center; gap:8px; margin:8px 0}
.total{font-weight:900; border-top:1px dashed var(--stroke); padding-top:8px}

/* ---------- Inputs (global) ---------- */
.checkout{display:grid; gap:8px; margin-top:10px}
input{
  background:#0f0f0f; color:var(--ink); border:1px solid var(--stroke);
  padding:10px 12px; border-radius:12px; width:100%
}
input::placeholder{ color:#a7abb3; } /* ↑ clearer placeholders */
.consent{font-size:12px; color:var(--muted)}

/* ---------- Floating Contact Dock ---------- */
.contact-dock{
  position:fixed; right:16px; bottom:16px;
  display:flex; flex-direction:column; gap:10px; z-index:25
}
.fab{
  width:46px; height:46px; border-radius:50%; display:grid; place-items:center;
  background:#111; border:1px solid #2a2a2a; box-shadow:0 10px 24px rgba(0,0,0,.35);
  text-decoration:none; color:#fff; transition:.2s transform,.2s filter
}
.fab svg{width:22px; height:22px}
.fab.zalo{background:#0a68fe; border-color:transparent; font-weight:800}
.fab.fb{background:#1877f2; border-color:transparent}
.fab:hover{transform:translateY(-2px); filter:brightness(1.05)}

/* ---------- Footer ---------- */
footer{color:var(--muted); text-align:center; padding:24px 0 40px; border-top:1px solid var(--stroke); margin-top:24px}
footer a{color:var(--accent); text-decoration:none}
footer a:hover{text-decoration:underline}

/* ---------- Responsive ---------- */
@media (max-width:920px){
  .hero{grid-template-columns:1fr}
  .cart{position:static; width:auto; max-height:none; box-shadow:none; background:transparent; border:0}
  .contact-dock{right:12px; bottom:12px}
}
.lang{display:flex; gap:6px; margin-right:8px}
.lang .pill{opacity:.8}
.lang .pill.active{opacity:1; box-shadow:0 0 0 1px #fff inset}

/* ---------- Accordion ---------- */
.cat { margin: 28px 0; border-radius: 14px; background: rgba(255,255,255,0.04); }
.cat > summary {
  list-style: none; cursor: pointer; padding: 16px 18px; font-weight: 700;
  display: flex; align-items: center; gap: 10px; position: sticky; top: 64px; z-index: 2;
  background: linear-gradient(180deg, rgba(12,12,12,.9), rgba(12,12,12,.6));
  border-radius: 14px; backdrop-filter: blur(6px);
}
.cat > summary::marker { content: ""; }
.cat[open] > summary .chev { transform: rotate(90deg); }
.cat .grid { padding: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }

.tag { padding: 2px 8px; border-radius: 999px; font-size: 12px; background: rgba(255,255,255,.08); }
.subhead { padding: 0 18px 6px; font-weight: 600; color: #d7d7d7; display: flex; align-items: center; gap: 8px; }

.card .sizes { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.sizechip {
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06);
  padding: 6px 10px; border-radius: 10px; font-size: 12px; cursor: pointer;
}
.sizechip:hover { background: rgba(255,255,255,.12); }
.card .c .price { margin-top: 6px; }

/* ---------- CART as Drawer + FAB ---------- */
.fab{
  position:fixed; right:20px; bottom:24px;
  display:flex; align-items:center; gap:.5rem;
  padding:.9rem 1.1rem; border-radius:999px;
  background:linear-gradient(180deg,#ffcf8a,#e6a351);
  color:#111; font-weight:700; box-shadow:0 8px 24px rgba(0,0,0,.35);
  z-index:60; border:none; cursor:pointer;
}
.fab:active{ transform:translateY(1px); }

/* Backdrop for drawer */
.backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,.5);
  z-index:55; opacity:0; pointer-events:none; transition:.2s ease;
}
.backdrop.show{ opacity:1; pointer-events:auto; }

/* Drawer (slides from right) */
.cart{
  position:fixed; right:0; top:0; height:100vh; width:min(420px,100%);
  background:rgba(20,20,20,.92); backdrop-filter: blur(8px);
  border-left:1px solid rgba(255,255,255,.08);
  z-index:60; display:flex; flex-direction:column;
  transform:translateX(100%); transition:transform .25s ease;
}
.cart.show{ transform:translateX(0); }
.cart.hidden{ display:block; } /* allow transform offscreen while 'hidden' class toggles visual state */

.cart-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 16px; border-bottom:1px solid rgba(255,255,255,.08);
}
.cart-head .title{ display:flex; align-items:center; gap:.6rem; font-size:1.1rem; }
.icon-btn{
  background:transparent; border:none; color:#ddd; font-size:1rem;
  padding:.25rem .5rem; cursor:pointer; border-radius:.4rem;
}
.icon-btn:hover{ background:rgba(255,255,255,.06); }

.cart-body{ padding:14px 16px; overflow:auto; flex:1; }
.cart-body .line{ display:flex; align-items:center; justify-content:space-between; gap:.75rem; padding:10px 0; border-bottom:1px dashed rgba(255,255,255,.08); }
.cart-body .total{ font-weight:800; border-bottom:none; padding-top:14px; }
.cart-body .muted{ color:#aaa; }

/* -----------------------------
   >>> READABILITY UPGRADE <<<
   Make order (item) names clear
   ----------------------------- */
.cart-body .item-name,
#cartItems .name{
  font-weight:800;
  font-size:1.05rem;
  color:#f2f2f3;
  line-height:1.3;
  white-space:normal;           /* allow wrapping */
  word-break:break-word;        /* long names wrap */
}
#cartItems .sub{ color:#cfcfcf; font-size:12px; }

/* Numbers remain strong but secondary */
.cart-body .qty, .cart-body .price,
#cartItems .qty, #cartItems .price{ font-weight:600; }

/* Form at bottom of drawer */
.cart-form{
  padding:12px 16px 16px; display:grid; gap:.6rem;
  border-top:1px solid rgba(255,255,255,.08);
}
.cart-form input[type="text"],
.cart-form input[type="email"],
.cart-form input[type="tel"]{
  width:100%; padding:.8rem .9rem; border-radius:.7rem;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06); color:#f6f6f6;
}
.cart-form input::placeholder{ color:#a7abb3; }  /* clearer placeholder */
.cart-form .consent{ display:flex; align-items:center; gap:.6rem; font-size:.95rem; color:#cfcfcf; }
.w-full{ width:100%; }

/* Keep page scroll under control when drawer opens */
body.cart-open { overflow:hidden; }

/* Responsiveness: on ≥1200px nudge FAB */
@media (min-width: 1200px){
  .fab{ bottom:28px; right:26px; }
}

/* Avoid content under drawer on tiny screens */
@media (max-width: 480px){
  .page { padding-bottom:90px; }
}

/* --- Bottom Sheet variant (mobile-friendly) --- */
.sheet {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: none; z-index: 1000;
}
.sheet.open { display: block; }

.sheet .panel {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: min(460px, 100%); background: #0f0f0f; color: #ededed;
  display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(0,0,0,.35);
  border-left: 1px solid #222;
}

.sheet header {
  position: sticky; top: 0; z-index: 2;
  background: #0f0f0f; padding: 18px 20px;
  border-bottom: 1px solid #242424; display:flex; gap:12px; align-items:center;
}
.sheet header h3 { margin: 0; font-size: 22px; font-weight: 700; }
.sheet header .close { margin-left: auto; background: none; border: 0; color: #cfcfcf; font-size: 22px; cursor:pointer; }

.sheet .body {
  flex: 1; min-height: 0; /* enables proper flex scrolling */
  overflow: auto; padding: 14px 20px;
}

/* Order lines inside bottom sheet */
#cartItems { margin: 4px 0 10px; }
#cartItems .li {
  display:flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; padding: 12px 0; border-bottom: 1px dashed #2b2b2b;
}
#cartItems .name { font-weight:800; font-size:1.05rem; color:#f2f2f3; line-height:1.3; white-space:normal; word-break:break-word; }
#cartItems .sub  { color: #a8a8a8; font-size: 12px; margin-top: 4px; }
#cartItems .qty  { display:flex; gap:8px; align-items:center; }
#cartItems .qty .btn { width:28px; height:28px; padding:0; border-radius:8px; }

/* Sticky total row */
#cartTotalRow {
  position: sticky; bottom: 0; z-index: 1; background: #0f0f0f;
  padding: 12px 0; border-top: 1px solid #262626; display:flex; justify-content: space-between;
  font-weight: 700; font-size: 18px;
}

.sheet footer {
  position: sticky; bottom: 0; background: #0f0f0f; z-index: 2;
  padding: 12px 20px 18px; border-top: 1px solid #242424;
}

/* Inputs inside the sheet */
.sheet .body .input, .sheet .body input, .sheet .body .btn { width: 100%; margin-top: 10px; }

/* Mobile bottom sheet (slides up) */
@media (max-width: 640px) {
  .sheet .panel {
    left: 0; right: 0; width: 100%;
    top: auto; height: min(86vh, 700px); bottom: 0;
    border-radius: 16px 16px 0 0; border-left: 0;
  }
  .sheet { background: rgba(0,0,0,.65); }
}
