/* ==== Reset y Layout General ==== */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    background-color: #fdfdfd;
    color: #333;
}

main {
    flex: 1;
    padding: 20px;
}

img {
    max-width: 100%;
}

/* ==== Header ==== */
header {
    background-color: rgba(237, 220, 203, 1);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0px 16px 0;
    margin: 0px;
    flex-wrap: wrap;
    position: fixed; 
    top: 0; 
    width: 100%;
    z-index: 100;
    border: 0px solid #33faff;
}

header .logo {
    display: flex;
    align-items: center;
}

header .logo img {
    height: 60px;
    margin: 8px 10px 12px 40px;
}

header nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

header nav ul li {
    margin: 0 10px;
}

header nav ul li a {
    color: rgb(255, 255, 255);
    font-weight: bold;
    padding: 5px 10px;
}

header nav ul li a:hover, header nav ul li a.activo {
    /*background-color: rgba(209, 206, 128, 0.614);*/
    background-color: rgba(209, 206, 128, 1);
    border-radius: 5px;
}

.header-subtext {
  width: 100%;
  text-align: center;
  margin: -20px 0 -30px 0;
  padding: 3px 0 3px 0;
  display: block;
  position: relative;
  background-color: rgba(84, 50, 16, 1);
}

.header-subtext p {
  margin: 0;
  color: #ffffff;
  font-size: 0.8rem;
}

/* ==== Productos ==== */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    border: 0px solid #3c67ca;
    align-items: stretch; /* <-- fuerza que todas las tarjetas tengan misma altura */
    margin-top: -26px;  
    position: relative; 
    z-index: 0;
}

@media (min-width: 1200px) {
    .productos-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) and (min-width: 577px) {
    .productos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .productos-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Alineación uniforme de nombre / subtítulo / precio --- */
.producto {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  padding: 15px;
  overflow: hidden;
  position: relative;
  min-height: 420px;
  box-sizing: border-box;
  margin: 0;
  border: 0px solid #d00;
}

.contenedor-imagen-aviso {
  position: relative;
  width: 100%;
  height: 195px; /* 🔹 altura uniforme del recuadro */
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  border: 0px solid #186e53;
  background-color: #fff;
  box-sizing: border-box;
  overflow: hidden;
  font-size: 0;
  line-height: 0;
}

.contenedor-imagen-aviso img {
  margin: 0 auto;            /* asegura centrado horizontal */
  border-radius: 10px;
  height: auto;
  border: 0px solid #0000ff;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* 🔹 mantiene proporciones */
  display: block;
  z-index: 0;
}


/* Contenedor de estrellas + burbuja */
.promo-contenedor {
  --star-size: 75px;
  position: absolute;
  top: 15%;
  right: 70px; /* ahora más cerca del borde */
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 0;
  border: 0px solid #ffff00;
  pointer-events: none;
}

/* Estrellas (sin brillo ni sombra) */
.promo-estrellas {
  width: var(--star-size);
  height: auto;
  display: block;
  filter: none;
  border: 0px solid #aaffc6;
  pointer-events: none;
}

/* Burbuja del aviso */
.promo-burbuja {
  position: relative;
  top: calc(var(--star-size) * -0.33); /* solo 1/3 hacia abajo */
  right: -70px;
  background: rgba(255, 255, 255, 0.03); /* casi invisible */
  border: 1px solid rgba(24, 110, 83, 0.85);
  border-radius: 14px;
  padding: 8px 12px;
  min-width: 60px;
  max-width: 90px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(24, 110, 83, 0.95);
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.15;
  text-align: center;
  box-shadow: 0 0 10px rgba(24, 110, 83, 0.1);
  backdrop-filter: blur(4px);
}

/* Texto dentro de la burbuja */
.promo-burbuja span {
  display: block;
  word-wrap: break-word;
  white-space: normal;
}

.producto .info-texto {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  min-height: 58px;
  max-height: 58px;
  box-sizing: border-box;
  font-weight: bold;
  border: 0px solid #ffc600;
  width: 100%;
  padding: 0px;
  margin: 5px 0 0 0;
}

.info-texto h3.nombrepr {
  margin: 0;                  /* elimina margen superior/inferior del h3 */
  padding: 0;
  font-weight: 700;
  font-size: 1.1em;
  line-height: 1.1;
}

/* Ajuste de .etiqueta-pack para no romper la altura */
.etiqueta-pack {
  font-size: 1.1em; 
  font-weight: 700;
  background-color: rgba(131, 85, 74, 0.2);
  color: #3e7148;
  padding: 2px 10px;
  border-radius: 35px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  backdrop-filter: blur(3px);
  display: inline-block;
  letter-spacing: 0.5px;
  vertical-align: middle;
  line-height: 1;
  border: 0px solid #c63300;
}


/* Ajuste para pantallas pequeñas */
@media (max-width: 480px) {
  .promo-contenedor {
    --star-size: 58px;
    right: 70px;
  }
  .promo-burbuja {
    min-width: 95px;
    font-size: 0.82rem;
    top: -10px;
/*     top: calc(var(--star-size) * 0.35); */
  }
}

/* Ajustes para pantallas pequeñas (opcional) */
@media (max-width: 480px) {
  .producto .nombrepr {
    min-height: 64px;         /* si en móvil necesitas más altura por tamaño de fuente */
    max-height: 64px;
    padding-right: 70px;
  }

  .producto .nombrepr .etiqueta-pack {
    right: 0px;
    height: 20px;
    padding: 4px 4px 0px 4px;
    margin: 0px 4px 0px 4px;
    font-size: 0.95em;
  }
}


/* Bloque oerior (select + cantidad + botón) */
.producto .zona-inferior {
  margin-top: auto;          /* empuja este bloque hacia el fondo */
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  border: 0px solid;
}

.precio {
    font-size: 1.2em;
    color: #28a745;
    font-weight: bold;
}

.referencias {
    height: 36px;
    text-align: left;
    font-size: 1em;
}

.producto select, 
.producto input {
    margin: 5.8px 0;
    padding: 5.8px; 
    width: 100%;
}

.producto .cantidad {
    width: 50px;
    text-align: center;
}

.producto button {
    background-color: #3cb157;
    color: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 5px;
    margin-bottom: 0px;
    margin-top: -4px;
}

.producto button:hover {
    background-color: #218838;
}

/* ==== Carrito ==== */
#carrito-container {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    pointer-events: none;
}

.carrito-overlay {
    background-color: rgba(0,0,0,0.5);
    width: 10%;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.carrito-panel {
    background-color: white;
    width: 280px;
    max-width: 100%;
    padding: 12px;
    transform: translateX(100%);
    transition: transform 0.4s ease;
    overflow-y: auto;
    box-shadow: -2px -2px 12px rgba(0,0,0,0.2);
}

.carrito-panel input {
    width: 180px;
    max-width: 100%;
}

#carrito-container.activo {
    pointer-events: auto;
}

#carrito-container.activo .carrito-overlay {
    opacity: 1;
}

#carrito-container.activo .carrito-panel {
    transform: translateX(0);
}

.item-carrito {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    gap: 10px;
    border-bottom: 1px solid #ddd;
    padding: 5px 0;
}

.item-carrito .cantidad-item {
    width: 50px;
    text-align: center;
}

#cerrar-carrito {
    background: none;
    border: none;
    font-size: 2em;
    float: right;
    cursor: pointer;
}

.otros-text {
    font-size: 1.2em;
}


/* ==== Footer ==== */
footer {
    background-color: #e8f1e2;
    color: #106c25;
    text-align: center;
    padding: 10px;
    clear: both;
    position: fixed;
    bottom: 0;
    width: 100%;
}

footer .social a img {
    height: 24px;
    margin: 0 5px;
}


/* ==== Menú ==== */
.navbar-collapse ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 20px;
}

.navbar-collapse a {
  text-decoration: none;
  /*color: #204100;*/
  color: #543210;
  font-weight: bold;
  border-radius: 5px;
}

.navbar-toggler {
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  display: none;
}

@media (max-width: 768px) {
  .navbar-toggler {
    display: block;
    margin-right: 15px; /* separa un poco del borde derecho */
    color: rgba(84, 50, 16, 1);
    border: 1px solid;
  }

  .navbar-collapse {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 92px;
    /*right: 10px;*/       /* 👈 pegado al ícono hamburguesa */
    left: 10px;
    width: auto;       /* 👈 solo ocupa lo necesario */
    min-width: 180px;  /* 👈 ancho mínimo para que se vea ordenado */
    background-color: #eddccb; /* 👈 fondo verde consistente */
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    border: 2px solid #0c531d;
  }

  .navbar-collapse.show {
    display: flex;
  }

  .navbar-collapse ul {
    flex-direction: column;
    gap: 10px;
  }

  .navbar-collapse a {
    color: #543210; /* 👈 enlaces visibles sobre fondo verde */
    padding: 8px 12px;
    border-radius: 5px;
  }

  .navbar-collapse a:hover {
    background-color: rgba(255, 255, 255, 0.15);
  }
}


/* Estilo para el banner */
.banner-envios {
    margin-top: 70px; /* evita que quede debajo del header fijo */
    width: 100%;
    height: 280px;
    background: url("img/moto.jpg") center/cover no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-bottom: 4px solid #106c25;
}

.banner-envios h1 {
    background: rgba(16, 108, 37, 0.8);
    color: #fff;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 2.2rem;
    font-weight: bold;
    text-align: center;
}

@media (max-width: 768px) {
    .banner-envios {
    height: 180px;
    }
    .banner-envios h1 {
    font-size: 1.5rem;
    padding: 10px 20px;
    }
}

.link-envios {
    text-decoration: none;
    color: #106c25;
    font-weight: bold;
}

.link-envios:hover {
    background-color: rgba(209, 206, 128, 1);
    border-radius: 5px;
    padding: 2px 6px;
    color: #106c25;
}

.small-right {
    float: right;
    font-size: 0.85em;
    color: #555; /* opcional */
}

.subinfo {
    font-size: 0.55em;     /* letra más pequeña */
    margin-left: 2px;     /* espacio de separación */
    vertical-align: middle; /* que se vea parejo en la línea */
    color: #555;          /* opcional, gris más suave */
}

/* === MODAL DE DETALLE DE PRODUCTO === */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.65);
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.modal-contenido {
  background-color: #fff;
  border-radius: 14px;
  padding: 25px;
  max-width: 900px;
  width: 95%;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  animation: aparecer 0.25s ease;
}

@keyframes aparecer {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Botón cerrar (X) */
.cerrar {
  position: absolute;
  top: 10px;
  right: 18px;
  font-size: 26px;
  color: #444;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease;
}
.cerrar:hover { color: #d00; }

/* Contenedor general del contenido */
.modal-info {
  display: flex;
  flex-direction: row;
  gap: 25px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
}

/* Contenedor de imagen principal */
.modal-imagenes {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 420px;
  height: 420px;
  background-color: #f9f9f9;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

.modal-imagenes img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.2s ease-in-out;
}

/* Flechas de navegación */
.prev, .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 30px;
  font-weight: bold;
  background-color: rgba(0,0,0,0.45);
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}
.prev:hover, .next:hover {
  background-color: rgba(0,0,0,0.7);
}
.prev { left: 10px; }
.next { right: 10px; }

/* Detalle textual */
.modal-detalle {
  flex: 1;
  min-width: 260px;
  color: #222;
}
.modal-detalle h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.6em;
  color: #008f5a;
}
.modal-detalle p {
  margin: 8px 0;
  line-height: 1.5;
  font-size: 15px;
}
.modal-detalle strong {
  color: #555;
}

/* Botón agregar */
#btn-modal-agregar {
  background-color: #00a86b;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 15px;
  margin-top: 12px;
  cursor: pointer;
  transition: background-color 0.25s ease;
}
#btn-modal-agregar:hover {
  background-color: #008f5a;
}

/* Responsividad */
@media (max-width: 768px) {
  .modal-info {
    flex-direction: column;
    align-items: center;
  }
  .modal-imagenes {
    width: 85%;
    height: auto;
    aspect-ratio: 1 / 1;
  }
}


.cinta-aviso {
  position: absolute;
  top: 25%;                       /* centrada verticalmente */
  left: -20%;                    /* empieza más fuera del recuadro */
  width: 160%;                    /* suficiente para atravesar todo el producto */
  text-align: center;
  background: linear-gradient(90deg, #186e53, #a0c7b2);
  opacity: 0.6;
  color: #fff;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.95em;
  padding: 8px 0;
  transform: rotate(-18deg);      /* inclinación suave y visible */
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  border-top: 1px solid rgba(255,255,255,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.4);
  z-index: 10;
  clip-path: polygon(0 10%, 100% 0, 100% 90%, 0% 100%); /* borde ondulado */
  border: 1px solid;
}

/* efecto de movimiento sutil */
@keyframes flotarCinta {
  0%, 100% { transform: rotate(-18deg) translateY(0); }
  50% { transform: rotate(-18deg) translateY(-3px); }
}
.cinta-aviso {
  animation: flotarCinta 4s ease-in-out infinite;
}

/* Versión móvil */
@media (max-width: 768px) {
  .cinta-aviso {
    left: -60px;
    top: 38%;
    width: 170%;
    font-size: 0.8em;
    transform: rotate(-16deg);
  }
}



/* 🔖 Imagen de oferta */
.badge-oferta {
  position: absolute;
  top: -30px;
  right: 0px;
  width: 100px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.badge-oferta img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.badge-oferta span {
  position: relative;
  color: rgb(63, 123, 63);
  font-size: 11px;
  font-weight: bold;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  padding: 2px;
  line-height: 1.1em;
  z-index: 2;
}
