/* ===============================
   IRBIS SUPPLIES - ESTILO UNIFICADO
   =============================== */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: 'Teko', sans-serif;
  letter-spacing: 1px;
  color: #d6c6a5;
  background-color: #000;
}

/* ===============================
   NAVBAR
   =============================== */

.navbar {
  width: 100%;
  padding: 20px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-badge {
  font-size: 18px;
  opacity: 0.9;
  padding-left: 6px;
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 25px;
  align-items: center;
  margin: 0;
  padding: 0;
}


.btn-primary,
.btn-secondary {
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 700;
   display: inline-block;
  text-decoration: none;
  cursor: pointer;
  font-family: 'Teko', sans-serif;
  letter-spacing: 1.5px;
  transition: 0.3s;
}

.btn-primary {
  background: #c2a34a;
  color: #000;
  border: none;
}

.btn-primary:hover {
  background: #d4af37;
}

.btn-secondary {
  background: #1e1e1e;
  color: #fff;
  border: 1px solid #c2a34a;
}

.btn-secondary:hover {
  background: #c2a34a;
  color: #000;
}

.btn-detalles {
  background: transparent;
  color: #c2a34a;
  border: 1px solid #c2a34a;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
  transition: 0.3s;
}

.btn-detalles:hover {
  background: #c2a34a;
  color: #000;
}

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===============================
   LOGO
   =============================== */

.logo img {
  height: clamp(90px, 10vw, 140px);
  width: auto;
  transition: transform 0.3s ease;
}

.logo img:hover {
  transform: scale(1.05);
}

/* ===============================
   HERO
   =============================== */

.hero {
  height: 100vh;
  width: 100%;
  background-image: url('./images/background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  position: relative; /* IMPORTANTE */
}

/* Overlay oscuro */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 1;
  pointer-events: none; /* 🔥 ESTO ARREGLA LOS BOTONES */
}

/* Contenido interno */
.hero-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 2;
}

/* ===============================
   SWIPER
   =============================== */

.swiper {
  width: 100%;
  max-width: 900px;
  position: relative;
  padding-bottom: 60px;
}

.swiper-slide {
  font-size: 36px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  min-height: 180px;
}

.swiper-pagination {
  bottom: 0 !important;
  display: none !important;
}

/* ===============================
   SECCIONES
   =============================== */

.productos {
  background: transparent;
  padding: 80px 5%;
}

.carrito {
  background: #0d0d0d;
   min-height: 400px;
  padding: 80px 5%;
  border-top: 1px solid #222;
}

.productos h2,
.carrito h2 {
  text-align: center;
  font-size: 48px;
  margin-bottom: 40px;
  color: #c2a34a;
}

/* ===============================
   GRID - MOBILE FIRST
   =============================== */

.grid-productos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
}

.contenedorDeCard {
  background: #111;
  border: 1px solid #2a2a2a;
  padding: 20px;
  text-align: center;
  transition: 0.3s;
}

.contenedorDeCard:hover {
  transform: translateY(-5px);
  border-color: #c2a34a;
}

.contenedorDeCard img {
  width: 100%;
  height: 220px;
  object-fit: contain;
}

.contenedorDeCard h3 {
  font-size: 22px;
  margin: 15px 0 5px;
  color: #c2a34a;
}

.contenedorDeCard p {
  font-size: 18px;
  margin: 10px 0;
}

.detalles-container {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #2a2a2a;
}

.colores-container {
  margin-top: 10px;
}

.color-swatch {
  transition: 0.2s ease;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-activo {
  outline: 3px solid #c2a34a;
  transform: scale(1.2);
}

.descripcion-producto {
  font-size: 16px;
  line-height: 1.4;
  color: #cfcfcf;
}

/* ===============================
   CARRITO
   =============================== */

/* Drawer */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 99;
}

.cart-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
   font-size: 15px;
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(680px, 95vw);
  background: #0d0d0d;
  border-left: 1px solid #222;
  transform: translateX(105%);
  transition: transform 0.25s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.cart-drawer.is-open {
  transform: translateX(0);
}

.cart-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px 10px;
  border-bottom: 1px solid #222;
}

.cart-drawer__header h3 {
  margin: 0;
  color: #c2a34a;
  font-size: 24px;
}

.cart-drawer__body {
  padding: 16px 20px 16px 16px;
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0; /* CLAVE: habilita scroll en hijos flex */
}

.carrito-wrapper {
  display: flex;
  gap: 10px;
  height: 100%;
  width: 100%;
  flex: 1;
  min-height: 0; /* CLAVE: el wrapper puede “encogerse” y dejar scrollear */
}

.cart-items-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  min-height: 0; /* CLAVE: scroll correcto dentro de flex */
}

#carritoContainer {
  flex: 2;
}

.carrito-sidebar {
  flex: 1;
  background: #111;
  padding: 14px;       /* un toque más compacto */
  border: 1px solid #333;
  font-size: 13px;     /* baja real de densidad */
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;       /* CLAVE */
}

.item-carrito {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a1a;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #333;
  gap: 10px;
  font-size: 16px;
  max-width: 95%;
}

.item-carrito__thumb {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border: 1px solid #2a2a2a;
  background: #111;
  flex: 0 0 auto;
}

.item-carrito__info {
  flex: 1;
  min-width: 0;
}

.item-carrito__info h4 {
  font-size: 14px;
  margin: 0 0 4px 0;
  color: #c2a34a;
}

.item-carrito__info p {
  font-size: 13px;
  margin: 2px 0;
  opacity: 0.95;
}

.item-carrito:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.4);
  transition: 0.2s;
}

.carrito-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

#btnCheckout {
  padding: 15px 27px;
}

.invoice-box {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ===============================
   MEDIOS DE PAGO
   =============================== */

.payment-method {
  margin-top: 12px;
}

.card-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.hidden {
  display: none;
}

.qr-section {
  margin-top: 12px;
  text-align: center;
}

/* ===============================
   FOOTER
   =============================== */

footer {
  background: #000;
  text-align: center;
  padding: 20px;
  font-size: 14px;
  color: #999;
}

.carrito-footer {
  max-width: 700px;
  margin: 30px auto 0;
  padding-top: 20px;
  border-top: 1px solid #333;

  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.carrito-footer p {
  font-size: 20px;
  margin-bottom: 15px;
}

#totalCarrito {
  font-size: 24px;
  font-weight: 700;
  color: #c2a34a;
}

/* ===============================
   RESPONSIVE
   =============================== */

/* ===============================
   MOBILE (hasta 767px)
   =============================== */

@media (max-width: 767px) {

  html, body {
    overflow-x: hidden;
  }

  body {
    font-size: 16px;
    line-height: 1.4;
  }

  /* ===============================
     GRID PRODUCTOS
     =============================== */

  .grid-productos {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 16px;
  }

  .contenedorDeCard {
    padding: 18px;
    border-radius: 16px;
  }

  .contenedorDeCard img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
  }

  .precio-producto {
    font-size: 20px;
    font-weight: 600;
    margin: 12px 0;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    border-radius: 10px;
  }

  /* ===============================
     DRAWER CORREGIDO
     =============================== */

  .cartDrawer {
    width: 100%;
    height: 100dvh; /* mejor que 100vh en mobile moderno */
    max-width: 100%;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
  }

  /* Header limpio y alineado */
  .cartDrawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #2a2a33;
  }

  .cartDrawer-header h2 {
    font-size: 20px;
    margin: 0;
  }

#btnCloseCart {
  padding: 0 !important;
  display: flex !important;
  font-family: inherit !important;
  letter-spacing: normal !important;

  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #c2a34a;
  background: transparent;

  color: #c2a34a;
  font-size: 20px;
  font-weight: 600;

  align-items: center;
  justify-content: center;

  cursor: pointer;
  transition: all 0.2s ease;
}

#btnCloseCart:hover {
  background: #c2a34a;
  color: #111;
}

#btnCloseCart:active {
  transform: scale(0.9);
}

  /* ===============================
     CONTENIDO CARRITO
     =============================== */

  .carrito-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
  }

  .cart-items-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 16px;
  }

  .carrito-sidebar {
    border-top: 1px solid #2a2a33;
    padding-top: 16px;
    margin-top: 16px;
  }

  .item-carrito {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #2a2a33;
  }

  .item-carrito__acciones {
    display: flex;
    gap: 12px;
  }

  .item-carrito__acciones button {
    flex: 1;
    padding: 12px;
  }

  /* Inputs más cómodos */
  input,
  select,
  textarea {
    font-size: 16px;
    padding: 12px;
  }

  .swiper-slide {
    font-size: 15px;
    padding: 8px 0;
  }
}

/* ===============================
   TABLET (>= 768px)
   =============================== */

@media (min-width: 768px) {

  .grid-productos {
    grid-template-columns: repeat(2, 1fr);
  }

  .swiper-slide {
    font-size: 22px;
  }
}

/* ===============================
   DESKTOP (>= 1024px)
   =============================== */

@media (min-width: 1024px) {

  .carrito-wrapper {
    flex-direction: row;
    align-items: stretch;
  }

  .cart-items-scroll {
    flex: 0 0 58%;
    overflow-y: auto;
    min-height: 0;
  }

  .carrito-sidebar {
    flex: 0 0 42%;
    overflow-y: auto;
    min-height: 0;
  }
}

/* ===============================
   LARGE DESKTOP (>= 1280px)
   =============================== */

@media (min-width: 1280px) {
  .grid-productos {
    grid-template-columns: repeat(5, 1fr);
  }
}
