/*
 * ============================================================
 *  ZAPTOU — PREMIUM REBRANDING v1.0
 *  Overriding client app layout based on visual DNA references
 * ============================================================
 */

/* ── 0. VARIABLES & GLOBALS ────────────────────────────── */
:root {
  --z-rebrand-radius: 18px;
  --z-shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.04);
}

/* ── 1. PROMO BANNER ────────────────────────────────────── */
.z-promo-banner-container {
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.z-promo-banner-card {
  position: relative;
  background: linear-gradient(135deg, var(--z-primary, #ff5c00) 0%, #ff7c33 100%);
  border-radius: var(--z-rebrand-radius);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(255, 92, 0, 0.15);
  color: white;
  min-height: 140px;
}

.z-promo-banner-info {
  flex: 1;
  max-width: 65%;
  z-index: 2;
}

.z-promo-banner-info h2 {
  font-family: 'Inter', 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 12px;
  color: white !important;
  letter-spacing: -0.3px;
}

.z-promo-banner-btn {
  display: inline-block;
  background: white !important;
  color: var(--z-primary, #ff5c00) !important;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 8px 20px;
  border-radius: 99px;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.z-promo-banner-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

.z-promo-banner-img {
  position: absolute;
  right: 16px;
  bottom: 0;
  top: 0;
  width: 140px;
  height: 100%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.z-promo-banner-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.2));
}

@media (min-width: 768px) {
  .z-promo-banner-card {
    padding: 32px 40px;
    min-height: 160px;
  }
  .z-promo-banner-info h2 {
    font-size: 1.6rem;
  }
  .z-promo-banner-img {
    right: 32px;
    width: 190px;
  }
}

/* ── HEADER CONSOLIDATION & BADGES ───────────────────────── */
.z-desktop-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 16px;
}

.z-header-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
}

.z-header-status-badge.is-open {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.z-header-status-badge.is-closed {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.z-header-status-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.z-header-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  font-size: 0.78rem;
  font-weight: 600;
  color: #4b5563;
}

.z-mob-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #111827;
}

.z-mob-store-title {
  font-weight: 700;
  font-size: 1rem;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.z-mob-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.z-mob-status-dot.open { background: #16a34a; }
.z-mob-status-dot.closed { background: #dc2626; }

/* ── 2-COLUMN INFO GRID (FAQ & REVIEWS) ───────────────────── */
.z-bottom-info-section {
  padding: 44px 16px;
  background: #f8f9fa;
  border-top: 1px solid #e5e7eb;
}

.z-bottom-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 900px) {
  .z-bottom-info-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
  }
}

.z-reviews-scroll-box {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.z-reviews-scroll-box::-webkit-scrollbar {
  width: 5px;
}

.z-reviews-scroll-box::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}


/* ── 2. GRID DE PRODUTOS (MOBILE) ────────────────────────── */
@media (max-width: 767px) {
  .z-store-products, .plp-products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    padding: 12px !important;
  }
}

/* ── 3. CARD DE PRODUTOS VERTICAIS (MOBILE E DESKTOP) ────── */
@media (max-width: 767px) {
  .z-store-product, .plp-product {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 10px !important;
    border-radius: var(--z-rebrand-radius) !important;
    border: 1px solid var(--z-border, rgba(0,0,0,0.06)) !important;
    background: var(--z-surface, #ffffff) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03) !important;
    position: relative !important;
    text-decoration: none !important;
    color: inherit !important;
    min-height: 260px !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
  }

  .z-store-product:active, .plp-product:active {
    transform: scale(0.97) !important;
  }

  /* Image Top */
  .z-store-product img.z-store-product-img,
  .plp-product img.plp-product-img {
    width: 100% !important;
    height: 120px !important;
    border-radius: 12px !important;
    object-fit: cover !important;
    margin: 0 0 4px 0 !important;
    display: block !important;
  }

  /* Info container */
  .z-store-product-info, .plp-product-info {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    padding: 0 !important;
  }

  /* Title & Desc */
  .z-store-product-name, .plp-product-name {
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    color: var(--z-text, #271812) !important;
    margin: 0 0 2px 0 !important;
    line-height: 1.3 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 1 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .z-store-product-desc, .plp-product-desc {
    font-size: 0.7rem !important;
    color: var(--z-text-secondary, #5b4137) !important;
    line-height: 1.35 !important;
    margin: 0 0 6px 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    height: 2.6em !important;
  }

  /* Footer (Price & Add Button side-by-side) */
  .z-store-product-footer, .plp-product-price {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-top: auto !important;
    padding: 2px 0 0 0 !important;
    width: 100% !important;
  }

  .z-store-product-price, .plp-product-price {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    color: var(--z-primary, #ff5c00) !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .z-store-product-old-price, .plp-product-old-price {
    font-size: 0.72rem !important;
    color: var(--z-text-muted, #8f7065) !important;
    text-decoration: line-through !important;
    margin-right: 0 !important;
    line-height: 1 !important;
    margin-bottom: 2px !important;
  }

  /* Dynamic mock rating badge */
  .z-store-product::before, .plp-product::before {
    content: "★ 4.8" !important;
    position: absolute !important;
    top: 16px !important;
    left: 16px !important;
    z-index: 10 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #ff9800 !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    padding: 2px 6px !important;
    border-radius: 20px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06) !important;
    display: flex !important;
    align-items: center !important;
    gap: 2px !important;
  }

  /* Float promo badge to top right */
  .z-store-product-badge.promo, .plp-product-badge.promo {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    left: auto !important;
    margin: 0 !important;
    z-index: 10 !important;
    background: #fee2e2 !important;
    color: #dc2626 !important;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 20px !important;
  }

  /* Action button (circle orange with plus sign) */
  .z-store-add-btn, .plp-product::after {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: var(--z-primary, #ff5c00) !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    box-shadow: 0 3px 8px rgba(255,92,0,0.2) !important;
    transition: transform var(--z-transition) !important;
  }

  /* For category page where we inject visual button */
  .plp-product::after {
    content: "+" !important;
    font-size: 1.15rem !important;
    font-weight: 600 !important;
    position: absolute !important;
    bottom: 8px !important;
    right: 8px !important;
  }
}

/* Desktop vertical cards refinement */
@media (min-width: 768px) {
  .z-store-product, .plp-product {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 16px !important;
    border-radius: var(--z-rebrand-radius) !important;
  }
  .z-store-product img.z-store-product-img,
  .plp-product img.plp-product-img {
    width: 100% !important;
    height: 180px !important;
    border-radius: 12px !important;
    margin-bottom: 8px !important;
  }
}

/* ── 4. CATEGORY TABS ───────────────────────────────────── */
.z-store-tabs, .plp-cat-tabs {
  border-bottom: none !important;
  background: transparent !important;
  padding: 12px 16px !important;
  gap: 8px !important;
}

.z-store-tab, .plp-cat-tab, .plp-sub-tab {
  border-radius: 20px !important;
  padding: 8px 16px !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  color: var(--z-text-secondary, #5b4137) !important;
  background: var(--z-surface, #ffffff) !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02) !important;
  transition: all 0.2s !important;
}

.z-store-tab:hover, .plp-cat-tab:hover {
  border-color: var(--z-primary) !important;
  color: var(--z-primary) !important;
}

.z-store-tab.active, .plp-cat-tab.active {
  background: var(--z-primary) !important;
  border-color: var(--z-primary) !important;
  color: white !important;
  box-shadow: var(--z-shadow-primary) !important;
}

/* ── 5. BOTTOM NAVIGATION BAR ────────────────────────────── */
@media (min-width: 900px) {
  .z-store-bottomnav, .z-cat-bottomnav, .pd-product-bottomnav {
    display: none !important;
  }
}

@media (max-width: 899px) {
  .z-store-bottomnav, .z-cat-bottomnav, .pd-product-bottomnav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 60px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    z-index: 1050 !important;
    box-shadow: 0 -3px 12px rgba(0,0,0,0.06) !important;
    padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

body.cart-open .z-store-bottomnav,
body.cart-open .z-cat-bottomnav,
body.cart-open .pd-product-bottomnav,
body.cart-open .z-store-cart-float {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  transform: translateY(100%) !important;
  pointer-events: none !important;
}

.z-store-bottomnav a, .z-cat-bottomnav a, .z-store-bottomnav button, .z-store-bottomnav .z-bottomnav-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  color: var(--z-text-muted, #8f7065) !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  gap: 2px !important;
  transition: color 0.15s, transform 0.15s !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  padding: 4px 8px !important;
}

.z-store-bottomnav a:active, .z-store-bottomnav button:active, .z-store-bottomnav .z-bottomnav-btn:active {
  transform: scale(0.92) !important;
}

.z-store-bottomnav a.active, .z-cat-bottomnav a.active, .z-store-bottomnav button.active, .z-store-bottomnav .z-bottomnav-btn.active {
  color: var(--z-primary, #ff5c00) !important;
}

/* ── 6. CHECKOUT OPTIONS (PAYMENT & DELIVERY) ────────────── */
.pagamento-option, .entrega-option {
  border-radius: 16px !important;
  border: 2px solid rgba(167, 58, 0, 0.08) !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.02) !important;
  padding: 14px 16px !important;
  transition: all 0.2s !important;
}

.pagamento-option:hover, .entrega-option:hover {
  border-color: var(--z-primary) !important;
}

.pagamento-option.selected, .entrega-option.selected {
  border-color: var(--z-primary) !important;
  background: rgba(255, 92, 0, 0.02) !important;
}

/* ── 7. TIMELINE DE ACOMPANHAMENTO ────────────────────────── */
.timeline-item.active .timeline-marker {
  background: var(--z-primary) !important;
  border-color: var(--z-primary) !important;
}

.timeline-marker {
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px !important; /* Square checkbox-like indicators from Screen 8 */
  background: #f3f4f6 !important;
  border: 2px solid #e5e7eb !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: white !important;
}

.timeline-item.active .timeline-marker::after {
  content: "✔" !important;
  font-size: 10px !important;
  font-weight: 900 !important;
}

/* ── 8. CARRINHO DE COMPRAS ──────────────────────────────── */
.cart-item {
  border-bottom: 1.5px dashed rgba(167, 58, 0, 0.06) !important;
  padding: 16px 0 !important;
}

.cart-item img {
  border-radius: 50% !important; /* Round thumb from Screen 5 */
  width: 64px !important;
  height: 64px !important;
}

.cart-qty-control {
  display: inline-flex !important;
  align-items: center !important;
  border: 1.5px solid var(--z-primary) !important;
  border-radius: 99px !important; /* Rounded pill qty selector */
  overflow: hidden !important;
  background: #fff8f6 !important;
}

.cart-qty-btn {
  width: 32px !important;
  height: 32px !important;
  border: none !important;
  background: transparent !important;
  color: var(--z-primary) !important;
  font-weight: 900 !important;
  cursor: pointer !important;
}

.cart-qty-value {
  padding: 0 8px !important;
  font-weight: 800 !important;
  color: var(--z-text) !important;
}

/* ── 9. STOREFRONT iFOOD-STYLE DESKTOP SIDEBAR + GRID 3X3 & MOBILE ────── */
.z-store-layout-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
  width: 100%;
}

.z-store-sidebar {
  position: sticky;
  top: 84px;
  background: var(--z-surface, #ffffff);
  border-radius: 16px;
  border: 1px solid var(--z-border, rgba(0,0,0,0.06));
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.z-store-sidebar-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--z-text, #111827);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--z-border, rgba(0,0,0,0.06));
}

.z-store-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 480px;
  overflow-y: auto;
}

.z-store-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--z-text-secondary, #4b5563);
  text-decoration: none;
  transition: all 0.2s;
}

.z-store-sidebar-item:hover, .z-store-sidebar-item.active {
  background: color-mix(in srgb, var(--z-primary) 8%, transparent);
  color: var(--z-primary, #ff5c00);
}

.z-store-sidebar-item img {
  width: 22px;
  height: 22px;
  object-fit: cover;
  border-radius: 6px;
}

/* Multi-Banner Carousel */
.z-banner-carousel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.z-banner-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  height: 140px;
  background: linear-gradient(135deg, var(--z-primary) 0%, #e65200 100%);
  color: white;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 14px rgba(255,92,0,0.15);
}

.z-banner-card img {
  position: absolute;
  right: 0;
  bottom: 0;
  max-height: 100%;
  width: auto;
  object-fit: contain;
}

/* Desktop Grid 3x3 */
@media (min-width: 768px) {
  .z-store-products-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 20px !important;
  }
}

/* Mobile Layout Adaptations */
@media (max-width: 767px) {
  .z-store-layout-grid {
    grid-template-columns: 1fr !important;
  }
  .z-store-sidebar {
    display: none !important;
  }
  .z-banner-carousel {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    padding-bottom: 8px !important;
    grid-template-columns: none !important;
  }
  .z-banner-card {
    min-width: 85% !important;
    scroll-snap-align: center !important;
  }
  
  /* Mobile Horizontal Product Card */
  .z-store-product {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 16px !important;
    height: auto !important;
  }
  .z-store-product img.z-store-product-img {
    order: 2 !important;
    width: 80px !important;
    height: 80px !important;
    margin: 0 0 0 12px !important;
    border-radius: 12px !important;
  }
  .z-store-product-info {
    order: 1 !important;
    flex: 1 !important;
  }
}

