/* TodoFrío Automotriz - Master Design System (Blanco, Azul y Rojo) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-highlight: #0284c7;
  
  --color-blue-dark: #0f172a;
  --color-blue-navy: #1e3a8a;
  --color-blue-electric: #0284c7;
  --color-blue-hover: #02649c;
  
  --color-red-racing: #dc2626;
  --color-red-dark: #991b1b;
  --color-red-hover: #b91c1c;
  
  --accent-cyan: #0284c7;
  --accent-blue: #1e3a8a;
  --accent-red: #dc2626;
  --accent-ice: #e0f2fe;
  
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #1e3a8a 100%);
  --accent-gradient-red: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  --accent-gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #0284c7 100%);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --cost-red: #dc2626;
  --profit-green: #10b981;
  --warning-amber: #d97706;
  
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-glow: 0 4px 20px rgba(2, 132, 199, 0.18);
  --shadow-glow-red: 0 4px 20px rgba(220, 38, 38, 0.25);
  --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.07);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(220, 38, 38, 0.3); }
  50% { box-shadow: 0 0 25px rgba(220, 38, 38, 0.6); }
}

/* Header & Navbar */
.site-header {
  background: #ffffff;
  border-bottom: 2px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.nav-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  transition: transform 0.25s ease;
}

.brand-logo:hover {
  transform: scale(1.02);
}

.brand-logo img {
  height: 52px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
}

.brand-badge {
  font-size: 0.65rem;
  background: rgba(2, 132, 199, 0.1);
  color: var(--color-blue-electric);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--color-blue-electric);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
  color: var(--color-blue-electric);
  background: rgba(2, 132, 199, 0.08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: var(--accent-gradient-red);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
  box-shadow: 0 8px 25px rgba(220, 38, 38, 0.45);
}

.btn-blue {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.btn-blue:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #02649c 0%, #172554 100%);
  box-shadow: 0 8px 25px rgba(2, 132, 199, 0.35);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.btn-secondary:hover {
  background: #f1f5f9;
  border-color: var(--color-blue-electric);
  color: var(--color-blue-electric);
  transform: translateY(-1px);
}

.btn-outline-cyan {
  background: transparent;
  color: var(--color-blue-electric);
  border: 2px solid var(--color-blue-electric);
}

.btn-outline-cyan:hover {
  background: var(--color-blue-electric);
  color: #ffffff;
}

.btn-sm {
  padding: 0.45rem 0.95rem;
  font-size: 0.82rem;
}

/* Vehicle Search Hero Component */
.hero-search-section {
  background: var(--accent-gradient-hero);
  padding: 3.5rem 1.5rem;
  color: #ffffff;
  box-shadow: inset 0 -10px 30px rgba(0, 0, 0, 0.2);
  position: relative;
}

.hero-wrapper {
  max-width: 1250px;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-subtitle {
  color: #e0f2fe;
  font-size: 1.15rem;
  margin-bottom: 2.2rem;
  font-weight: 400;
}

.vehicle-selector-box {
  background: #ffffff;
  border: 2px solid var(--color-blue-electric);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) auto;
  gap: 1.1rem;
  align-items: end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  text-align: left;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-select, .form-control {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.form-select:focus, .form-control:focus {
  border-color: var(--color-blue-electric);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

/* Layout Main Content */
.main-content {
  flex: 1;
  max-width: 1350px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  animation: fadeInUp 0.4s ease-out;
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-blue-dark);
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 1.75rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-card);
}

.product-card:hover {
  border-color: var(--color-blue-electric);
  transform: translateY(-6px);
  box-shadow: 0 15px 40px rgba(2, 132, 199, 0.15);
}

.product-image-container {
  height: 210px;
  background: #f8fafc;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.product-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.product-card:hover .product-image {
  transform: scale(1.08);
}

.category-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(4px);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 14px;
}

.stock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 14px;
}

.badge-in-stock {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid #059669;
}

.badge-low-stock {
  background: rgba(217, 119, 6, 0.15);
  color: #d97706;
  border: 1px solid #d97706;
}

.product-details {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-sku {
  font-size: 0.78rem;
  color: var(--color-red-racing);
  font-weight: 800;
  font-family: monospace;
  margin-bottom: 0.25rem;
}

.product-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  line-height: 1.35;
  white-space: normal;
  word-wrap: break-word;
}

.product-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
}

.product-price {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-blue-dark);
}

/* Admin Metric Cards */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.08);
}

.metric-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.icon-blue { background: rgba(2, 132, 199, 0.12); color: var(--color-blue-electric); }
.icon-green { background: rgba(16, 185, 129, 0.12); color: var(--profit-green); }
.icon-red { background: rgba(220, 38, 38, 0.12); color: var(--cost-red); }
.icon-amber { background: rgba(217, 119, 6, 0.12); color: var(--warning-amber); }

.metric-val {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 800;
}

.metric-lbl {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Data Tables (Optimized for space and clean line breaking) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.custom-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 0.88rem;
}

.custom-table th {
  background: var(--color-blue-dark);
  color: #ffffff;
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--color-blue-electric);
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.custom-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  line-height: 1.45;
}

.custom-table tr:hover {
  background: rgba(2, 132, 199, 0.04);
}

.product-title-link {
  color: #38bdf8;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
  display: inline-block;
}

.product-title-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.badge-sku {
  font-family: var(--font-mono, monospace);
  background: rgba(2, 132, 199, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(2, 132, 199, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-block;
  white-space: nowrap;
}

.btn-quick-detail {
  background: rgba(2, 132, 199, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(2, 132, 199, 0.35);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.btn-quick-detail:hover {
  background: var(--color-blue-electric);
  color: #ffffff;
  border-color: var(--color-blue-electric);
}

.text-nowrap {
  white-space: nowrap !important;
}

/* Footer */
.site-footer {
  background: var(--color-blue-dark);
  border-top: 3px solid var(--color-blue-electric);
  padding: 2.5rem 1.5rem;
  margin-top: 4rem;
  color: #ffffff;
}

.footer-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.9rem;
}

/* Cart Drawer */
.cart-drawer {
  position: fixed;
  top: 80px;
  right: -440px;
  width: calc(100% - 30px);
  max-width: 400px;
  max-height: calc(100vh - 110px);
  background: #ffffff;
  border: 2px solid var(--color-blue-electric);
  border-radius: var(--radius-md);
  box-shadow: -10px 20px 50px rgba(15, 23, 42, 0.3);
  z-index: 2000;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-drawer.open {
  right: 15px;
}

.cart-drawer-header {
  padding: 1.1rem 1.3rem;
  background: var(--color-blue-dark);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-drawer-body {
  padding: 1.25rem;
  flex: 1;
  overflow-y: auto;
}

/* Floating WhatsApp Button */
.whatsapp-float {
  position: fixed;
  bottom: 25px;
  left: 25px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff !important;
  padding: 12px 22px;
  border-radius: 50px;
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.45);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none !important;
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-float i {
  font-size: 1.6rem;
}

.whatsapp-float:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 15px 35px rgba(37, 211, 102, 0.6);
}

@media (max-width: 768px) {
  .whatsapp-text { display: none; }
  .whatsapp-float { padding: 14px; border-radius: 50%; bottom: 20px; left: 20px; }
  .cart-drawer { top: 70px; max-height: calc(100vh - 90px); }
  .hero-title { font-size: 2rem; }
}
