/* ========================================
   ELETROFRIO | Main CSS
   E-Commerce de Peças de Refrigeração
   ======================================== */

:root {
  /* Brand Colors */
  --navy: #1B2F8A;
  --navy-dark: #152470;
  --cyan: #00AECC;
  --cyan-light: #E6F8FC;
  --orange: #FFC72C;

  /* Neutral Colors */
  --gray0: #F5F6F8;
  --gray1: #ECEEF2;
  --gray2: #D1D5DB;
  --gray3: #9CA3AF;
  --gray4: #6B7280;
  --gray5: #374151;
  --gray6: #1F2937;
  --white: #FFFFFF;

  /* Semantic Colors */
  --success: #059669;
  --error: #EF4444;
  --warning: #F59E0B;

  /* Typography */
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body: 'Barlow', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;
  --spacing-2xl: 32px;

  /* Radius */
  --radius: 6px;
  --radius-lg: 10px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06);
  --shadow: 0 4px 16px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.06);

  /* Transitions */
  --transition: .18s ease;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  color: var(--gray6);
  background: var(--gray0);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition);
}

a:hover {
  color: var(--cyan);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

/* ========================================
   TOPBAR
   ======================================== */

.topbar {
  background: var(--navy);
  color: rgba(255, 255, 255, .7);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 40px;
  gap: 16px;
}

.topbar a {
  color: rgba(255, 255, 255, .7);
  transition: color var(--transition);
}

.topbar a:hover {
  color: #fff;
}

.topbar-info {
  display: flex;
  gap: 20px;
  align-items: center;
}

.topbar-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.topbar-badge {
  background: var(--cyan);
  color: var(--navy);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
}

/* ========================================
   HEADER
   ======================================== */

header.site-header {
  background: #fff;
  border-bottom: 1px solid var(--gray1);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 40px;
  height: 68px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.site-logo a {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 42px;
  height: 42px;
  background: var(--navy);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-mark svg {
  width: 26px;
  height: 26px;
  fill: white;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  color: var(--navy);
  letter-spacing: -.5px;
}

.logo-tagline {
  font-size: 10px;
  color: var(--gray3);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Search */
.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 2px solid var(--gray2);
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.header-search input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 174, 204, .1);
}

.header-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray3);
  pointer-events: none;
}

/* Header Actions */
.header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.hbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 600;
  color: var(--gray4);
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.hbtn:hover {
  color: var(--cyan);
  background: var(--cyan-light);
}

.hbtn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.hbtn-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  background: var(--cyan);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
}

.hbtn-primary {
  background: var(--cyan);
  color: #fff;
  border-radius: var(--radius);
}

.hbtn-primary:hover {
  background: #0096B4;
  color: #fff;
}

/* ========================================
   NAVIGATION
   ======================================== */

.mainnav {
  background: var(--navy);
  border-bottom: 3px solid var(--cyan);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 40px;
  height: 44px;
  overflow-x: auto;
}

.nav-item {
  padding: 0 16px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, .75);
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
}

.nav-item:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, .3);
}

.nav-item.active {
  color: #fff;
  border-bottom-color: var(--cyan);
}

.nav-badge {
  background: var(--cyan);
  color: var(--navy);
  font-size: 9px;
  border-radius: 10px;
  padding: 1px 6px;
  font-weight: 700;
  margin-left: 2px;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 60%, #0d1d6e 100%);
  padding: 60px 40px;
  display: flex;
  align-items: center;
  gap: 60px;
  min-height: 380px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 480px;
  height: 480px;
  background: rgba(0, 174, 204, .08);
  border-radius: 50%;
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 174, 204, .15);
  border: 1px solid rgba(0, 174, 204, .3);
  color: #7de8f8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #7de8f8;
  border-radius: 50%;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 52px;
  line-height: 1;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -.5px;
}

.hero h1 span {
  color: var(--cyan);
  display: block;
}

.hero p {
  color: rgba(255, 255, 255, .65);
  font-size: 16px;
  max-width: 420px;
  margin-bottom: 28px;
  line-height: 1.6;
}

.hero-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--cyan);
  color: var(--navy);
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background: #0096B4;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 174, 204, .35);
}

.btn-outline-white {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, .3);
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-outline-white:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, .08);
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 32px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  color: var(--orange);
}

.hero-stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, .6);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ========================================
   PRODUCTS GRID
   ======================================== */

.products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 40px;
}

/* ── Card base ── */
.product-card {
  background: #fff;
  border: 1px solid #ECEEF2;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(27,47,138,.10), 0 2px 8px rgba(0,0,0,.06);
  border-color: var(--cyan);
}

/* ── Imagem ── */
.product-img {
  height: 220px;
  background: #F5F7FA;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #ECEEF2;
}

.product-img__thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: transform .3s ease;
}

.product-card:hover .product-img__thumb {
  transform: scale(1.04);
}

.product-img svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Badges ── */
.product-badge-sale {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--cyan);
  color: var(--navy);
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: .06em;
  padding: 3px 9px;
  border-radius: 20px;
  z-index: 2;
  text-transform: uppercase;
}

.product-badge-out {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(55,65,81,.85);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.product-badge-new {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--success);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 20px;
  z-index: 2;
  text-transform: uppercase;
}

/* ── Body ── */
.product-body {
  padding: 14px 16px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.product-brand {
  font-size: 10px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-family: var(--font-display);
}

.product-name {
  font-weight: 600;
  font-size: 14px;
  color: #1A1A2E;
  line-height: 1.4;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
}

.product-name:hover {
  color: var(--navy);
}

.product-sku {
  font-size: 11px;
  color: var(--gray3);
  font-family: var(--font-mono);
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--gray3);
}

.product-stars {
  color: #f59e0b;
  font-size: 12px;
  letter-spacing: -.1px;
}

/* ── Footer (preço + botão) ── */
.product-foot {
  padding: 10px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid #F0F1F5;
  margin-top: 4px;
}

/* Bloco de preço principal */
.product-price-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.product-price-old {
  font-size: 12px;
  color: var(--gray3);
  text-decoration: line-through;
  line-height: 1;
}

.product-price {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
}

/* PIX */
.product-price-pix {
  font-size: 11px;
  color: var(--success);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Badge credenciada — destaque */
.product-price-cred-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #1B2F8A 0%, #162275 100%);
  color: #00AECC;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(0,174,204,.3);
  letter-spacing: .02em;
  font-family: var(--font-display);
}

.product-price-cred-badge::before {
  content: '★';
  font-size: 10px;
  opacity: .8;
}

/* Lead time */
.product-lead {
  font-size: 11px;
  color: var(--gray4);
  display: flex;
  align-items: center;
  gap: 5px;
}

.product-lead::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

/* ── Botão CTA ── */
.btn-add-cart,
.btn-add-cart.add_to_cart_button,
a.btn-add-cart {
  background: var(--cyan);
  color: var(--navy) !important;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--font-display);
  letter-spacing: .04em;
  padding: 10px 14px;
  border-radius: var(--radius);
  width: 100%;
  transition: background .18s ease, color .18s ease, transform .15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
}

.btn-add-cart:hover,
.btn-add-cart.add_to_cart_button:hover {
  background: var(--navy);
  color: #fff !important;
  transform: translateY(-1px);
}

.btn-out {
  background: var(--gray1);
  color: var(--gray3);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius);
  width: 100%;
  border: 1px solid var(--gray2);
  cursor: not-allowed;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ========================================
   FILTERS
   ======================================== */

.filters {
  background: #fff;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray1);
  margin-bottom: 20px;
}

.filter-group {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray1);
}

.filter-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.filter-title {
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
  font-size: 14px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}

.filter-option input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--cyan);
}

.filter-option label {
  cursor: pointer;
  flex: 1;
}

.filter-option input:checked + label {
  font-weight: 600;
  color: var(--cyan);
}

.filter-range {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-range input {
  width: 100%;
  padding: 6px;
  border: 1px solid var(--gray2);
  border-radius: var(--radius);
  font-size: 12px;
}

.filter-range .separator {
  color: var(--gray3);
  font-weight: bold;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1200px) {
  .products {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .header-inner {
    padding: 0 20px;
    height: 56px;
  }

  .header-search {
    display: none;
  }

  .hero {
    flex-direction: column;
    padding: 40px 20px;
    min-height: auto;
  }

  .products {
    grid-template-columns: repeat(2, 1fr);
    padding: 20px;
    gap: 16px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .nav-inner {
    padding: 0 20px;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 6px 16px;
    font-size: 11px;
  }

  .header-inner {
    padding: 0 16px;
    gap: 12px;
  }

  .products {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 28px;
  }

  .logo-name {
    font-size: 18px;
  }

  .logo-text {
    display: none;
  }

  .nav-inner {
    padding: 0 16px;
  }
}

/* ========================================
   UTILITIES
   ======================================== */

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

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

#ef-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gray6);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  white-space: nowrap;
}

#ef-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

#ef-toast.ef-toast--success { background: var(--success); }
#ef-toast.ef-toast--error   { background: var(--error); }
#ef-toast.ef-toast--warning { background: var(--warning); color: var(--gray6); }

/* ========================================
   BACK TO TOP
   ======================================== */

#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, background .18s ease;
  z-index: 500;
  pointer-events: none;
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#back-to-top:hover {
  background: var(--cyan);
}

/* ========================================
   HEADER SCROLLED STATE
   ======================================== */

.site-header.is-scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,.12) !important;
}
