@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Sinhala:wght@400;500;600;700;800&family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,600&display=swap');

/* ==========================================================================
   ළඟටම.lk — design tokens
   Palette drawn from a Kegalle-district market basket: tea-estate green,
   turmeric gold and sun-dried clay red, on a warm rice-paper background.
   Deliberately not the generic orange/blue franchise look, and not the
   generic cream+terracotta AI default either — greener, earthier, deeper.
   ========================================================================== */
:root{
  /* brand tokens (kept the same variable names used across the PHP pages,
     just repointed to the new palette, so every inline style() everywhere
     re-themes automatically) */
  --brand-orange: #b8562b;        /* clay red — primary buy/confirm actions   */
  --brand-orange-dark: #93401e;
  --brand-blue: #1f5c4a;          /* estate green — secondary actions, links  */
  --brand-blue-dark: #163f33;

  --accent-gold: #cf9a34;         /* turmeric — prices, highlights, badges    */
  --accent-gold-dark: #a97b23;

  --bg-soft: #f6f1e6;             /* warm rice-paper background               */
  --surface: #ffffff;
  --ink: #29281f;                 /* warm near-black text                     */
  --ink-muted: #6f6a58;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 2px 10px rgba(41,40,31,.08);
  --shadow-md: 0 10px 26px rgba(41,40,31,.12);

  --font-display: 'Fraunces', 'Noto Sans Sinhala', 'Segoe UI', serif;
  --font-body: 'Noto Sans Sinhala', 'Segoe UI', Arial, sans-serif;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

[id^="cat-"]{ scroll-margin-top: 140px; }

body{
  font-family: var(--font-body);
  background: var(--bg-soft);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(31,92,74,.05), transparent 40%),
    radial-gradient(circle at 88% 30%, rgba(207,154,52,.06), transparent 45%);
  color: var(--ink);
}

a{ text-decoration: none; }

h1,h2,h3,h4,h5,.category-title,.p-price,.hero-text h2{
  font-family: var(--font-display);
}

/* ============ HEADER ============ */
.top-header{
  background: var(--surface);
  box-shadow: 0 2px 14px rgba(22,63,51,.07);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 3px solid var(--brand-blue);
}

.logo-img{ height: 46px; width: auto; max-width: 100%; object-fit: contain; display:block; }

/* white badge so the logo reads well on dark backgrounds (footer / admin sidebar) */
.logo-badge{ display:inline-block; background:#fff; border-radius:16px; padding:8px 14px; box-shadow:0 2px 10px rgba(0,0,0,.18); }
.logo-badge img{ display:block; width:auto; }
.admin-sidebar .logo-badge{ padding:6px 12px; }

.search-wrap{ flex: 1; max-width: 620px; }

.search-wrap .form-control{
  border: 2px solid var(--brand-blue);
  border-right: none;
  border-radius: 30px 0 0 30px;
  padding: .55rem 1.1rem;
  background: #fbfaf6;
}
.search-wrap .form-control:focus{
  box-shadow: none;
  border-color: var(--brand-blue-dark);
  background: #fff;
}
.search-wrap .btn-search{
  border-radius: 0 30px 30px 0;
  background: var(--brand-blue);
  color: #fff;
  border: 2px solid var(--brand-blue);
  padding: .55rem 1.4rem;
  font-weight: 600;
}
.search-wrap .btn-search:hover{ background: var(--brand-blue-dark); }

.search-suggestions{
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 0 0 12px 12px;
  box-shadow: var(--shadow-md);
  z-index: 1200;
  max-height: 340px;
  overflow-y: auto;
  display: none;
}
.search-suggestions .sugg-item{
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .8rem;
  cursor: pointer;
  border-bottom: 1px solid #f4f4f4;
}
.search-suggestions .sugg-item:hover{ background: #fbf3e4; }
.search-suggestions img{ width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }

.cart-btn{
  position: relative;
  color: var(--brand-blue-dark);
  font-size: 1.6rem;
}
.cart-badge{
  position: absolute;
  top: -6px;
  right: -10px;
  background: var(--accent-gold);
  color: #2b2100;
  font-size: .65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 50px;
}

/* second nav row */
.nav-row{
  background: var(--brand-blue-dark);
}
.nav-row .nav-link{
  color: #f1ece0 !important;
  font-weight: 600;
  padding: .7rem 1rem !important;
  transition: color .15s ease;
}
.nav-row .nav-link:hover{ color: var(--accent-gold) !important; }
.nav-row .dropdown-menu{
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: .5rem;
}
.nav-row .dropdown-item{
  border-radius: 8px;
  padding: .55rem .8rem;
  font-weight: 500;
}
.nav-row .dropdown-item:hover{ background: #fbf3e4; color: var(--brand-orange-dark); }

.inquiry-menu .dropdown-menu{ min-width: 260px; }
.inquiry-phone{
  display:flex; align-items:center; gap:.6rem;
  padding:.5rem .3rem; font-weight:600; color: var(--brand-blue-dark);
}

/* ============ CAROUSEL ============ */
.hero-carousel{
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 1.2rem;
  box-shadow: var(--shadow-md);
}
.hero-carousel .carousel-item{
  height: 380px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.hero-slide{
  height: 100%; width: 100%;
  background-size: cover;
  background-position: center;
  display: flex; align-items: flex-end;
}
.hero-slide::before{
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(22,26,20,.78) 0%, rgba(22,26,20,.34) 45%, rgba(22,26,20,.05) 75%);
}
.hero-text{
  position: relative;
  z-index: 2;
  color: #fff;
  padding: 2.4rem 3rem;
  max-width: 640px;
}
.hero-text .hero-eyebrow{
  color: var(--accent-gold);
  font-weight: 700;
  letter-spacing: .02em;
  font-size: .95rem;
  margin-bottom: .3rem;
}
.hero-text h2{
  font-weight: 700;
  font-size: 2.3rem;
  line-height: 1.2;
  margin-bottom: .5rem;
}
.hero-text p{ font-size: 1.05rem; opacity: .92; margin-bottom: 1rem; }
.hero-text .btn-hero{
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--accent-gold);
  color: #2b2100;
  font-weight: 700;
  padding: .55rem 1.3rem;
  border-radius: 50px;
  border: none;
}
.hero-text .btn-hero:hover{ background: #e0ae4b; color: #2b2100; }

.hero-carousel .carousel-indicators [data-bs-target]{
  background-color: rgba(255,255,255,.55);
  width: 9px; height: 9px; border-radius: 50%;
}
.hero-carousel .carousel-indicators .active{ background-color: var(--accent-gold); }
.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next{ width: 6%; }

/* ============ CATEGORY SECTIONS ============ */
.category-title{
  display:flex; align-items:center; gap:.6rem;
  font-weight: 700;
  color: var(--brand-blue-dark);
  margin: 2.2rem 0 1rem;
  border-left: 5px solid var(--accent-gold);
  padding-left: .8rem;
}
.category-title i{ font-size: 1.3rem; color: var(--brand-orange); }

/* ============ PRODUCT CARD ============ */
.product-card{
  background: var(--surface);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(31,92,74,.06);
  transition: transform .15s ease, box-shadow .15s ease;
  height: 100%;
}
.product-card:hover{ transform: translateY(-4px); box-shadow: var(--shadow-md); }
.product-card img{
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: contain;      /* whole product visible – never cropped */
  background:#fff;
  padding: 6px;
  display:block;
  border-bottom: 1px solid #f1ece0;
}
.product-card .p-body{ padding: 1rem 1.1rem 1.2rem; }
.product-card .p-name{ font-weight: 600; font-size: 1.05rem; min-height: 2.6em; }
.product-card .p-price{ color: var(--accent-gold-dark); font-weight: 700; font-size: 1.35rem; }

.qty-stepper{
  display:flex; align-items:center; border: 1px solid #e4ddc9; border-radius: 8px; overflow:hidden; width: fit-content;
}
.qty-stepper button{
  background:#f5f1e6; border:none; width: 36px; height: 36px; font-weight:700; font-size: 1.1rem; color: var(--brand-blue-dark);
}
.qty-stepper input{
  width: 46px; text-align:center; border:none; border-left:1px solid #e4ddc9; border-right:1px solid #e4ddc9; height:36px; font-size: 1rem;
}
.btn-add-cart{
  background: var(--brand-blue);
  color:#fff; font-weight:600; border:none; border-radius: 8px;
  padding: .55rem .8rem; width:100%; font-size: .95rem;
  transition: background .15s ease;
}
.btn-add-cart:hover{ background: var(--brand-blue-dark); color:#fff; }

/* ============ FOOTER ============ */
.site-footer{
  background: #162019;
  color: #cfd0c6;
  margin-top: 3rem;
  padding: 2.8rem 0 1rem;
}
.site-footer h5{ color:#fff; font-weight:700; margin-bottom:1rem; font-family: var(--font-display); }
.site-footer a{ color:#b7b8ac; }
.site-footer a:hover{ color: var(--accent-gold); }
.social-icons a{
  display:inline-flex; align-items:center; justify-content:center;
  width:38px; height:38px; border-radius:50%;
  background:#233026; margin-right:.5rem; font-size:1.1rem; color:#fff;
}
.social-icons a:hover{ background: var(--brand-orange); }
.footer-bottom{ border-top: 1px solid #2c372f; margin-top: 1.5rem; padding-top: 1rem; font-size:.85rem; text-align:center; color:#8d9086; }

/* ============ CART PAGE ============ */
.cart-table img{ width:60px; height:60px; object-fit:contain; background:#fff; border:1px solid #eee6d3; border-radius:8px; flex-shrink:0; }
.cart-summary{
  background: var(--surface); border-radius: var(--radius); padding:1.2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(31,92,74,.06);
}

/* ============ CHECKOUT ============ */
.checkout-card{
  background: var(--surface); border-radius: var(--radius); padding:1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(31,92,74,.06);
}
.pay-option{
  border: 2px solid #eee6d3; border-radius: 10px; padding: .8rem 1rem; cursor:pointer; margin-bottom:.6rem;
  transition: border-color .15s ease, background .15s ease;
}
.pay-option.active{ border-color: var(--brand-blue); background:#eef6f2; }

.zone-note{
  background: #eef6f2;
  border: 1px dashed var(--brand-blue);
  border-radius: var(--radius-sm);
  padding: .7rem .9rem;
  font-size: .85rem;
  color: var(--brand-blue-dark);
  margin-top: .4rem;
}
.zone-note.is-outside{
  background: #fbf1ea;
  border-color: var(--brand-orange);
  color: var(--brand-orange-dark);
}

.bank-details-box{
  background: #fbf6e9;
  border: 1px solid #ecdfb3;
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  margin-top: .6rem;
}
.bank-details-box dl{ display:grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin-bottom:0; }
.bank-details-box dt{ color: var(--ink-muted); font-weight:600; }
.bank-details-box dd{ margin:0; font-weight:600; }

.wa-note-box{
  display:flex; align-items:flex-start; gap:.7rem;
  border: 1px solid #b7e2c4; background:#eaf7ee; color:#1c5a33;
  border-radius: var(--radius-sm); padding: .9rem 1rem; margin-top:.6rem;
}
.wa-note-box i{ font-size:1.6rem; color:#25d366; line-height:1; }
.wa-payment-box{
  background:#fbf6e9; border:1px solid #ecdfb3; border-radius: var(--radius-sm); padding:1rem 1.1rem;
}
.wa-payment-box dl{ display:grid; grid-template-columns:auto 1fr; gap:.3rem 1rem; }
.wa-payment-box dt{ color: var(--ink-muted); font-weight:600; }
.wa-payment-box dd{ margin:0; font-weight:600; }

/* ============ ADMIN ============ */
.admin-sidebar{
  background: linear-gradient(180deg, #16281f, #101d17);
  min-height:100vh; color:#fff; padding-top:1rem;
}
.admin-sidebar a{
  display:block; color:#cfd8d2; padding:.7rem 1.2rem; border-radius:8px; margin:.2rem .7rem; font-weight:500;
}
.admin-sidebar a.active, .admin-sidebar a:hover{ background: var(--brand-orange); color:#fff; }
.admin-topbar{ background:#fff; padding:1rem 1.5rem; box-shadow:0 2px 8px rgba(0,0,0,.06); }
.stat-card{ background:#fff; border-radius: var(--radius); padding:1.2rem; box-shadow: var(--shadow-sm); }

@media (max-width: 768px){
  .hero-text{ padding: 1.2rem 1.4rem; max-width: 100%; }
  .hero-text h2{ font-size: 1.4rem; }
  .hero-carousel .carousel-item{ height: 260px; }
  .logo-img{ height: 40px; }
  [id^="cat-"]{ scroll-margin-top: 112px; }
}

/* Product card links -> single product view */
.product-link{ display:block; color:inherit; text-decoration:none; }
.product-link:hover{ color:inherit; }
.product-link:hover .p-name{ color: var(--brand-orange, #f26522); }
.product-card > .product-link{ cursor:pointer; }


/* ==========================================================================
   CART PAGE – mobile layout (no horizontal scrolling, delete button visible)
   ========================================================================== */
.cart-table .cart-prod{ display:flex; align-items:center; gap:.6rem; }
.cart-table .cart-prod span{ word-break: break-word; }

@media (max-width: 767.98px){
  .cart-table{ padding: .5rem !important; overflow-x: visible; }
  .cart-table .table{ margin-bottom:0; }
  .cart-table thead{ display:none; }
  .cart-table tbody, .cart-table tr, .cart-table td{ display:block; width:100%; }

  .cart-table tr.cart-row{
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "prod  del"
      "meta  meta";
    gap: .5rem .5rem;
    padding: .8rem .4rem;
    border-bottom: 1px solid #eee6d3;
  }
  .cart-table tr.cart-row:last-child{ border-bottom:none; }
  .cart-table td{ border:none !important; padding:0 !important; }

  .cart-table td.c-prod{ grid-area: prod; min-width:0; }
  .cart-table td.c-del { grid-area: del; align-self:start; width:auto; }
  .cart-table td.c-del .btn{ width:40px; height:40px; display:flex; align-items:center; justify-content:center; }

  .cart-table td.c-price, .cart-table td.c-qty, .cart-table td.c-total{ display:none; }
  .cart-table .cart-meta{
    grid-area: meta;
    display:flex; align-items:center; justify-content:space-between; gap:.6rem; flex-wrap:wrap;
  }
}
@media (min-width: 768px){
  .cart-table .cart-meta{ display:none; }
}

/* ==========================================================================
   HOME POPUP – delivery days notice
   ========================================================================== */
.notice-modal .modal-content{
  border: none; border-radius: 24px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(22,63,51,.35);
  animation: noticePop .45s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes noticePop{ from{ opacity:0; transform: translateY(24px) scale(.94);} to{ opacity:1; transform:none; } }
.notice-modal .notice-top{
  position: relative;
  background: linear-gradient(135deg, var(--brand-blue-dark) 0%, var(--brand-blue) 60%, #2f8a6c 100%);
  color:#fff; text-align:center; padding: 2rem 1.5rem 3.2rem;
}
.notice-modal .notice-top::after{
  content:""; position:absolute; left:0; right:0; bottom:-1px; height: 34px;
  background:#fff; border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.notice-modal .notice-icon{
  width: 78px; height: 78px; margin: 0 auto .8rem; border-radius: 50%;
  background: rgba(255,255,255,.16); border: 2px solid rgba(255,255,255,.35);
  display:flex; align-items:center; justify-content:center; font-size: 2.2rem; color: var(--accent-gold);
  animation: truckBob 2.2s ease-in-out infinite;
}
@keyframes truckBob{ 0%,100%{ transform: translateX(-4px);} 50%{ transform: translateX(5px);} }
.notice-modal .notice-top h5{ font-weight:700; margin:0; font-size:1.25rem; letter-spacing:.01em; }
.notice-modal .notice-body{ text-align:center; padding: .4rem 1.6rem 1.6rem; }
.notice-modal .notice-msg{ font-size:1.12rem; font-weight:600; line-height:1.75; color: var(--ink); margin-bottom:1rem; }
.notice-modal .day-chips{ display:flex; gap:.6rem; justify-content:center; margin-bottom:1.2rem; flex-wrap:wrap; }
.notice-modal .day-chip{
  display:inline-flex; align-items:center; gap:.4rem;
  background:#fbf3e4; border:1.5px solid var(--accent-gold); color: var(--accent-gold-dark);
  font-weight:700; padding:.4rem 1rem; border-radius:50px;
}
.notice-modal .btn-notice{
  background: var(--brand-orange); color:#fff; font-weight:700; border:none;
  padding:.65rem 2.2rem; border-radius:50px; transition: background .15s ease, transform .15s ease;
}
.notice-modal .btn-notice:hover{ background: var(--brand-orange-dark); color:#fff; transform: translateY(-1px); }


/* ============ HEADER LAYOUT: logo | search | cart ============ */
.header-main{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  padding-top: .5rem;
  padding-bottom: .5rem;
}
/* Mobile: logo (left) + cart (right) on the first line, search full width below */
.header-logo{ order: 1; }
.header-cart{ order: 2; margin-left: auto; }
.header-search{ order: 3; flex: 0 0 100%; max-width: 100%; }

/* Desktop / tablet: everything on ONE line */
@media (min-width: 768px){
  .header-search{ order: 2; flex: 1 1 auto; max-width: 720px; margin: 0 auto; }
  .header-cart{ order: 3; margin-left: 0; }
}


/* ============ ADMIN SIDEBAR: keep every menu item on one line & aligned ============ */
.admin-sidebar{ flex-shrink: 0; }
.admin-sidebar a{
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.admin-sidebar a > i{
  display: inline-block;
  width: 1.5rem;
  flex: 0 0 1.5rem;
  text-align: center;
  margin-right: .6rem !important;
}

/* ---------- Market price (struck-through) ---------- */
.price-block{ min-height: 3.4rem; }
.price-block .p-price{ line-height: 1.2; }
.p-market, .market-price{
  color: #9a9a9a; text-decoration: line-through; font-weight: 400;
  font-size: .95rem; line-height: 1.3;
}
.price-block.lg{ min-height: 0; }
.price-block.lg .p-price{ font-size: 2rem; }
.price-block.lg .p-market{ font-size: 1.15rem; }
.price-block.sm{ min-height: 0; }
.price-block.sm .p-price{ font-size: 1rem; }
.price-block.sm .p-market{ font-size: .8rem; }
.save-note{ color:#1f7a4d; font-weight:600; font-size:.9rem; }
