@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===============================
   SECCIÓN HERO DEL CATÁLOGO
================================ */
.catalog-hero {
    position: relative;
    height: 40vh;
    min-height: 300px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    margin-top: 80px;
}

.catalog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,186.7C384,213,480,235,576,213.3C672,192,768,128,864,128C960,128,1056,192,1152,213.3C1248,235,1344,213,1392,202.7L1440,192L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: center bottom;
    opacity: 0.7;
}

.catalog-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 0 20px;
}

.catalog-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-light);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out;
}

.catalog-hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1.2s ease-out;
}

/* ===============================
   FILTROS DE CATEGORÍAS
================================ */
.catalog-filters {
    background-color: var(--bg-light);
    padding: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.filter-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 0 20px;
}

.filter-btn {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: var(--primary-light);
    color: var(--text-dark);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: var(--text-light);
}

/* ===============================
   GRID DE PRODUCTOS
================================ */
.catalog-grid-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* ===============================
   TARJETAS DE PRODUCTOS
================================ */
.product-card {
    background-color: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.product-card.hidden {
    display: none;
}

.product-image {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    padding: 20px;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-card h3 {
    font-size: 1.4rem;
    margin: 20px 20px 10px;
    color: var(--primary-color);
}

.product-card p {
    font-size: 0.95rem;
    margin: 0 20px 15px;
    color: var(--primary-color);
    flex-grow: 1;
}

.product-details {
    padding: 0 20px;
}

.product-price {
    display: flex;
    flex-direction: column;
    margin: 10px 0;
}

.product-price strong {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 5px 0;
}

.product-actions {
    display: flex;
    gap: 10px;
    padding: 0 20px 20px;
}

.view-product-btn {
    flex: 1;
    padding: 10px;
    font-size: 0.9rem;
    background-color: #000000;
    color: var(--bg-color);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.view-product-btn:hover {
    background-color: var(--primary-dark);
}

.add-to-cart-btn {
    width: 50px;
    padding: 10px;
    font-size: 0.9rem;
    background-color: var(--accent-color);
    color: var(--text-light);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-to-cart-btn:hover {
    background-color: var(--accent-dark);
}

/* ===============================
   SECCIÓN CTA
================================ */
.catalog-cta {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent-color) 100%);
    padding: 60px 20px;
    text-align: center;
    margin-top: 60px;
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
}

.catalog-cta h2 {
    font-size: 2.5rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.catalog-cta p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 30px;
    opacity: 0.9;
}

/* ===============================
   CARRITO DE COMPRAS
================================ */
/* ===============================
   🛒 CARRITO DE COMPRAS (CORREGIDO)
================================ */

.cart-icon {
  position: relative;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text-dark);
  display: flex;
  align-items: center;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background-color: var(--accent-color);
  color: var(--text-light);
  font-size: 0.7rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

/* Sidebar del carrito */
.cart-sidebar {
  width: 340px;
  position: fixed;
  top: 0;
  right: -340px;
  height: 100%;
  background: #101010;               /* FONDO OSCURO */
  color: #f5f5f5;                    /* TEXTO CLARO */
  box-shadow: -3px 0 10px rgba(0, 0, 0, 0.5);
  transition: right 0.35s ease;
  z-index: 1100;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-left: 2px solid var(--accent-color);
}

.cart-sidebar.active {
  right: 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.cart-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent-color);
}

.cart-items {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.cart-item {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px;
  gap: 10px;
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

.cart-item-details {
  flex: 1;
}

.cart-item-details h4 {
  font-size: 0.95rem;
  margin: 0;
  color: #fff;
}

.cart-item-details p {
  font-size: 0.85rem;
  color: #ccc;
  margin: 4px 0;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-weight: bold;
}

.remove-item {
  background: none;
  border: none;
  color: #ff5555;
  cursor: pointer;
  font-size: 1rem;
}

/* Footer del carrito */
.cart-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 15px;
  text-align: center;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.checkout-btn {
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.checkout-btn:hover {
  background: var(--accent-dark);
}

/* Fondo oscuro cuando el carrito está abierto */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: none;
}

.cart-overlay.active {
  display: block;
}

/* RESPONSIVE */
@media (max-width: 480px) {
  .cart-sidebar {
    width: 100%;
  }
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .cart-item img {
    width: 100%;
    height: auto;
    max-width: 150px;
    margin-bottom: 10px;
  }
  .cart-item-details {
    width: 100%;
  }
  .cart-item-quantity {
    justify-content: flex-start;
  }
  .qty-btn {
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
  }
  .remove-item {
    font-size: 1.2rem;
    align-self: flex-end;
  }
  .checkout-btn {
    width: 100%;
  }
}

/* ===============================
   MODAL DE CHECKOUT
================================ */
.checkout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.checkout-overlay.active {
    display: flex;
    opacity: 1;
}

.checkout-modal {
    background: #fff;
    color: var(--text-dark);
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.checkout-overlay.active .checkout-modal {
    transform: scale(1);
}

/* ===============================
   NOTIFICACIONES
================================ */
.notification {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transition: bottom 0.3s ease;
}

.notification.show {
    bottom: 20px;
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 768px) {
    .catalog-hero h1 {
        font-size: 2.2rem;
    }

    .catalog-hero p {
        font-size: 1rem;
    }

    .catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .cart-sidebar {
        width: 320px;
    }
    .cart-icon {
      margin-left: 0;
    }
}

@media (max-width: 480px) {
    .catalog-hero {
        height: 30vh;
    }

    .catalog-hero h1 {
        font-size: 1.8rem;
    }

    .filter-btn {
        padding: 6px 15px;
        font-size: 0.9rem;
    }

    .catalog-grid {
        grid-template-columns: 1fr;
    }

    .product-card h3 {
        font-size: 1.2rem;
    }

    .catalog-cta {
        padding: 40px 20px;
    }

    .catalog-cta h2 {
        font-size: 1.6rem;
    }

    .cart-sidebar {
        width: 100%;
    }

    .product-actions {
        flex-direction: column;
    }
    .cart-item img {
      width: 80px;
      height: 80px;
    }
    .qty-btn {
      width: 28px;
      height: 28px;
      font-size: 1.1rem;
    }
    .remove-item {
      font-size: 1.2rem;
    }
    .checkout-btn {
      width: 100%;
    }
}

/* ===============================
   VISOR DE PRODUCTOS (MODAL)
================================ */
.product-viewer-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #d5d5d5;
    color: var(
    --text-dark);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    padding: 20px;
    display: none;
    flex-direction: row;
    gap: 20px;
    z-index: 1200;
    overflow-y: auto;
}

.product-viewer-modal.active {
    display: flex;
}

.product-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1100;
    display: none;
}

.product-viewer-overlay.active {
    display: block;
}

.product-viewer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
}

.product-images-container {
    flex: 1 1 45%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-product-image img {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    object-fit: contain;
}

.product-thumbnails {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.product-thumbnails img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    cursor: pointer;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.product-thumbnails img:hover {
    transform: scale(1.1);
}

.product-viewer-details {
    flex: 1 1 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.product-viewer-title {
    font-size: 1.8rem;
    color: var(--text-dark);
}

.product-viewer-description {
    font-size: 1rem;
    color: var(--text-muted);
}

.product-viewer-price {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-top: 10px;
}

.product-viewer-add-btn {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 1rem;
    background: var(--accent-color);
    color: var(--text-light);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    align-self: flex-start;
    transition: background 0.3s ease;
}

.product-viewer-add-btn:hover {
    background: var(--accent-dark);
}

.close-viewer {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-dark);
    cursor: pointer
}

@media (max-width: 600px) {
  .product-viewer-content {
    flex-direction: column;
  }
  .product-images-container {
    flex: 1 1 100%;
  }
  .product-viewer-details {
    flex: 1 1 100%;
  }
  .main-product-image img {
    max-width: 100%;
  }
  .product-thumbnails img {
    width: 60px;
    height: 60px;
  }
}
@media (max-width: 480px) {
  .checkout-modal {
    width: 95%;
    padding: 15px;
  }
  .checkout-modal input,
  .checkout-modal select {
    font-size: 1rem;
    padding: 8px;
  }
  .checkout-modal button {
    font-size: 1rem;
    padding: 10px;
  }
}
/* catalogo-responsive.css - parche NO invasivo */

/* Reset mínimo */
*{box-sizing:border-box}
html,body{height:100%;font-family:Montserrat,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial;}
img{max-width:100%;display:block;height:auto}

/* Header / Nav */
header{position:relative;z-index:80}
nav{display:flex;align-items:center;justify-content:space-between;padding:12px 20px}
.nav-links{display:flex;gap:18px;align-items:center;list-style:none;padding:0;margin:0}
.nav-links li a{display:inline-block;padding:6px 8px;text-decoration:none}

/* Menu toggle (mobile) */
.menu-toggle{display:none;cursor:pointer;width:36px;height:36px;align-items:center;justify-content:center}
.menu-toggle span{display:block;height:3px;background:#111;margin:4px 0;border-radius:2px}

/* Cart icon */
.cart-icon{position:relative;cursor:pointer}
.cart-count{position:absolute;top:-6px;right:-10px;background:#e53935;color:#fff;border-radius:50%;padding:2px 6px;font-size:12px}

/* Grid productos */
.catalog-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:18px;padding:20px}
.product-card{background:#fff;border-radius:8px;overflow:hidden;box-shadow:0 6px 18px rgba(0,0,0,.06);display:flex;flex-direction:column}
.product-image{width:100%;aspect-ratio:1.3/1;overflow:hidden;display:flex;align-items:center;justify-content:center}
.product-image img{width:100%;height:100%;object-fit:cover}
.product-actions{display:flex;gap:8px;padding:12px}

/* Cart sidebar */
.cart-sidebar{
  position:fixed;top:0;right:-420px;height:100%;width:380px;max-width:92%;
  background:#fff;box-shadow:-10px 0 30px rgba(0,0,0,.18);z-index:200;transition:right .25s ease;
  display:flex;flex-direction:column;
}
.cart-sidebar.open{right:0}
.cart-overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);opacity:0;visibility:hidden;transition:opacity .2s;z-index:150}
.cart-overlay.active{opacity:1;visibility:visible}

/* Cart items area */
.cart-items{flex:1;overflow:auto;padding:12px}
.cart-item{display:flex;gap:10px;align-items:center;padding:8px 0;border-bottom:1px solid rgba(0,0,0,.06)}
.cart-item img{width:64px;height:64px;object-fit:cover;border-radius:6px}

/* Footer/cart footer */
.cart-footer{padding:12px;border-top:1px solid rgba(0,0,0,.06)}

/* Product viewer modal */
.product-viewer{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;z-index:220}
.product-viewer .viewer-card{width:min(920px,95%);max-height:90vh;background:#fff;border-radius:10px;overflow:auto;padding:16px;box-shadow:0 20px 50px rgba(0,0,0,.25)}
.product-viewer .thumbs{display:flex;gap:8px;overflow:auto;margin-top:10px}
.product-viewer .thumbs img{width:64px;height:64px;object-fit:cover;border-radius:6px;cursor:pointer}

/* Botones */
.btn{display:inline-flex;align-items:center;justify-content:center;padding:.5rem .75rem;border-radius:8px;border:0;cursor:pointer}
.btn.primary{background:#111;color:#fff}

/* Responsive */
@media (max-width: 900px){
  .catalog-grid{gap:12px;padding:12px}
  .product-image{aspect-ratio:1.1/1}
  .menu-toggle{display:flex}
  .nav-links{display:none;position:absolute;top:64px;left:0;right:0;background:#fff;flex-direction:column;padding:12px;box-shadow:0 10px 30px rgba(0,0,0,.08)}
  .nav-links.show{display:flex}
  .cart-sidebar{width:90%;right:-100%}
  .cart-sidebar.open{right:0}
  .product-viewer .viewer-card{width:calc(100% - 32px);padding:12px}
}
