/* ==========================================================================
   MEGA SURCO - HOJA DE ESTILOS CSS PRINCIPAL (MODERNO & RESPONSIVO)
   Colores Corporativos: Azul Profundo (#0d0434), Azul Eléctrico (#360dca), Cyan (#00d2ff)
   ========================================================================== */

:root {
  --primary: #360dca;
  --primary-hover: #26099a;
  --primary-light: #ece8fe;
  --secondary: #00d2ff;
  --dark: #0d0434;
  --dark-surface: #15094a;
  --accent: #ff007a;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(13, 4, 52, 0.08);
  --shadow-lg: 0 12px 28px rgba(13, 4, 52, 0.12);
  --transition: all 0.2s ease-in-out;
}

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

html, body {
  font-family: var(--font-base);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
}

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

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

/* CONTENEDOR */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* TOPBAR */
.topbar {
  background: #080221;
  color: #94a3b8;
  font-size: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-announcement {
  color: #38bdf8;
  font-weight: 600;
  letter-spacing: 0.5px;
}

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

.topbar-link {
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.topbar-link:hover {
  color: #ffffff;
}

/* HEADER & NAVBAR */
.header-main {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 20px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.brand-badge {
  background: var(--dark);
  color: #00d2ff;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.search-form {
  display: flex;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 10px 18px;
  border: 2px solid #cbd5e1;
  border-right: none;
  border-radius: var(--radius-full) 0 0 var(--radius-full);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
}

.search-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 20px;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  cursor: pointer;
  font-weight: bold;
  transition: var(--transition);
}

.search-btn:hover {
  background: var(--primary-hover);
}

/* HEADER ACTIONS */
.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn-whatsapp-header {
  background: #25d366;
  color: #ffffff;
  padding: 9px 16px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.25);
}

.btn-whatsapp-header:hover {
  background: #1eb956;
  transform: translateY(-1px);
}

.cart-icon-btn {
  position: relative;
  background: var(--bg-page);
  padding: 9px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.cart-count-badge {
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* NAVBAR LINKS */
.nav-categories {
  background: var(--dark);
  color: white;
  padding: 0;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 5px;
  overflow-x: auto;
  white-space: nowrap;
}

.nav-link {
  display: inline-block;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  border-bottom: 2px solid transparent;
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
  background: rgba(255,255,255,0.06);
  border-bottom-color: var(--secondary);
}

/* HERO BANNER */
.hero-banner {
  background: linear-gradient(135deg, #0d0434 0%, #1a0566 50%, #360dca 100%);
  color: white;
  padding: 50px 0;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 40px;
}

.hero-content h1 {
  font-size: 38px;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero-content p {
  font-size: 16px;
  color: #cbd5e1;
  margin-bottom: 24px;
  max-width: 540px;
}

.hero-badge {
  display: inline-block;
  background: rgba(0, 210, 255, 0.15);
  color: #00d2ff;
  border: 1px solid rgba(0, 210, 255, 0.4);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

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

.btn-hero-primary {
  background: var(--secondary);
  color: var(--dark);
  font-weight: 800;
  padding: 13px 26px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

.btn-hero-primary:hover {
  background: #4ae1ff;
  transform: translateY(-2px);
}

.btn-hero-secondary {
  background: rgba(255,255,255,0.12);
  color: white;
  font-weight: 700;
  padding: 13px 24px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.25);
}

.btn-hero-secondary:hover {
  background: rgba(255,255,255,0.2);
}

.hero-image-wrap {
  position: relative;
  text-align: center;
}

.hero-image-wrap img {
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  max-height: 380px;
  width: 100%;
  object-fit: cover;
}

/* BENEFICIOS */
.benefits-section {
  padding: 24px 0;
  background: white;
  border-bottom: 1px solid var(--border);
}

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

.benefit-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
}

.benefit-icon {
  width: 44px;
  height: 44px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.benefit-title {
  font-weight: 800;
  font-size: 14px;
  color: var(--text-main);
}

.benefit-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* SECCIONES Y TITULOS */
.section-padding {
  padding: 50px 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 12px;
}

.section-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--dark);
  letter-spacing: -0.5px;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.view-all-link {
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
}

.view-all-link:hover {
  text-decoration: underline;
}

/* PRODUCT CARD GRID: 2 COLUMNAS ESTRICTAS EN MÓVIL (<640px) Y 6 EN DESKTOP (>=1280px) */
.products-grid,
.products-catalog-grid,
.mobile-grid-2 {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.products-grid > *,
.products-catalog-grid > *,
.mobile-grid-2 > * {
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

@media (min-width: 640px) {
  .products-grid,
  .products-catalog-grid,
  .mobile-grid-2 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }
}

@media (min-width: 768px) {
  .products-grid,
  .products-catalog-grid,
  .mobile-grid-2 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }
}

@media (min-width: 1024px) {
  .products-grid,
  .products-catalog-grid,
  .mobile-grid-2 {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }
}

@media (min-width: 1280px) {
  .products-grid,
  .products-catalog-grid,
  .mobile-grid-2 {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.product-badge-original {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #0d0434;
  color: #00d2ff;
  font-size: 10px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  z-index: 2;
  text-transform: uppercase;
}

.product-badge-discount {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  z-index: 2;
}

.product-thumb {
  height: 200px;
  background: #fdfdfd;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  overflow: hidden;
}

.product-thumb img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.product-card:hover .product-thumb img {
  transform: scale(1.05);
}

.product-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.product-sku {
  font-family: monospace;
  color: #475569;
}

.product-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 40px;
}

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

.product-compat {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-price-box {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.price-current {
  font-size: 20px;
  font-weight: 900;
  color: var(--dark);
}

.price-old {
  font-size: 13px;
  color: #94a3b8;
  text-decoration: line-through;
}

.stock-indicator {
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 12px;
}

.stock-in {
  color: var(--success);
}

.stock-out {
  color: var(--danger);
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-add-cart {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.btn-add-cart:hover {
  background: var(--primary-hover);
}

.btn-quote-wa {
  background: #25d366;
  color: white;
  border: none;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-quote-wa:hover {
  background: #1eb956;
}

/* SHOPPING CART PAGE */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 30px;
  margin: 30px 0;
}

.cart-table {
  width: 100%;
  background: white;
  border-radius: var(--radius-md);
  border-collapse: collapse;
  border: 1px solid var(--border);
  overflow: hidden;
}

.cart-table th {
  background: #f8fafc;
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.cart-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.cart-item-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cart-item-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  padding: 4px;
}

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

.qty-btn {
  background: #f8fafc;
  border: none;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-weight: bold;
}

.qty-input {
  width: 40px;
  text-align: center;
  border: none;
  font-weight: bold;
  font-size: 13px;
}

.cart-summary-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 90px;
}

.cart-summary-title {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
}

.summary-total {
  font-size: 20px;
  font-weight: 900;
  color: var(--primary);
  border-top: 2px dashed var(--border);
  padding-top: 14px;
  margin-top: 14px;
}

/* CHECKOUT FORM */
.checkout-form {
  background: white;
  padding: 30px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(54, 13, 202, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* FOOTER */
.footer-main {
  background: var(--dark);
  color: #cbd5e1;
  margin-top: auto;
  border-top: 4px solid var(--primary);
  padding: 50px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: white;
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 18px;
  position: relative;
  padding-bottom: 8px;
}

.footer-col h4::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--secondary);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a:hover {
  color: var(--secondary);
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #94a3b8;
  flex-wrap: wrap;
  gap: 10px;
}

/* TOAST NOTIFICATION */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #0d0434;
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid var(--secondary);
  animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* RESPONSIVO */
@media (max-width: 992px) {
  .hero-grid { grid-template-columns: 1fr; }
  .benefits-grid { grid-template-columns: repeat(2, 1fr); }
  .cart-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; }
  .header-search { order: 3; max-width: 100%; margin-top: 10px; }
  .benefits-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-content h1 { font-size: 28px; }
  .form-row { grid-template-columns: 1fr; }
}
