/* ============================================================
   Template E — "Bebidas Vitrine"
   Inspirado em Ze Distribuidora. Carrossel por categoria,
   hero gradiente laranja, CTAs verdes, fundo claro.
   CSS prefix: bv-  |  Session key: bv_cart
   ============================================================ */

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

:root {
  --bv-orange: #E65100;
  --bv-orange-light: #FF8F00;
  --bv-green: #00895E;
  --bv-green-light: #00A86B;
  --bv-bg: #F5F5F5;
  --bv-white: #FFFFFF;
  --bv-text: #1A1A1A;
  --bv-text-light: #666666;
  --bv-border: #E0E0E0;
  --bv-shadow: 0 2px 8px rgba(0,0,0,.08);
  --bv-shadow-hover: 0 4px 16px rgba(0,0,0,.12);
  --bv-radius: 12px;
  --bv-radius-sm: 8px;
  --bv-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --bv-font-display: 'Montserrat', 'Inter', sans-serif;
  --bv-transition: .2s ease;
}

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

body {
  font-family: var(--bv-font);
  background: var(--bv-bg);
  color: var(--bv-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; }

/* --- TOP BAR --- */
.bv-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bv-orange);
  color: #fff;
  font-size: 13px;
}

.bv-topbar__badge {
  background: var(--bv-green);
  color: #fff;
  padding: 2px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.bv-topbar__badge.closed {
  background: #C62828;
}

.bv-topbar__info {
  font-size: 13px;
  opacity: .9;
}

.bv-topbar__cart {
  position: relative;
  display: flex;
  align-items: center;
  color: #fff;
  padding: 6px;
}

.bv-topbar__cart-count {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--bv-green);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* --- HERO --- */
.bv-hero {
  background: linear-gradient(135deg, var(--bv-orange) 0%, var(--bv-orange-light) 100%);
  padding: 32px 20px 28px;
  color: #fff;
}

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

.bv-hero__title {
  font-family: var(--bv-font-display);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}

.bv-hero__subtitle {
  font-size: 15px;
  opacity: .9;
  margin-bottom: 14px;
}

.bv-hero__chips { display: flex; gap: 12px; flex-wrap: wrap; }

.bv-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(4px);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

/* --- MARQUEE --- */
.bv-marquee {
  background: var(--bv-green);
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.bv-marquee__track {
  display: inline-flex;
  animation: bv-scroll 20s linear infinite;
}

.bv-marquee__track span { padding-right: 40px; }

@keyframes bv-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- CATEGORIES --- */
.bv-categories {
  position: sticky;
  top: 40px;
  z-index: 90;
  background: var(--bv-white);
  border-bottom: 1px solid var(--bv-border);
  padding: 12px 0;
}

.bv-categories__scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.bv-categories__scroll::-webkit-scrollbar { display: none; }

.bv-cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--bv-radius-sm);
  font-size: 11px;
  font-weight: 500;
  color: var(--bv-text-light);
  white-space: nowrap;
  transition: var(--bv-transition);
  min-width: 70px;
  flex-shrink: 0;
}

.bv-cat-btn:hover { background: #F0F0F0; }

.bv-cat-btn[aria-selected="true"] {
  background: var(--bv-orange);
  color: #fff;
}

.bv-cat-btn__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #F0F0F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: var(--bv-transition);
}

.bv-cat-btn[aria-selected="true"] .bv-cat-btn__icon {
  background: rgba(255,255,255,.25);
}

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

.bv-search__box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bv-white);
  border: 1px solid var(--bv-border);
  border-radius: 28px;
  padding: 10px 18px;
  transition: var(--bv-transition);
}

.bv-search__box:focus-within {
  border-color: var(--bv-orange);
  box-shadow: 0 0 0 3px rgba(230,81,0,.1);
}

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

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

.bv-search__box input::placeholder { color: #999; }

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

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

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

.bv-section__title {
  font-family: var(--bv-font-display);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bv-section__title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--bv-orange);
  border-radius: 2px;
}

.bv-section__more {
  color: var(--bv-green);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--bv-transition);
}

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

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

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

/* --- PRODUCT CARD --- */
.bv-card {
  flex: 0 0 155px;
  background: var(--bv-white);
  border-radius: var(--bv-radius);
  box-shadow: var(--bv-shadow);
  overflow: hidden;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--bv-transition);
  position: relative;
}

.bv-card:hover { box-shadow: var(--bv-shadow-hover); }

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

.bv-card__tag--promo { background: var(--bv-orange); }

.bv-card__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #FAFAFA;
  padding: 10px;
}

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

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

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

.bv-card__price-old {
  font-size: 11px;
  color: #999;
  text-decoration: line-through;
}

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

.bv-card__add {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bv-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 500;
  transition: var(--bv-transition);
  flex-shrink: 0;
}

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

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

/* Grid mode (when "Ver mais" is clicked or category filtered) */
.bv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  padding: 0 16px 16px;
}

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

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

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

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

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

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

.bv-drawer__header h2 {
  font-size: 18px;
  font-weight: 700;
}

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

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

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

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

.bv-drawer__total {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  margin-bottom: 12px;
}

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

.bv-btn-checkout:hover { background: var(--bv-green-light); }

/* Cart item */
.bv-cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #F0F0F0;
}

.bv-cart-item__img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #FAFAFA;
  border-radius: 8px;
  flex-shrink: 0;
}

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

.bv-cart-item__name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

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

.bv-cart-item__qty button:hover { background: #F0F0F0; }

.bv-cart-item__qty span {
  font-size: 14px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

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

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

/* --- WHATSAPP FAB --- */
.bv-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(--bv-transition);
}

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

/* --- LGPD BANNER --- */
.bv-lgpd {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bv-text);
  color: #fff;
  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;
}

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

.bv-lgpd a { color: var(--bv-orange-light); text-decoration: underline; }

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

/* --- FOOTER --- */
.bv-footer {
  background: var(--bv-text);
  color: #aaa;
  padding: 32px 20px;
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
}

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

.bv-footer__links a {
  color: #ccc;
  transition: color var(--bv-transition);
}

.bv-footer__links a:hover { color: #fff; }

/* --- RESPONSIVE --- */
@media (min-width: 768px) {
  .bv-card { flex: 0 0 180px; }
  .bv-hero { padding: 40px 32px 36px; }
  .bv-section__header { padding: 0 24px 12px; }
  .bv-carousel { padding: 0 24px 8px; }
  .bv-grid { padding: 0 24px 16px; }
}

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

/* --- LOADING SKELETON (GPU-composited via transform) --- */
.bv-skeleton {
  background: #F0F0F0;
  border-radius: var(--bv-radius-sm);
  position: relative;
  overflow: hidden;
}

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

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

/* Skeleton for pre-rendered placeholders in index.html */
.bv-skeleton-section { padding: 20px 16px 8px; }
.bv-skeleton-row { display: flex; gap: 12px; overflow: hidden; padding-top: 12px; }
.bv-skeleton-title { width: 140px; height: 22px; background: #E8E8E8; border-radius: 4px; }
.bv-skeleton-card {
  flex: 0 0 155px;
  height: 240px;
  background: var(--bv-white);
  border-radius: var(--bv-radius);
  overflow: hidden;
  position: relative;
}
.bv-skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.03) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: bv-shimmer 1.5s ease-in-out infinite;
  will-change: transform;
}
