/* ==========================================================================
   AVM INSUMOS INDUSTRIALES - PRODUCT CATALOG & DESIGN SYSTEM
   ========================================================================== */

:root {
  /* Color Palette - AVM Institutional Red & Soft Pastel Backgrounds */
  --primary-rgb: 15, 23, 42;
  --primary: #0f172a;
  --primary-light: #1e293b;
  
  --accent-red: #cc1c1c;
  --accent-red-hover: #b91c1c;
  --accent-red-light: #fef2f2;
  --accent-red-border: #fecdd3;
  --accent-red-dark: #881337;
  
  --accent-blue: #cc1c1c; /* Main brand accent */
  --accent-blue-hover: #b91c1c;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --whatsapp-green: #25d366;
  
  /* Canvas Background - Soft Pastel Red Tint */
  --bg-main: #faf0f0; 
  --surface-card: #ffffff;
  --surface-secondary: #fce7e7;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #f3d0d0;
  
  /* Shadows & Glassmorphism */
  --shadow-sm: 0 1px 3px rgba(204, 28, 28, 0.05);
  --shadow-md: 0 4px 14px -2px rgba(204, 28, 28, 0.1);
  --shadow-lg: 0 14px 28px -4px rgba(204, 28, 28, 0.18);
  --glass-bg: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(204, 28, 28, 0.2);
  
  /* Transitions & Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand-name {
  font-family: 'Outfit', sans-serif;
}

/* Header Styles */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--border-color);
}

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

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.brand-logo-container {
  height: 85px;
  width: auto;
  min-width: 100px;
  background: #ffffff;
  border-radius: 18px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(204, 28, 28, 0.35);
  border: 2px solid var(--accent-red-border);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.brand-logo-container:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 26px rgba(204, 28, 28, 0.45);
}

.brand-logo-img {
  height: 100%;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--accent-red);
  line-height: 1;
}

.brand-tagline {
  font-size: 0.85rem;
  font-weight: 700;
  color: #991b1b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

/* Hero Brand Badge */
.hero-brand-badge {
  width: 96px;
  height: 96px;
  background: #ffffff;
  border-radius: 22px;
  padding: 8px;
  margin: 0 auto 1.35rem;
  box-shadow: 0 10px 30px rgba(204, 28, 28, 0.45);
  border: 3px solid #fecdd3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.hero-brand-badge:hover {
  transform: scale(1.08) rotate(-2deg);
}

.hero-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-red) 0%, #a81515 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(204, 28, 28, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #881337 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(204, 28, 28, 0.4);
}

.btn-secondary {
  background: var(--surface-card);
  color: var(--accent-red-dark);
  border: 1px solid var(--accent-red-border);
}

.btn-secondary:hover {
  background: var(--accent-red-light);
  border-color: var(--accent-red);
}

.btn-whatsapp {
  background: var(--whatsapp-green);
  color: #ffffff;
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
}

.btn-whatsapp:hover {
  background: #20ba5a;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.badge {
  background: var(--accent-gold);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

/* Hero Section - Deep Red & Slate Gradient */
.hero-section {
  position: relative;
  background: linear-gradient(135deg, #2a080b 0%, #1e293b 100%);
  color: #ffffff;
  padding: 3.5rem 1.5rem 4.5rem;
  text-align: center;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at top right, rgba(204, 28, 28, 0.45), transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: #fca5a5;
  margin-bottom: 2rem;
  font-weight: 400;
}

/* Search Box */
.search-box-wrapper {
  max-width: 650px;
  margin: 0 auto;
}

.search-input-group {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 0.4rem 0.75rem;
  box-shadow: 0 10px 25px -5px rgba(204, 28, 28, 0.25);
  border: 2px solid var(--accent-red-border);
}

.search-icon {
  font-size: 1.2rem;
  color: var(--accent-red);
  margin-left: 0.5rem;
}

#searchInput {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  color: var(--text-main);
  background: transparent;
}

.btn-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* Main Container */
.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Categories Bar */
.categories-bar {
  margin-top: -3.5rem;
  margin-bottom: 2rem;
  position: relative;
  z-index: 10;
}

.categories-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.6rem;
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--accent-red-border);
  box-shadow: var(--shadow-md);
  scrollbar-width: thin;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-red-border);
  background: var(--accent-red-light);
  color: #881337;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.category-btn:hover {
  background: #ffe4e6;
  color: var(--accent-red);
}

.category-btn.active {
  background: linear-gradient(135deg, var(--accent-red) 0%, #991b1b 100%);
  color: #ffffff;
  border-color: var(--accent-red);
  box-shadow: 0 4px 14px rgba(204, 28, 28, 0.35);
}

/* Catalog Info Bar */
.catalog-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-select {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--surface-card);
  color: var(--text-main);
  font-weight: 500;
  outline: none;
}

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

/* Product Card - Red Top Accent */
.product-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--accent-red);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: #fca5a5;
}

.product-img-wrapper {
  position: relative;
  height: 220px;
  background: linear-gradient(135deg, #2a080b 0%, #0f172a 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.category-tag {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(204, 28, 28, 0.95);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

.product-id-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-red);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.product-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.product-specs {
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex: 1;
}

.product-specs li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.product-specs i {
  color: var(--accent-green);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-color);
  gap: 0.5rem;
}

.price-consult-tag {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-red-dark);
  background: var(--accent-red-light);
  border: 1px solid var(--accent-red-border);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-add-quote {
  background: var(--accent-red-light);
  color: var(--accent-red-dark);
  border: 1px solid var(--accent-red-border);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-add-quote:hover {
  background: var(--accent-red);
  color: #ffffff;
  border-color: var(--accent-red);
  box-shadow: 0 3px 10px rgba(204, 28, 28, 0.3);
}

.btn-add-quote.added {
  background: var(--accent-green);
  color: #ffffff;
  border-color: var(--accent-green);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border: 2px solid var(--accent-red-border);
  box-shadow: 0 20px 40px rgba(204, 28, 28, 0.2);
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--surface-secondary);
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--accent-red);
  color: #ffffff;
}

.modal-body {
  padding: 2rem;
}

/* Quote Modal */
.quote-modal-card {
  max-width: 600px;
  padding: 2rem;
}

.quote-header h2 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.quote-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.quote-items-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-top: 1rem;
  background: #fffafa;
}

.quote-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-color);
  gap: 0.75rem;
}

.quote-item-row:last-child {
  border-bottom: none;
}

.quote-item-info {
  flex: 1;
}

.quote-item-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-input-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid var(--accent-red-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-card);
}

.btn-qty {
  background: var(--surface-secondary);
  border: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition);
}

.btn-qty:hover {
  background: #fca5a5;
  color: var(--accent-red-dark);
}

.input-qty {
  width: 45px;
  text-align: center;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
  padding: 0.2rem 0;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

textarea::placeholder, 
input::placeholder {
  font-style: italic;
  color: #94a3b8;
  opacity: 0.9;
}

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

/* Footer - Dark Red / Deep Slate Gradient */
.site-footer {
  background: linear-gradient(135deg, #24070a 0%, #0f172a 100%);
  color: #fca5a5;
  padding: 3rem 1.5rem 1.5rem;
  border-top: 3px solid var(--accent-red);
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  display: block;
  margin-bottom: 0.5rem;
}

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(204, 28, 28, 0.3);
  text-align: center;
  font-size: 0.85rem;
  color: #94a3b8;
}

.print-header {
  display: none;
}

/* ==========================================================================
   PRINT STYLES FOR CLEAN PDF EXPORT
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .site-header,
  .hero-section,
  .categories-bar,
  .catalog-info-bar,
  .modal-backdrop,
  .site-footer,
  .btn-add-quote,
  .price-consult-tag {
    display: none !important;
  }

  .print-header {
    display: block;
    text-align: center;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #cc1c1c;
  }

  .print-logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
  }

  .print-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
  }

  .print-header h1 {
    font-size: 1.6rem;
    color: #cc1c1c;
    margin: 0;
  }

  .print-header p {
    font-size: 0.9rem;
    color: #64748b;
  }

  .main-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
    page-break-inside: auto;
  }

  .product-card {
    break-inside: avoid;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
  }

  .product-img-wrapper {
    height: 140px !important;
  }
}
