/* ========================
   FUENTES Y GENERALES
======================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&family=Lobster&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background: url('imagenes/fondo.jpg') no-repeat center center fixed;
    background-size: cover;
}

/* ========================
   HEADER
======================== */
header {
    background-color: #272727;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    
      position: static; /* no fijo en móvil */
  
}

/* Solo en pantallas grandes (PC) */
@media (min-width: 992px) {
  header {
    position: sticky;  /* o fixed si prefieres */
    top: 0;
    z-index: 1000;
  }
}


.logo-container {
    margin-bottom: 10px;
}

.logo {
    width: 150px;
    height: auto;
}

header h1 {
    margin: 0;
    font-family: 'Lobster', cursive;
    font-size: 40px;
    letter-spacing: 2px;
}

/* ========================
   NAV
======================== */
nav ul {
    list-style-type: none;
    padding: 0;
}

nav ul li {
    display: inline-block;
    margin: 0 15px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
}

nav ul li:hover {
    color: #ddd;
}

/* ====== En móviles (pantallas pequeñas) ====== */
@media (max-width: 768px) {
  header {
      padding: 10px 0;   /* menos alto en celular */
  }

  .logo {
      width: 100px;      /* logo más pequeño */
  }

  header h1 {
      font-size: 24px;   /* título más compacto */
  }

  nav ul li {
      margin: 0 8px;     /* menos separación en menú */
      font-size: 13px;
  }
}

/* ========================
   CATÁLOGO
======================== */
#catalogo {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
}

.card {
    background-color: #fdfefe;
    border: 1px solid #ddd;
    padding: 15px;
    margin: 10px;
    width: 220px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: scale(1.03);
}

.card img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    margin-bottom: 10px;
    cursor: pointer;
}

.card h3 {
    font-size: 18px;
    margin: 10px 0;
}

.card p {
    font-size: 20px;
    color: #2e86c1;
    font-weight: bold;
}

/* ========================
   PAGINACIÓN
======================== */
#pagination {
    text-align: center;
    margin: 20px 0;
}

#pagination button, 
#pagination span {
    margin: 0 5px;
    padding: 8px 15px;
    cursor: pointer;
    border: none;
    background-color: #333;
    color: #fff;
    font-size: 16px;
    border-radius: 5px;
}

#pagination button:hover {
    background-color: #555;
}

#pagination span {
    font-weight: bold;
}

/* ========================
   FOOTER
======================== */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 0px;
    position: fixed;
    width: 100%;
    bottom: 0;
}

/* ========================
   BOTÓN VOLVER ARRIBA
======================== */
#back-to-top {
    position: fixed;
    bottom: 100px;
    right: 15px;
    background-color: #4CAF50;
    color: #fff;
    border: none;
    padding: 12px 15px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    display: none;
    transition: background-color 0.3s ease;
    z-index: 1000;
}

#back-to-top:hover {
    background-color: #45a049;
}

#back-to-top.show {
    display: block;
}

/* Texto adaptativo móvil/escritorio */
#back-to-top .mobile-text { display: none; }
#back-to-top .desktop-text { display: inline; }

@media (max-width: 768px) {
  #back-to-top .mobile-text { display: inline; }
  #back-to-top .desktop-text { display: none; }
}

/* Botón carrito base */
.aiw-cart-fab {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 9999;
    background: #28a745; /* ✅ Verde en escritorio */
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

/* Animación de atención (rebote) */
.aiw-cart-fab.attention {
    animation: bounce 1s;
    background: #28a745 !important; /* ✅ al rebotar siempre verde */
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(-50%) scale(1); }
    40% { transform: translateY(-60%) scale(1.1); }
    60% { transform: translateY(-45%) scale(0.95); }
}

/* 🔽 En móviles */
@media (max-width: 768px) {
    .aiw-cart-fab {
        top: 50%;
        bottom: auto;
        right: 20px;
        transform: translateY(-50%);
        width: 55px;
        height: 55px;
        font-size: 22px;
        background: #28a745; /* ✅ Naranja en móvil */
    }

     @keyframes bounce {
        0%, 20%, 50%, 80%, 100% { transform: translateY(-50%) scale(1); }
        40% { transform: translateY(-60%) scale(1.1); }
        60% { transform: translateY(-45%) scale(0.95); }
     }
}


/* Contador (badge) */
.aiw-cart-fab #cart-count {
    position: absolute;
    top: 5px;   /* Lo mueve arriba */
    right: 5px; /* Lo mueve a la derecha */
    background: red;
    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 3px 7px;
    border-radius: 50%;
    line-height: 1;
    min-width: 22px;
    text-align: center;
}



/* Hover con efecto de brillo */
.aiw-cart-fab:hover {
    transform: scale(1.15);
    background: linear-gradient(135deg, #1ebc57, #128c7e);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

/* Animación para llamar la atención (rebote) */
@keyframes cart-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.aiw-cart-fab.attention {
    animation: cart-bounce 1s infinite;
}

.aiw-cart-fab:hover {
    transform: scale(1.1);
}

/* ========================
   MODAL DE PRODUCTO
======================== */
.aiw-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1002;
    justify-content: center;
    align-items: center;
}

.aiw-modal.active {
    display: flex;
}

.aiw-modal__overlay {
    position: absolute;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
}

.aiw-modal__content {
    position: relative;
    background: #fff;
    padding: 20px;
    max-width: 800px;
    width: 90%;
    border-radius: 10px;
    z-index: 1003;
}

.aiw-modal__close {
    position: absolute;
    top: 10px; right: 10px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.aiw-modal__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.aiw-modal__image-wrap img {
    width: 100%;
    max-width: 300px;
    border-radius: 10px;
}

.aiw-modal__info {
    flex: 1;
}

.aiw-price {
    font-size: 20px;
    font-weight: bold;
    color: #2e86c1;
    margin: 10px 0;
}

.aiw-qty {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.aiw-qty button {
    background: #ddd;
    border: none;
    padding: 8px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 5px;
}

.aiw-qty input {
    width: 50px;
    text-align: center;
    font-size: 16px;
}

.aiw-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.aiw-btn {
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-weight: bold;
}

.aiw-btn-primary {
    background: #2e86c1;
    color: #fff;
}

.aiw-btn-wa {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s ease;
}

/* ===== Carrito ===== */
.aiw-cart {
  position: fixed;
  top: 0;
  right: -100%;
  width: 350px;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 12px rgba(0,0,0,0.15);
  padding: 20px;
  overflow-y: auto;
  transition: right 0.3s ease;
  z-index: 9999;
}
.aiw-cart.active {
  right: 0;
}
.aiw-cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.aiw-cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 15px;
}
.aiw-cart-item {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.aiw-cart-item__info {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;
}
.aiw-cart-item__title {
  font-weight: bold;
  color: #333;
}
.aiw-cart-item__price {
  font-weight: 600;
  color: #007b5e;
}
.aiw-cart-item__qty {
  display: flex;
  align-items: center;
  gap: 8px;
}
.aiw-cart-item__qty input {
  width: 60px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 6px;
  text-align: center;
}
.aiw-cart-item__remove {
  margin-top: 8px;
  background: transparent;
  border: none;
  color: #d9534f;
  cursor: pointer;
  font-size: 14px;
  transition: color 0.2s;
}
.aiw-cart-item__remove:hover {
  color: #b52b27;
}

.aiw-cart-summary {
  font-size: 16px;
  font-weight: bold;
  text-align: right;
  margin-bottom: 15px;
}

.aiw-cart-customer input,
.aiw-cart-customer textarea {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
}

.aiw-cart-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== Botones ===== */
.aiw-btn-primary {
  background: #4161ec;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.aiw-btn-primary:hover {
  background: #218838;
}

.aiw-btn-secondary {
  background: #28a745;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.aiw-btn-secondary:hover {
  background: #218838;
}

/* ========================
   RESPONSIVE
======================== */
@media (max-width: 768px) {
    header h1 {
        font-size: 28px;
    }
    nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    nav ul li {
        font-size: 14px;
        margin: 5px;
    }
    .card {
        width: 45%;
    }
    .aiw-cart {
        width: 90%;
    }
}

/* -------- MENÚ DE CATEGORÍAS EN CELULAR -------- */
@media (max-width: 768px) {
  nav.categorias ul {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding: 5px 10px;
    margin: 0;
    list-style: none;
  }

  nav.categorias ul li {
    flex: 0 0 auto;
  }

  nav.categorias ul li a {
    background: #ffffff;
    color: #333;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #ddd;
    text-decoration: none;
    white-space: nowrap;
  }

  nav.categorias ul li a:hover {
    background: #00c6ff;
    color: #fff;
  }
}

/* ===== Productos en 2 columnas en móvil ===== */
@media (max-width: 768px) {
  #catalogo {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* espacio entre tarjetas */
    justify-content: center; /* centra el grid */
  }

  #catalogo .card {
    flex: 0 0 calc(50% - 10px); /* 2 columnas exactas */
    box-sizing: border-box;     /* que respete el ancho */
    margin: 0;                  /* quitamos margenes extra */
  }

  #catalogo .card img {
    width: 100%;                /* que la imagen no se salga */
    height: auto;               /* mantiene proporción */
    object-fit: contain;
  }
}

/* ===== Ajustes visuales móviles ===== */
@media (max-width: 768px) {
  #catalogo .card {
    flex: 0 0 calc(50% - 8px); /* Dos columnas con espacio reducido */
    padding: 10px;
    border-radius: 6px;
  }

  #catalogo .card img {
    height: 120px; /* Altura más pequeña */
    object-fit: contain;
  }

  #catalogo .card h3 {
    font-size: 14px;
    margin: 5px 0;
  }

  #catalogo .card p {
    font-size: 16px;
    color: #007b5e;
    font-weight: bold;
  }
}

/* ===== Extra pequeño (<= 400px) ===== */
@media (max-width: 400px) {
  #catalogo .card {
    flex: 0 0 calc(50% - 6px); /* Mantener dos columnas ajustadas */
  }

  #catalogo .card img {
    height: 100px; /* Más compacta */
  }

  #catalogo .card h3 {
    font-size: 12px;
  }

  #catalogo .card p {
    font-size: 14px;
  }
}
