/* ==========================================================================
   CATÁLOGO DIGITAL - MODERN DESIGN SYSTEM
   ========================================================================== */

:root {
  --brand-900: #0b1b7a;
  --brand-800: #1130a8;
  --brand-700: #1b4dd8;
  --brand-600: #2563eb;
  --brand-500: #3b82f6;
  --brand-100: #eff6ff;
  --brand-50:  #f8faff;
  
  --bg-page:   #f8fafc;
  --card-bg:   #ffffff;
  --text-main: #0f172a;
  --text-muted:#64748b;
  --border-line:#e2e8f0;
  
  --accent-gold: #f59e0b;
  --danger-red:  #ef4444;
  --success-green: #10b981;
  --purple-brand:  #8b5cf6;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.04);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 12px 28px -4px rgba(15, 23, 42, 0.15);
  --shadow-glow: 0 8px 25px rgba(27, 77, 216, 0.25);
}

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   TOPBAR & HEADER
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  background: linear-gradient(135deg, #091458 0%, #1130a8 60%, #1b4dd8 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(11, 27, 122, 0.28);
  padding: 0.75rem 0;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: #fff;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 5px;
}

.brand-title {
  font-weight: 900;
  letter-spacing: 0.5px;
  font-size: 1.15rem;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

/* Search Bar */
.search-container {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-full);
  padding: 3px 6px 3px 14px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  transition: all 0.25s ease;
}

.search-container:focus-within {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.search-container:focus-within .search-icon,
.search-container:focus-within #campo-busca {
  color: var(--text-main);
}

.search-container:focus-within #campo-busca::placeholder {
  color: var(--text-muted);
}

.search-icon {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.15rem;
  margin-right: 8px;
  transition: color 0.2s;
}

#campo-busca {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 500;
  width: 100%;
  outline: none;
}

#campo-busca::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.btn-clear-search {
  background: rgba(0, 0, 0, 0.15);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.btn-clear-search:hover {
  background: rgba(0, 0, 0, 0.3);
}

.search-container.has-text .btn-clear-search {
  display: inline-flex;
}

/* ==========================================================================
   HERO BANNER
   ========================================================================== */
.hero-banner {
  background: linear-gradient(135deg, #091458 0%, #1e40af 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  position: relative;
}

.hero-banner::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59,130,246,0.3) 0%, rgba(0,0,0,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* ==========================================================================
   NAVIGATION, CATEGORIES & QUICK FILTERS
   ========================================================================== */
.quick-filter-wrapper {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.quick-filter-wrapper::-webkit-scrollbar {
  display: none;
}

.quick-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border-line);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.quick-pill:hover {
  background: var(--brand-100);
  color: var(--brand-700);
  border-color: #bfdbfe;
  transform: translateY(-1px);
}

.quick-pill.active {
  background: var(--brand-700);
  color: #ffffff;
  border-color: var(--brand-700);
  box-shadow: 0 4px 14px rgba(27, 77, 216, 0.3);
}

.quick-pill.pill-promo.active {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: #ef4444;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.quick-pill.pill-lancamento.active {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #10b981;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.quick-pill.pill-mais-vendido.active {
  background: linear-gradient(135deg, #f97316, #ea580c);
  border-color: #f97316;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

.quick-pill .pill-badge {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 99px;
  padding: 1px 7px;
  font-size: 0.72rem;
}

.quick-pill.active .pill-badge {
  background: rgba(255, 255, 255, 0.25);
}

/* Category Sidebar Button */
.btn-category-toggle {
  flex: 0 0 auto;
  background: #ffffff;
  border: 1px solid var(--border-line);
  color: var(--brand-900);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-category-toggle:hover {
  background: var(--brand-100);
  color: var(--brand-700);
}

/* Toolbar de Listagem */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.sort-select {
  border: 1px solid var(--border-line);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  background-color: #fff;
  cursor: pointer;
  outline: none;
  box-shadow: var(--shadow-sm);
}

.sort-select:focus {
  border-color: var(--brand-600);
}

/* ==========================================================================
   PRODUCT CARDS & BADGES
   ========================================================================== */
.card-produto {
  background: var(--card-bg);
  border: 1px solid var(--border-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.card-produto:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}

/* Image Container */
.card-produto .img-wrapper {
  position: relative;
  width: 100%;
  height: 210px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  cursor: pointer;
  overflow: hidden;
  border-bottom: 1px solid #f1f5f9;
}

.card-produto .img-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-produto:hover .img-wrapper img {
  transform: scale(1.06);
}

/* BADGES HIERARCHY */
.badges-stack {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  pointer-events: none;
  max-width: calc(100% - 20px);
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 4px 9px;
  border-radius: 6px;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.14);
  line-height: 1.1;
  white-space: nowrap;
}

/* Badge Variants */
.badge-tag.promo-discount {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.badge-tag.promo-gift {
  background: linear-gradient(135deg, #059669, #047857);
}

.badge-tag.promo-tier {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.badge-tag.badge-lancamento {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35);
}

.badge-tag.badge-premium {
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  border: 1px solid #e2e8f0;
  color: #fef08a;
}

.badge-tag.badge-mais-vendido {
  background: linear-gradient(135deg, #f97316, #c2410c);
  box-shadow: 0 3px 10px rgba(249, 115, 22, 0.35);
}

.badge-tag.badge-margem {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.badge-tag.badge-pronta-entrega {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

/* Card Body */
.card-produto .card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-produto .product-code {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.card-produto .product-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 6px;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.7em;
  transition: color 0.15s;
}

.card-produto .product-title:hover {
  color: var(--brand-700);
}

/* Pricing Section */
.price-box {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.price-box .price-old {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-decoration: line-through;
  line-height: 1;
  margin-bottom: 2px;
}

.price-box .price-current {
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.price-box .price-current.is-promo {
  color: var(--danger-red);
}

.price-box .price-current.is-normal {
  color: var(--text-main);
}

.price-box .economy-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

/* Tier promo compact pill */
.tier-promo-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-700);
  background: var(--brand-100);
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 4px;
  display: block;
}

/* Action Button */
.btn-buy-card {
  width: 100%;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 10px;
  margin-top: 10px;
  border: none;
  background: var(--brand-100);
  color: var(--brand-800);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-buy-card:hover {
  background: var(--brand-700);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(27, 77, 216, 0.28);
  transform: translateY(-1px);
}

.btn-buy-card:active {
  transform: translateY(0);
}

/* ==========================================================================
   SUPER PROMO CAROUSEL
   ========================================================================== */
.promo-carousel-container {
  background: linear-gradient(135deg, #fff1f2 0%, #fff 100%);
  border: 1px solid #fecdd3;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

.promo-carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.promo-carousel-header .title-badge {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-weight: 900;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

/* Countdown Pill */
.countdown-pill {
  background: #ffffff;
  border: 1px solid #fecdd3;
  color: #be123c;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ==========================================================================
   FLOATING BOTTOM CART BAR (BOTTOM DRAWER)
   ========================================================================== */
.floating-cart-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  width: calc(100% - 32px);
  max-width: 540px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-full);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1045;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.floating-cart-bar.visible {
  transform: translateX(-50%) translateY(0);
}

.floating-cart-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.floating-cart-icon {
  background: var(--brand-700);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.floating-cart-btn {
  background: #10b981;
  color: #ffffff;
  border: none;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.floating-cart-btn:hover {
  background: #059669;
}

/* Floating round cart button */
.btn-float-cart {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1040;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-900), var(--brand-700));
  color: #fff;
  border: none;
  box-shadow: 0 10px 30px rgba(11, 27, 122, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-float-cart:hover {
  transform: scale(1.08);
  box-shadow: 0 14px 35px rgba(11, 27, 122, 0.5);
}

.btn-float-cart .badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-gold);
  color: #111827;
  font-weight: 900;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 99px;
  border: 2px solid #ffffff;
}

/* ==========================================================================
   MODAL QUICK VIEW & CART
   ========================================================================== */
.modal-product-view .modal-content {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: none;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
}

.modal-product-view .modal-header {
  background: linear-gradient(135deg, var(--brand-900), var(--brand-700));
  color: #ffffff;
  padding: 1rem 1.5rem;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}

.qty-stepper button {
  background: #f8fafc;
  border: none;
  width: 36px;
  height: 36px;
  font-weight: bold;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.15s;
}

.qty-stepper button:hover {
  background: #e2e8f0;
}

.qty-stepper input {
  width: 48px;
  height: 36px;
  border: none;
  text-align: center;
  font-weight: bold;
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
}

/* Offcanvas Sidebar */
.offcanvas {
  border-radius: 0 20px 20px 0;
  border: none;
}

.offcanvas-header {
  background: linear-gradient(135deg, var(--brand-900), var(--brand-700));
  color: #fff;
}

.list-group-item {
  border: none;
  border-bottom: 1px solid var(--border-line);
  padding: 14px 20px;
  color: var(--text-main);
  font-size: 0.95rem;
  cursor: pointer;
  transition: 0.2s;
}

.list-group-item:hover, .list-group-item.active {
  background-color: var(--brand-100);
  color: var(--brand-800);
  font-weight: 800;
}

.icon-box {
  width: 32px;
  height: 32px;
  background: #eef2ff;
  border-radius: 8px;
  color: var(--brand-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* Responsiveness */
@media (max-width: 767.98px) {
  .card-produto .img-wrapper {
    height: 165px;
    padding: 8px;
  }
  .card-produto .product-title {
    font-size: 0.85rem;
  }
  .price-box .price-current {
    font-size: 1.1rem;
  }
  .btn-buy-card {
    padding: 8px;
    font-size: 0.78rem;
  }
  .badge-tag {
    font-size: 0.62rem;
    padding: 3px 6px;
  }
  .floating-cart-bar {
    width: calc(100% - 20px);
    bottom: 12px;
    padding: 10px 14px;
  }
}