/* ── Navbar: icono arriba + texto abajo (desktop) ────────────────────── */
@media (min-width: 992px) {
  .nav-icon-link {
    display:         inline-flex !important;
    flex-direction:  column;
    align-items:     center;
    justify-content: center;
    gap:             2px;
    line-height:     1;
    padding:         6px 10px !important;
    text-align:      center;
  }
  .nav-icon-link i    { font-size: 1.1rem; display: block; }
  .nav-icon-link span { font-size: 0.85rem; display: block; white-space: nowrap; font-weight: 500; }

  /* Flecha dropdown debajo del texto */
  .nav-icon-link.dropdown-toggle::after {
    display:       block;
    margin-top:    2px;
    border-top:    4px solid rgba(255,255,255,0.5);
    border-right:  4px solid transparent;
    border-left:   4px solid transparent;
    border-bottom: 0;
    vertical-align: unset;
  }
  /* Botones no necesitan flecha */
  a.btn.nav-icon-link::after,
  button.btn.nav-icon-link::after { display: none; }
}

/* ── Navbar móvil: icono a la izquierda, texto a la derecha ─────────── */
@media (max-width: 991.98px) {
  .nav-icon-link {
    display:         inline-flex !important;
    flex-direction:  row;
    align-items:     center;
    gap:             10px;
    padding:         10px 16px !important;
    width:           100%;
    text-align:      left;
  }
  .nav-icon-link i    { font-size: 1.15rem; min-width: 22px; text-align: center; }
  .nav-icon-link span { font-size: 0.92rem; font-weight: 500; }
  .nav-icon-link.dropdown-toggle::after { margin-left: auto; }
}

/* Color aplicado en ambos breakpoints */
.nav-icon-link {
  color:           rgba(255,255,255,0.85) !important;
  text-decoration: none !important;
}
.nav-icon-link:hover,
.nav-icon-link:focus { color: #fff !important; }

:root {
  --primary: #DC2626;
  --primary-dark: #991B1B;
  --accent: #EF4444;
  --bg: #0d0d0d;
  --surface: #1a1a1a;
  --surface-alt: #242424;
  --text: #f1f5f9;
  --muted: #9ca3af;
  --border: #2d2d2d;
  --border-red: rgba(220, 38, 38, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  background: linear-gradient(180deg, #0d0d0d 0%, #120505 100%);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
}

/* ── Navbar ── */
.custom-navbar {
  position: relative;
  z-index: 1050;
  background: rgba(10, 10, 10, 0.97);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-red);
  border: 1px solid var(--border);
}

.navbar-brand {
  color: var(--primary) !important;
  font-size: 1.15rem;
}

.navbar .nav-link {
  color: #d1d5db !important;
  border-radius: 10px;
  padding: 0.4rem 0.75rem !important;
  transition: all 0.2s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  background-color: rgba(220, 38, 38, 0.15);
  color: var(--accent) !important;
}

.navbar .dropdown-menu {
  z-index: 9999;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-top: 2px solid var(--primary);
}

.navbar .dropdown-item {
  color: #d1d5db;
}

.navbar .dropdown-item:hover {
  background: rgba(220, 38, 38, 0.12);
  color: var(--accent);
}

.navbar .dropdown-header {
  color: var(--muted) !important;
}

.navbar .dropdown-divider {
  border-color: var(--border);
}

.navbar-toggler {
  border-color: var(--primary);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%23DC2626' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* ── Hero image ── */
.hero-image-wrapper {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.5);
  margin-bottom: 1rem;
  border: 1px solid var(--border-red);
}

.hero-image-wrapper img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

/* ── Hero banner ── */
.hero-gradient-bg {
  grid-area: 1 / 1;
  width: 100%;
  min-height: 320px;
  background: linear-gradient(135deg, #0d0d0d 0%, #450a0a 50%, #7f1d1d 100%);
}

.hero-banner {
  background: linear-gradient(135deg, #0d0d0d 0%, #450a0a 55%, #991B1B 100%);
  border-radius: 18px;
  color: #fff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-red);
}

.hero-banner p {
  color: rgba(255, 255, 255, 0.85);
}

/* ── Delivery banner ── */
.delivery-wrapper {
  background: linear-gradient(135deg, #1a1a1a 0%, #111 100%);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 16px;
  padding: 0.65rem;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
  max-width: 980px;
  margin: 0 auto;
}

.delivery-banner {
  background: transparent;
  border-radius: 12px;
  color: var(--text);
  border: none;
  padding: 0.75rem 0.9rem;
}

.delivery-banner__content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  text-align: center;
}

.delivery-banner__content h2,
.delivery-banner__content p {
  color: var(--text);
}

.delivery-banner__discounts {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: center;
}

.discount-item {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 10px;
  padding: 0.4rem 0.55rem;
  min-width: 116px;
  text-align: center;
}

.discount-item span,
.discount-item small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.discount-item strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.1;
  color: var(--accent);
}

/* ── Promo cards ── */
.promo-grid .promo-card {
  border-radius: 14px;
  padding: 1rem;
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

.promo-card h5 {
  margin-bottom: 0.35rem;
}

.promo-card p {
  color: var(--muted);
  font-size: 0.92rem;
}

.promo-card strong {
  font-size: 0.95rem;
  color: var(--accent);
}

.promo-card--red {
  background: linear-gradient(160deg, #1a0505 0%, #2d0a0a 100%);
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--text);
}

.promo-card--orange {
  background: linear-gradient(160deg, #0f0f0f 0%, #1a1010 100%);
  border-color: rgba(153, 27, 27, 0.35);
  color: var(--text);
}

.promo-card--dark {
  background: linear-gradient(160deg, #111 0%, #1c1c1c 100%);
  border-color: rgba(156, 163, 175, 0.2);
  color: var(--text);
}

.promo-card--grey {
  background: linear-gradient(160deg, #111 0%, #1a1a1a 100%);
  border-color: rgba(156, 163, 175, 0.15);
  color: var(--text);
}

.promo-card .promo-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: var(--text);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(220, 38, 38, 0.2);
  border-color: var(--border-red);
}

.card .card-img-top {
  height: 180px;
  object-fit: cover;
}

.card-body {
  background: var(--surface);
}

h1, h2, h3, h4 {
  color: var(--text);
}

/* ── Botones ── */
.btn-success,
.btn-primary {
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  padding: 0.55rem 1rem;
}

.btn-success {
  background: var(--primary);
  color: #fff;
}

.btn-success:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn-warning {
  background: #DC2626;
  color: #fff;
  border: none;
  font-weight: 700;
}

.btn-warning:hover {
  background: #991B1B;
  color: #fff;
}

.btn-outline-secondary {
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  border-color: #4b5563;
  color: #d1d5db;
  background: transparent;
}

.btn-outline-secondary:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: var(--primary);
  color: var(--accent);
}

.btn-outline-danger {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline-danger:hover {
  background: var(--primary);
  color: #fff;
}

/* ── Formularios ── */
.card.shadow.p-3 {
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.4) !important;
  background: var(--surface);
}

form.form-control {
  border: none;
  padding: 0;
  background: transparent;
}

.form-control {
  border-radius: 12px;
  border: 1px solid #3d3d3d;
  padding: 0.65rem 0.8rem;
  background: #111;
  color: var(--text);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.2);
  background: #111;
  color: var(--text);
}

.form-control::placeholder {
  color: #6b7280;
}

.form-label {
  color: var(--text);
}

/* ── Select ── */
select.form-control,
select.form-select {
  background: #111;
  color: var(--text);
  border: 1px solid #3d3d3d;
}

/* ── Input group ── */
.input-group-text {
  background: #1a1a1a;
  border: 1px solid #3d3d3d;
  color: var(--muted);
}

/* ── Secciones ── */
section.my-5 {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.2rem;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}

/* ── Carrito banner ── */
#carritoBanner {
  background: rgba(220, 38, 38, 0.08) !important;
  border: 1px solid rgba(220, 38, 38, 0.3) !important;
  border-radius: 12px;
}

#carritoBanner .text-success {
  color: var(--accent) !important;
}

/* ── Footer ── */
.site-footer {
  background: #050505;
  color: #e5e7eb;
  margin-top: 2rem;
  border-top: 2px solid var(--primary);
}

.site-footer small {
  color: #9ca3af;
}

/* ── Producto cards ── */
.producto-card {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  background: var(--surface);
}

.producto-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 30px rgba(220, 38, 38, 0.22) !important;
}

.card-img-placeholder {
  height: 160px;
  border-radius: 12px 12px 0 0;
  background: #111;
}

.card-title {
  color: var(--text);
}

.card-text.text-primary {
  color: var(--accent) !important;
}

.card-text.text-muted {
  color: var(--muted) !important;
}

/* ── Modal overlay ── */
.producto-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.producto-modal-overlay.show {
  display: flex;
}

/* ── Modal container ── */
.producto-modal {
  position: relative;
  width: 100%;
  max-width: 680px;
  background: #1a1a1a;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border-red);
  max-height: 90vh;
  overflow-y: auto;
  color: var(--text);
}

.producto-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  z-index: 10;
}

.producto-modal-close:hover { color: var(--primary); }

/* ── Modal layout ── */
.modal-layout {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
}

.modal-img-col {
  flex: 0 0 160px;
}

.producto-modal-img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #111;
  padding: 0.5rem;
  cursor: zoom-in;
  transition: opacity 0.15s, box-shadow 0.15s;
}

.producto-modal-img:hover {
  opacity: 0.92;
  box-shadow: 0 0 0 2px var(--primary);
}

@keyframes zoomFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-img-placeholder {
  width: 200px;
  height: 200px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: var(--primary);
}

.modal-info-col {
  flex: 1;
  min-width: 0;
}

.modal-precio {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

/* ── Specs ── */
.specs-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.3rem;
}

.spec-badge {
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: var(--accent);
  border-radius: 20px;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
}

/* ── Recomendado para ── */
.modal-recomendado {
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
}

.recomendado-label {
  font-size: 0.82rem;
  color: var(--muted);
}

#modalFeedback {
  font-size: 0.85rem;
  color: var(--accent);
}

.categoria-search-form .input-group-text {
  border-radius: 12px 0 0 12px;
}

.categoria-search-form .form-control {
  border-radius: 0;
}

.categoria-search-form .btn {
  border-radius: 0 12px 12px 0;
}

/* ── Overrides Bootstrap en tema oscuro ── */
.bg-light {
  background-color: var(--surface-alt) !important;
}

.bg-white,
.bg-body {
  background-color: var(--surface) !important;
}

.text-dark,
.text-body {
  color: var(--text) !important;
}

.text-muted {
  color: var(--muted) !important;
}

.text-secondary {
  color: #9ca3af !important;
}

.text-primary {
  color: var(--accent) !important;
}

.border,
.border-top,
.border-bottom {
  border-color: var(--border) !important;
}

.table {
  color: var(--text);
  border-color: var(--border);
}

.table > :not(caption) > * > * {
  background-color: transparent;
  color: var(--text);
  border-color: var(--border);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255, 255, 255, 0.03);
}

.alert-success {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
  color: var(--accent);
}

.alert-info {
  background: rgba(30, 30, 30, 0.9);
  border-color: var(--border);
  color: var(--text);
}

.alert-warning {
  background: rgba(30, 20, 10, 0.9);
  border-color: #6b4a0a;
  color: #fbbf24;
}

.alert-danger {
  background: rgba(50, 10, 10, 0.9);
  border-color: rgba(220, 38, 38, 0.4);
  color: var(--accent);
}

.btn-close {
  filter: invert(1);
}

/* ── Tablas admin ── */
.thead-dark th,
.table-dark th {
  background: var(--primary-dark);
  color: #fff;
}

/* ── Responsive modal ── */
@media (max-width: 600px) {
  .modal-layout {
    flex-direction: column;
    align-items: center;
  }
  .modal-img-col {
    flex: none;
  }
}

/* ===========================
   COTIZACIÓN / DOCUMENT STYLES
   =========================== */

.cotizacion-doc {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 2rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  max-width: 860px;
  margin: 0 auto;
  color: #1f2937;
}

.cotizacion-doc h1,
.cotizacion-doc h2,
.cotizacion-doc h3,
.cotizacion-doc h4,
.cotizacion-doc h5,
.cotizacion-doc h6 {
  color: #1f2937;
}

.cotizacion-doc p,
.cotizacion-doc td,
.cotizacion-doc th {
  color: #374151;
}

.cot-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.cot-header__left {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.cot-logo {
  height: 64px;
  object-fit: contain;
}

.cot-empresa-info p {
  margin: 0;
  font-size: 0.84rem;
  color: #374151;
  line-height: 1.5;
}

.cot-doc-badge {
  text-align: center;
  border: 2px solid #DC2626;
  border-radius: 10px;
  padding: 0.6rem 1.2rem;
  min-width: 150px;
}

.cot-doc-tipo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #DC2626;
  letter-spacing: 1px;
}

.cot-doc-numero {
  font-size: 1.5rem;
  font-weight: 800;
  color: #111827;
}

.cot-doc-fecha {
  font-size: 0.85rem;
  color: #6b7280;
}

.cot-divider {
  border-color: #e5e7eb;
  margin: 1.2rem 0;
}

.cot-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #DC2626;
  text-transform: uppercase;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.3rem;
  margin-bottom: 0.6rem;
}

.cot-tabla {
  border-collapse: collapse;
  font-size: 0.9rem;
}

.cot-tabla thead tr {
  background: #DC2626;
  color: #fff;
}

.cot-tabla thead th {
  padding: 0.55rem 0.75rem;
  font-weight: 600;
}

.cot-tabla tbody tr {
  border-bottom: 1px solid #e5e7eb;
}

.cot-tabla tbody td {
  padding: 0.5rem 0.75rem;
  color: #374151;
}

.cot-tabla tbody tr:nth-child(even) {
  background: #fafafa;
}

.cot-totales {
  font-size: 0.92rem;
  border-collapse: collapse;
  color: #374151;
}

.cot-totales td {
  padding: 0.3rem 0.5rem;
}

.cot-total-row {
  background: #DC2626;
  color: #fff;
  border-radius: 6px;
}

.cot-total-row td {
  padding: 0.45rem 0.5rem;
  color: #fff;
}

.cot-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
}

.cot-box p { color: #374151; }

.cot-footer {
  background: #fff5f5;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #374151;
}

/* ===========================
   ESTILOS DE IMPRESIÓN / PDF
   =========================== */

@media print {
  .no-print,
  header,
  nav,
  .site-footer,
  .hero-image-wrapper {
    display: none !important;
  }

  body {
    background: white !important;
    font-size: 12px;
    color: #000 !important;
  }

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

  .cotizacion-doc {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .cot-tabla thead tr {
    background: #DC2626 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cot-total-row {
    background: #DC2626 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  a[href]:after { content: none !important; }
}

@media (max-width: 768px) {
  .hero-image-wrapper img {
    max-height: 240px;
  }

  .navbar .nav-link {
    margin-bottom: 0.25rem;
  }

  .delivery-banner__discounts {
    width: 100%;
  }

  .discount-item {
    flex: 1 1 100%;
  }
}
