/* ============================================================
   Template F — "Express Delivery"
   Dark premium theme, amber/blue accents, Poppins+Nunito.
   CSS prefix: ed-  |  Session key: ed_cart
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ed-amber: #f59e0b;
  --ed-amber-light: #fbbf24;
  --ed-amber-dark: #d97706;
  --ed-blue: #1d4ed8;
  --ed-blue-light: #3b82f6;
  --ed-green: #10b981;
  --ed-green-light: #34d399;
  --ed-red: #ef4444;
  --ed-bg: #0f172a;
  --ed-bg-card: #1e293b;
  --ed-bg-elevated: #334155;
  --ed-text: #f1f5f9;
  --ed-text-light: #94a3b8;
  --ed-text-muted: #64748b;
  --ed-border: #334155;
  --ed-shadow: 0 2px 12px rgba(0,0,0,.3);
  --ed-shadow-hover: 0 6px 20px rgba(0,0,0,.45);
  --ed-radius: 14px;
  --ed-radius-sm: 10px;
  --ed-font: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --ed-font-display: 'Nunito', 'Poppins', sans-serif;
  --ed-transition: .25s ease;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--ed-font);
  background: var(--ed-bg);
  color: var(--ed-text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* --- HEADER (3-column grid) --- */
.ed-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--ed-bg-card);
  border-bottom: 1px solid var(--ed-border);
  backdrop-filter: blur(12px);
}

.ed-header__status {
  background: var(--ed-green);
  color: #fff;
  padding: 3px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .8px;
  text-transform: uppercase;
  white-space: nowrap;
}

.ed-header__status.closed {
  background: var(--ed-red);
}

.ed-header__brand {
  text-align: center;
}

.ed-header__logo {
  font-family: var(--ed-font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ed-amber);
  letter-spacing: .5px;
  line-height: 1;
}

.ed-header__cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--ed-text);
  padding: 6px;
}

.ed-header__cart-count {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--ed-amber);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ed-header__cart-count:empty,
.ed-header__cart-count[data-count="0"] { display: none; }

/* --- HERO --- */
.ed-hero {
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  padding: 28px 20px 24px;
  border-bottom: 1px solid var(--ed-border);
}

.ed-hero__content { max-width: 600px; }

.ed-hero__title {
  font-family: var(--ed-font-display);
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  font-weight: 800;
  color: var(--ed-amber);
  line-height: 1.15;
  margin-bottom: 4px;
}

.ed-hero__subtitle {
  font-size: 14px;
  color: var(--ed-text-light);
  margin-bottom: 14px;
}

.ed-hero__info {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.ed-hero__info-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.2);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ed-amber-light);
}

/* --- PROMO STRIP (replaces marquee) --- */
.ed-promo {
  background: linear-gradient(90deg, var(--ed-blue) 0%, var(--ed-amber-dark) 100%);
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  padding: 7px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .8px;
}

.ed-promo__track {
  display: inline-flex;
  animation: ed-slide 25s linear infinite;
}

.ed-promo__track span { padding-right: 48px; }

@keyframes ed-slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- CATEGORY GRID --- */
.ed-categories {
  padding: 16px 16px 8px;
}

.ed-categories__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.ed-cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: var(--ed-radius-sm);
  font-size: 10px;
  font-weight: 500;
  color: var(--ed-text-muted);
  background: var(--ed-bg-card);
  border: 1px solid transparent;
  transition: var(--ed-transition);
  text-align: center;
  line-height: 1.2;
}

.ed-cat-btn:hover {
  background: var(--ed-bg-elevated);
  color: var(--ed-text-light);
}

.ed-cat-btn[aria-selected="true"] {
  background: rgba(245,158,11,.12);
  border-color: var(--ed-amber);
  color: var(--ed-amber);
}

.ed-cat-btn__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--ed-bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--ed-transition);
}

.ed-cat-btn[aria-selected="true"] .ed-cat-btn__icon {
  background: rgba(245,158,11,.18);
}

/* --- STICKY CATEGORY BAR (shows on scroll, below header) --- */
.ed-catbar {
  position: sticky;
  top: 47px;
  z-index: 90;
  background: var(--ed-bg);
  border-bottom: 1px solid var(--ed-border);
  padding: 8px 0;
  display: none;
}

.ed-catbar.show { display: block; }

.ed-catbar__scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ed-catbar__scroll::-webkit-scrollbar { display: none; }

.ed-catbar__pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ed-text-muted);
  background: var(--ed-bg-card);
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--ed-transition);
}

.ed-catbar__pill:hover { color: var(--ed-text-light); }

.ed-catbar__pill[aria-selected="true"] {
  background: var(--ed-amber);
  color: #000;
}

/* --- SEARCH --- */
.ed-search {
  padding: 12px 16px;
  max-width: 640px;
  margin: 0 auto;
}

.ed-search__box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ed-bg-card);
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius-sm);
  padding: 10px 16px;
  transition: var(--ed-transition);
}

.ed-search__box:focus-within {
  border-color: var(--ed-amber);
  box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}

.ed-search__box svg { color: var(--ed-text-muted); flex-shrink: 0; }

.ed-search__box input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 14px;
  font-family: var(--ed-font);
  background: transparent;
  color: var(--ed-text);
}

.ed-search__box input::placeholder { color: var(--ed-text-muted); }

/* --- MENU SECTIONS --- */
.ed-menu { padding-bottom: 80px; min-height: 2000px; contain: layout style; }

.ed-section { padding: 20px 0 8px; }

.ed-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 12px;
}

.ed-section__title {
  font-family: var(--ed-font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--ed-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ed-section__title::before {
  content: '';
  width: 3px;
  height: 18px;
  background: var(--ed-amber);
  border-radius: 2px;
}

.ed-section__more {
  color: var(--ed-amber);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--ed-transition);
}

.ed-section__more:hover { opacity: .7; }

/* Carousel */
.ed-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ed-carousel::-webkit-scrollbar { display: none; }

/* --- PRODUCT CARD --- */
.ed-card {
  flex: 0 0 160px;
  background: var(--ed-bg-card);
  border-radius: var(--ed-radius);
  box-shadow: var(--ed-shadow);
  overflow: hidden;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--ed-transition), transform var(--ed-transition);
  position: relative;
  border: 1px solid var(--ed-border);
}

.ed-card:hover {
  box-shadow: var(--ed-shadow-hover);
  transform: translateY(-2px);
}

.ed-card__tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--ed-blue);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
  z-index: 2;
}

.ed-card__tag--promo { background: var(--ed-red); }

.ed-card__discount {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--ed-green);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 2;
}

.ed-card__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--ed-bg-elevated);
}

.ed-card__body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.ed-card__name {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ed-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 46px;
}

.ed-card__prices {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
}

.ed-card__price-old {
  font-size: 10px;
  color: var(--ed-text-muted);
  text-decoration: line-through;
}

.ed-card__price {
  font-size: 15px;
  font-weight: 700;
  color: var(--ed-green);
}

.ed-card__add {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ed-amber);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  transition: var(--ed-transition);
  flex-shrink: 0;
}

.ed-card__add:hover {
  background: var(--ed-amber-light);
  transform: scale(1.1);
}

.ed-card__add:active { transform: scale(.95); }

/* Grid mode */
.ed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  padding: 0 16px 16px;
}

.ed-grid .ed-card { flex: none; }

/* --- CART DRAWER --- */
.ed-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s;
}

.ed-drawer-overlay.open { opacity: 1; visibility: visible; }

.ed-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 90vw);
  background: var(--ed-bg);
  border-left: 1px solid var(--ed-border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s ease;
}

.ed-drawer.open { transform: translateX(0); }

.ed-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ed-border);
}

.ed-drawer__header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ed-text);
}

.ed-drawer__close {
  font-size: 28px;
  color: var(--ed-text-muted);
  padding: 4px;
}

.ed-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.ed-drawer__empty {
  text-align: center;
  color: var(--ed-text-muted);
  padding: 40px 0;
}

.ed-drawer__footer {
  border-top: 1px solid var(--ed-border);
  padding: 16px 20px;
}

.ed-drawer__total {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--ed-text);
}

.ed-btn-checkout {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--ed-amber);
  color: #000;
  padding: 14px;
  border-radius: var(--ed-radius-sm);
  font-size: 15px;
  font-weight: 700;
  transition: var(--ed-transition);
}

.ed-btn-checkout:hover { background: var(--ed-amber-light); }

/* Cart item */
.ed-cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ed-border);
}

.ed-cart-item__img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  background: var(--ed-bg-card);
  border-radius: 8px;
  flex-shrink: 0;
}

.ed-cart-item__info { flex: 1; min-width: 0; }

.ed-cart-item__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ed-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ed-cart-item__price {
  font-size: 14px;
  font-weight: 700;
  color: var(--ed-green);
}

.ed-cart-item__qty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.ed-cart-item__qty button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--ed-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--ed-text);
  transition: var(--ed-transition);
}

.ed-cart-item__qty button:hover { background: var(--ed-bg-elevated); }

.ed-cart-item__qty span {
  font-size: 14px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
  color: var(--ed-text);
}

/* --- TOAST --- */
.ed-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ed-amber);
  color: #000;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transition: all .3s;
  z-index: 300;
  white-space: nowrap;
}

.ed-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* --- WHATSAPP FAB --- */
.ed-whatsapp {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37,211,102,.4);
  z-index: 50;
  transition: transform var(--ed-transition);
}

.ed-whatsapp:hover { transform: scale(1.1); }

/* --- LGPD BANNER --- */
.ed-lgpd {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ed-bg-card);
  color: var(--ed-text-light);
  border-top: 1px solid var(--ed-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 20px;
  font-size: 12px;
  z-index: 400;
  transform: translateY(100%);
  transition: transform .4s ease;
}

.ed-lgpd.show { transform: translateY(0); }

.ed-lgpd a { color: var(--ed-amber); text-decoration: underline; }

.ed-lgpd button {
  background: var(--ed-amber);
  color: #000;
  padding: 6px 20px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

/* --- FOOTER --- */
.ed-footer {
  background: var(--ed-bg-card);
  color: var(--ed-text-muted);
  padding: 32px 20px;
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
  border-top: 1px solid var(--ed-border);
}

.ed-footer__links {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 12px;
}

.ed-footer__links a {
  color: var(--ed-text-light);
  transition: color var(--ed-transition);
}

.ed-footer__links a:hover { color: var(--ed-amber); }

/* --- RESPONSIVE --- */
@media (min-width: 480px) {
  .ed-categories__grid { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 768px) {
  .ed-card { flex: 0 0 180px; }
  .ed-hero { padding: 36px 28px 32px; }
  .ed-section__header { padding: 0 24px 12px; }
  .ed-carousel { padding: 0 24px 8px; }
  .ed-grid { padding: 0 24px 16px; }
  .ed-categories__grid { grid-template-columns: repeat(7, 1fr); }
}

@media (min-width: 1024px) {
  .ed-card { flex: 0 0 195px; }
  .ed-hero__content { max-width: 700px; }
  .ed-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .ed-categories__grid { grid-template-columns: repeat(7, 1fr); }
}

/* --- SKELETON (dark theme) --- */
.ed-skeleton {
  background: var(--ed-bg-card);
  border-radius: var(--ed-radius-sm);
  position: relative;
  overflow: hidden;
}

.ed-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.04) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: ed-shimmer 1.5s ease-in-out infinite;
  will-change: transform;
}

@keyframes ed-shimmer {
  100% { transform: translateX(100%); }
}

.ed-skeleton-section { padding: 20px 16px 8px; }
.ed-skeleton-row { display: flex; gap: 12px; overflow: hidden; padding-top: 12px; }
.ed-skeleton-title { width: 140px; height: 22px; background: var(--ed-bg-elevated); border-radius: 4px; }
.ed-skeleton-card {
  flex: 0 0 160px;
  height: 260px;
  background: var(--ed-bg-card);
  border-radius: var(--ed-radius);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--ed-border);
}
.ed-skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.04) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: ed-shimmer 1.5s ease-in-out infinite;
  will-change: transform;
}
