/* ==========================================================================
   BULÓN & TUERCA S.A.S. — Sistema de Diseño Ferretería Industrial & Herramientas
   Identidad: Acero al Carbono, Amarillo Seguridad Vial, Precisión y Robustez
   ========================================================================== */

:root {
  --color-steel-950: #0F172A;
  --color-steel-900: #1E293B;
  --color-steel-800: #334155;
  --color-steel-700: #475569;
  --color-steel-200: #E2E8F0;
  --color-steel-100: #F1F5F9;
  --color-steel-50: #F8FAFC;
  
  --color-yellow-600: #D97706;
  --color-yellow-500: #F59E0B;
  --color-yellow-400: #FBBF24;
  --color-yellow-100: #FEF3C7;
  
  --color-surface: #FFFFFF;
  --color-border: #CBD5E1;
  --color-border-dark: #334155;
  
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.18);
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--color-steel-50);
  color: var(--color-steel-950);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-steel-950);
  letter-spacing: -0.02em;
}

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

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

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

.container {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Barra Superior */
.top-bar {
  background-color: var(--color-steel-950);
  color: #CBD5E1;
  font-size: 0.76rem;
  padding: 8px 16px;
  text-align: center;
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--color-yellow-500);
}
.top-bar strong {
  color: #FFFFFF;
}
.top-bar span {
  display: inline-block;
  margin: 0 8px;
  opacity: 0.5;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-xs);
  background-color: var(--color-steel-950);
  color: var(--color-yellow-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
  border: 2px solid var(--color-yellow-500);
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-steel-950);
  line-height: 1;
}
.brand-sub {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-yellow-600);
  margin-top: 3px;
}

.main-nav {
  display: none;
}
@media (min-width: 992px) {
  .main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
  }
}
.nav-link {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--color-steel-800);
  padding: 6px 0;
  position: relative;
}
.nav-link:hover, .nav-link.active {
  color: var(--color-yellow-600);
}
.nav-link.active::after, .nav-link:hover::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-yellow-500);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-steel-950);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}
.btn-icon:hover {
  background-color: var(--color-steel-100);
  border-color: var(--color-steel-700);
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--color-yellow-500);
  color: var(--color-steel-950);
  font-size: 0.68rem;
  font-weight: 800;
  width: 19px;
  height: 19px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFF;
}

.btn-menu-toggle {
  display: flex;
}
@media (min-width: 992px) {
  .btn-menu-toggle {
    display: none;
  }
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-xs);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-align: center;
}

.btn-yellow {
  background-color: var(--color-yellow-500);
  color: var(--color-steel-950);
}
.btn-yellow:hover {
  background-color: var(--color-yellow-400);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.btn-steel {
  background-color: var(--color-steel-950);
  color: #FFFFFF;
}
.btn-steel:hover {
  background-color: var(--color-steel-900);
  transform: translateY(-2px);
}

.btn-outline-steel {
  background: transparent;
  border: 1.5px solid var(--color-steel-950);
  color: var(--color-steel-950);
}
.btn-outline-steel:hover {
  background-color: var(--color-steel-950);
  color: #FFFFFF;
}

.btn-outline-light {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-steel-800);
}
.btn-outline-light:hover {
  background-color: var(--color-steel-100);
  border-color: var(--color-steel-700);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.8rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-yellow {
  background-color: var(--color-yellow-100);
  color: var(--color-yellow-600);
  border: 1px solid #FCD34D;
}
.badge-steel {
  background-color: var(--color-steel-900);
  color: #FFFFFF;
  border: 1px solid var(--color-steel-700);
}

/* Secciones */
.section {
  padding: 64px 0;
}
.section-sm {
  padding: 40px 0;
}
.section-steel {
  background-color: var(--color-steel-950);
  color: #F8FAFC;
}
.section-steel h1, .section-steel h2, .section-steel h3 {
  color: #FFFFFF;
}
.section-light {
  background-color: var(--color-steel-100);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 44px;
}
.section-header h2 {
  font-size: 2.1rem;
  margin-top: 10px;
  margin-bottom: 12px;
}
.section-header p {
  color: var(--color-steel-700);
  font-size: 0.98rem;
}
.section-steel .section-header p {
  color: #94A3B8;
}

/* Grilla Productos */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-yellow-500);
}

.product-image-wrap {
  position: relative;
  padding-top: 75%;
  background-color: var(--color-steel-100);
  overflow: hidden;
}
.product-image-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.product-card:hover .product-image-wrap img {
  transform: scale(1.04);
}

.product-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-yellow-600);
  margin-bottom: 6px;
}

.product-title {
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--color-steel-950);
}
.product-title a:hover {
  color: var(--color-yellow-600);
}

.product-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}
.product-price {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--color-steel-950);
}

/* Drawer Carrito */
.cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.cart-drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background-color: var(--color-surface);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.25);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.cart-drawer.active {
  transform: translateX(0);
}

.cart-drawer-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-steel-950);
  color: #FFF;
}
.cart-drawer-header h3 {
  font-size: 1.15rem;
  color: #FFF;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-free-shipping-bar {
  background-color: var(--color-steel-100);
  padding: 10px 22px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.78rem;
}
.shipping-progress-bg {
  width: 100%;
  height: 6px;
  background-color: #CBD5E1;
  border-radius: 9999px;
  margin-top: 6px;
  overflow: hidden;
}
.shipping-progress-fill {
  height: 100%;
  background-color: var(--color-yellow-500);
  border-radius: 9999px;
  transition: width 0.35s ease;
}

.cart-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cart-item {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 14px;
}
.cart-item-img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  border: 1px solid var(--color-border);
  background: var(--color-steel-100);
  flex-shrink: 0;
}
.cart-item-info {
  flex: 1;
}
.cart-item-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--color-steel-950);
  line-height: 1.3;
}
.cart-item-variant {
  font-size: 0.72rem;
  color: var(--color-steel-700);
  margin-top: 2px;
}
.cart-item-price {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--color-steel-950);
  margin-top: 4px;
}

.cart-drawer-footer {
  padding: 20px;
  border-top: 1px solid var(--color-border);
  background-color: var(--color-surface);
}
.cart-summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--color-steel-800);
  margin-bottom: 5px;
}
.cart-summary-line.total {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-steel-950);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border);
}

/* Modales */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 30px;
  position: relative;
  transform: scale(0.96);
  transition: transform 0.3s ease;
}
.modal-backdrop.active .modal-card {
  transform: scale(1);
}

.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-steel-950);
  margin-bottom: 5px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background-color: #FFFFFF;
  color: var(--color-steel-950);
  transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-yellow-500);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

/* Footer */
.site-footer {
  background-color: var(--color-steel-950);
  color: #94A3B8;
  padding-top: 60px;
  padding-bottom: 28px;
  margin-top: auto;
  border-top: 3px solid var(--color-yellow-500);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  margin-bottom: 44px;
}
@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
  }
}

.footer-col h4 {
  color: #FFFFFF;
  font-size: 1rem;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
}
.footer-links a:hover {
  color: var(--color-yellow-400);
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.78rem;
  color: #94A3B8;
}
@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
  }
}

/* Toasts & Cookie Banner */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background-color: var(--color-steel-950);
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  border-left: 4px solid var(--color-yellow-500);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  max-width: 420px;
  background-color: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  padding: 18px;
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  border: 1px solid var(--color-yellow-500);
  display: none;
}
.cookie-banner.show {
  display: block;
}

/* Acordeón FAQ */
.faq-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-item {
  background-color: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  overflow: hidden;
}
.faq-question {
  width: 100%;
  padding: 18px 22px;
  text-align: left;
  background: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-steel-950);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.faq-question:hover {
  background-color: var(--color-steel-50);
}
.faq-icon {
  transition: transform 0.25s ease;
}
.faq-item.active .faq-icon {
  transform: rotate(180deg);
}
.faq-answer {
  display: none;
  padding: 0 22px 18px 22px;
  font-size: 0.88rem;
  color: var(--color-steel-700);
  line-height: 1.6;
}
.faq-item.active .faq-answer {
  display: block;
}

/* Menú Móvil */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.mobile-nav-backdrop.active {
  opacity: 1;
  visibility: visible;
}
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 290px;
  background-color: #FFFFFF;
  z-index: 91;
  padding: 24px;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}
.mobile-nav-drawer.active {
  transform: translateX(0);
}
