/* ==========================================================================
   AdNeed — Public Portfolio (Step 7)
   Default "Basic" theme. Businesses on Standard/Premium plans will get
   swappable palettes later (themeAccess/colorAccess/fontAccess on their
   plan doc) — this file defines the structure every theme shares, plus
   the one default palette, all through CSS custom properties.
   ========================================================================== */

:root{
  --p-bg:        #FAF7F1;
  --p-surface:   #FFFFFF;
  --p-ink:       #221E1A;
  --p-ink-muted: #756E63;
  --p-border:    #E9E2D6;
  --p-accent:    #2F5D50;   /* deep forest teal — primary interactive color */
  --p-accent-ink:#FFFFFF;
  --p-price:     #B0562E;   /* muted ochre-brick — price emphasis only */
  --p-cover-a:   #2F5D50;
  --p-cover-b:   #16342C;

  --p-display: 'Fraunces', serif;
  --p-body: 'Inter', sans-serif;
}

*{box-sizing:border-box;}
html{-webkit-text-size-adjust:100%;}
body{
  margin:0;
  background:var(--p-bg);
  color:var(--p-ink);
  font-family:var(--p-body);
  line-height:1.5;
}
img{max-width:100%; display:block;}
.hidden{display:none !important;}
a{color:inherit;}

/* ---------------------------------------------------------------- states */
.state-screen{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  padding:32px; text-align:center; background:var(--p-bg);
}
.state-box{max-width:360px;}
.state-logo{width:44px; height:44px; border-radius:12px; margin:0 auto 18px; object-fit:cover;}
.state-box h1{font-family:var(--p-display); font-size:22px; font-weight:600; margin:0 0 8px;}
.state-box p{color:var(--p-ink-muted); font-size:14px; margin:0 0 20px;}
.state-link{
  display:inline-block; font-size:13px; font-weight:600; color:var(--p-accent);
  border:1.5px solid var(--p-accent); border-radius:999px; padding:8px 18px; text-decoration:none;
}

/* ----------------------------------------------------------------- cover */
.p-cover{
  height:168px;
  background: linear-gradient(135deg, var(--p-cover-a), var(--p-cover-b));
  position:relative;
}
.p-cover-inner{
  max-width:640px; margin:0 auto; height:100%; position:relative;
}
.p-logo-badge{
  position:absolute; left:20px; bottom:-34px;
  width:76px; height:76px; border-radius:20px;
  background:var(--p-surface); border:4px solid var(--p-surface);
  box-shadow:0 6px 18px rgba(0,0,0,.14);
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
  font-family:var(--p-display); font-weight:600; font-size:26px; color:var(--p-accent);
}
.p-logo-badge img{width:100%; height:100%; object-fit:cover;}

/* ---------------------------------------------------------------- header */
.p-header{
  max-width:640px; margin:0 auto; padding:46px 20px 4px;
}
.p-header h1{
  font-family:var(--p-display); font-weight:600; font-size:26px; margin:0 0 4px;
  letter-spacing:-.01em;
}
.p-tagline{color:var(--p-ink-muted); font-size:14.5px; margin:0 0 10px;}
.p-description{font-size:14px; color:var(--p-ink); margin:0 0 14px; max-width:60ch;}

.p-contact-row{display:flex; flex-wrap:wrap; gap:8px; margin-bottom:6px;}
.p-contact-pill{
  display:inline-flex; align-items:center; gap:6px;
  font-size:12.5px; font-weight:600; text-decoration:none;
  padding:8px 14px; border-radius:999px; border:1.5px solid var(--p-border);
  color:var(--p-ink);
}
.p-contact-pill.whatsapp{
  background:#25D366; border-color:#25D366; color:#fff;
}
.p-contact-pill svg{width:14px; height:14px; flex:none;}

/* ------------------------------------------------------------ search bar */
.p-search-bar{max-width:640px; margin:14px auto 0; padding:0 20px;}
.p-search-bar input{
  width:100%; padding:12px 16px; border-radius:14px; border:1.5px solid var(--p-border);
  background:var(--p-surface); font-family:var(--p-body); font-size:14.5px; color:var(--p-ink);
}
.p-search-bar input:focus{outline:none; border-color:var(--p-accent);}

/* ---------------------------------------------------------------- chips */
.p-chips{
  max-width:640px; margin:0 auto; padding:12px 20px 0;
  display:flex; gap:8px; overflow-x:auto; scrollbar-width:none;
}
.p-chips::-webkit-scrollbar{display:none;}
.p-chip{
  flex:none; padding:8px 16px; border-radius:999px; border:1.5px solid var(--p-border);
  background:var(--p-surface); font-size:13px; font-weight:600; color:var(--p-ink-muted);
  cursor:pointer; white-space:nowrap;
}
.p-chip.active{background:var(--p-accent); border-color:var(--p-accent); color:var(--p-accent-ink);}

/* ----------------------------------------------------------------- grid */
.p-grid{
  max-width:640px; margin:0 auto; padding:18px 20px 8px;
  display:grid; grid-template-columns:1fr 1fr; gap:14px;
}
@media (min-width:520px){ .p-grid{grid-template-columns:1fr 1fr 1fr;} }

.p-card{
  background:var(--p-surface); border:1px solid var(--p-border); border-radius:16px;
  overflow:hidden; cursor:pointer;
}
.p-card-thumb{
  aspect-ratio:1/1; background:var(--p-bg);
  display:flex; align-items:center; justify-content:center;
  color:var(--p-ink-muted); font-size:12px; overflow:hidden;
}
.p-card-thumb img{width:100%; height:100%; object-fit:cover;}
.p-card-body{padding:10px 12px 12px;}
.p-card-cat{
  font-size:10.5px; font-weight:600; color:var(--p-ink-muted);
  text-transform:uppercase; letter-spacing:.04em; display:block; margin-bottom:3px;
}
.p-card-name{font-size:14px; font-weight:600; margin:0 0 4px; line-height:1.3;}
.p-card-price{font-family:var(--p-display); font-weight:600; font-size:15px; color:var(--p-price);}

.p-empty{max-width:640px; margin:0 auto; padding:40px 20px; text-align:center; color:var(--p-ink-muted); font-size:14px;}

/* --------------------------------------------------------------- footer */
.p-footer{padding:28px 20px 40px; text-align:center;}
.p-badge{
  display:inline-block; font-size:12px; color:var(--p-ink-muted); text-decoration:none;
}
.p-badge strong{color:var(--p-accent);}

/* ---------------------------------------------------------------- modal */
.p-modal-overlay{
  position:fixed; inset:0; background:rgba(20,17,13,.55); z-index:100;
  display:flex; align-items:flex-end; justify-content:center;
}
@media (min-width:640px){ .p-modal-overlay{align-items:center;} }

.p-modal{
  background:var(--p-surface); width:100%; max-width:520px; max-height:92vh;
  border-radius:20px 20px 0 0; overflow-y:auto; position:relative;
}
@media (min-width:640px){ .p-modal{border-radius:20px;} }

.p-modal-close{
  position:absolute; top:12px; right:12px; z-index:2;
  width:32px; height:32px; border-radius:50%; border:none;
  background:rgba(255,255,255,.9); font-size:20px; line-height:1; cursor:pointer; color:var(--p-ink);
}
.p-modal-imagewrap{background:var(--p-bg);}
.p-modal-imagewrap img{width:100%; aspect-ratio:1/1; object-fit:cover;}
.p-modal-thumbs{display:flex; gap:6px; padding:8px; overflow-x:auto;}
.p-modal-thumbs img{
  width:52px; height:52px; object-fit:cover; border-radius:8px; cursor:pointer;
  border:2px solid transparent; flex:none;
}
.p-modal-thumbs img.active{border-color:var(--p-accent);}
.p-modal-body{padding:18px 20px 24px;}
.p-modal-category{font-size:11px; font-weight:600; color:var(--p-ink-muted); text-transform:uppercase; letter-spacing:.04em;}
.p-modal-body h2{font-family:var(--p-display); font-size:20px; font-weight:600; margin:4px 0 6px;}
.p-modal-price{font-family:var(--p-display); font-size:19px; font-weight:600; color:var(--p-price); margin-bottom:12px;}
.p-modal-desc{font-size:14px; color:var(--p-ink); white-space:pre-wrap; margin:0 0 14px;}
.p-modal-tags{display:flex; flex-wrap:wrap; gap:6px; margin-bottom:16px;}
.p-modal-tags span{
  font-size:11.5px; background:var(--p-bg); border:1px solid var(--p-border); color:var(--p-ink-muted);
  padding:4px 10px; border-radius:999px;
}
.p-modal-whatsapp{
  display:flex; align-items:center; justify-content:center; gap:8px;
  background:#25D366; color:#fff; text-decoration:none; font-weight:600; font-size:14.5px;
  padding:13px; border-radius:12px;
}

/* ------------------------------------------------------- quick-add (card) */
.p-card-thumb{position:relative;}
.p-card-quickadd{
  position:absolute; right:8px; bottom:8px; z-index:2;
  width:30px; height:30px; border-radius:50%; border:none;
  background:var(--p-accent); color:var(--p-accent-ink);
  font-size:18px; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 2px 8px rgba(0,0,0,.18);
}

/* ------------------------------------------------------ modal qty + list */
.p-modal-qty-row{display:flex; align-items:center; gap:12px; margin-bottom:12px;}
.p-qty-stepper{
  display:flex; align-items:center; gap:2px;
  border:1.5px solid var(--p-border); border-radius:12px; overflow:hidden;
}
.p-qty-stepper button{
  width:36px; height:38px; border:none; background:var(--p-surface); color:var(--p-ink);
  font-size:16px; cursor:pointer;
}
.p-qty-stepper span{min-width:28px; text-align:center; font-weight:600; font-size:14px;}
.p-add-to-list-btn{
  flex:1; height:38px; border:none; border-radius:12px; cursor:pointer;
  background:var(--p-accent); color:var(--p-accent-ink); font-weight:600; font-size:14.5px;
}
.p-add-to-list-btn.added{background:#1f4a3f;}
.p-modal-whatsapp-link{
  display:block; text-align:center; font-size:13px; font-weight:600;
  color:var(--p-accent); text-decoration:none; margin-top:2px;
}

/* --------------------------------------------------------------- cart fab */
.cart-fab{
  position:fixed; right:18px; bottom:18px; z-index:90;
  width:56px; height:56px; border-radius:50%; border:none;
  background:var(--p-accent); color:var(--p-accent-ink); cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 8px 22px rgba(0,0,0,.24);
}
.cart-fab-badge{
  position:absolute; top:-4px; right:-4px;
  min-width:20px; height:20px; padding:0 5px; border-radius:999px;
  background:var(--p-price); color:#fff; font-size:11px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
}

/* ------------------------------------------------------------ cart drawer */
.cart-drawer{max-width:480px;}
.cart-drawer-header{padding:20px 20px 4px;}
.cart-drawer-header h2{font-family:var(--p-display); font-size:19px; font-weight:600; margin:0 0 4px;}
.cart-drawer-sub{font-size:13px; color:var(--p-ink-muted); margin:0;}

.cart-items{padding:8px 20px; display:flex; flex-direction:column; gap:12px;}
.cart-item{display:grid; grid-template-columns:52px 1fr auto; gap:10px; align-items:center;}
.cart-item-thumb{
  width:52px; height:52px; border-radius:10px; overflow:hidden; background:var(--p-bg);
  display:flex; align-items:center; justify-content:center; font-size:10px; color:var(--p-ink-muted);
}
.cart-item-thumb img{width:100%; height:100%; object-fit:cover;}
.cart-item-info{min-width:0;}
.cart-item-name{font-size:13.5px; font-weight:600; margin-bottom:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.cart-item-price{font-size:12.5px; color:var(--p-ink-muted);}
.cart-item-stepper{
  display:flex; align-items:center; gap:6px; grid-column:2; justify-self:start;
}
.cart-item-stepper button{
  width:26px; height:26px; border-radius:8px; border:1.5px solid var(--p-border);
  background:var(--p-surface); font-size:14px; cursor:pointer; line-height:1;
}
.cart-item-stepper span{min-width:18px; text-align:center; font-size:13px; font-weight:600;}
.cart-item-remove{
  grid-row:1 / span 2; grid-column:3; align-self:center;
  background:none; border:none; color:var(--p-ink-muted); font-size:11.5px;
  text-decoration:underline; cursor:pointer; padding:0;
}
.cart-item{grid-template-rows:auto auto;}

.cart-empty{padding:24px 20px 8px; text-align:center; color:var(--p-ink-muted); font-size:13.5px;}

.cart-drawer-footer{padding:14px 20px 22px; border-top:1px solid var(--p-border); margin-top:10px;}
.cart-subtotal{
  display:flex; align-items:baseline; justify-content:space-between;
  font-family:var(--p-display); font-weight:600; font-size:16px; margin-bottom:12px;
}
.cart-subtotal small{display:block; font-family:var(--p-body); font-weight:400; font-size:11px; color:var(--p-ink-muted); text-align:right;}
.cart-no-whatsapp{font-size:12.5px; color:var(--p-ink-muted); text-align:center; margin:0 0 10px;}
.cart-clear-btn{
  display:block; width:100%; margin-top:10px; padding:10px; background:none;
  border:none; color:var(--p-ink-muted); font-size:12.5px; text-decoration:underline; cursor:pointer;
}
