/* RESET & FUENTES */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: #0a0a0a;
    color: #f0f0f0;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Footer siempre abajo */
}

a { text-decoration: none; color: inherit; transition: 0.3s; }

/* HEADER */
header {
    background: #000;
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #222;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo img { height: 40px; width: auto; }
.logo span { font-weight: 700; letter-spacing: 2px; font-size: 1.2rem; }

nav ul { display: flex; gap: 30px; list-style: none; }
nav a { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; color: #888; }
nav a:hover, nav a.active { color: #009ee3; }

/* MAIN & TEXTOS */
main {
    flex: 1;
    padding: 40px 50px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.project-header { text-align: center; margin-bottom: 40px; }
.project-header h1 { font-size: 2.5rem; letter-spacing: -1px; margin-bottom: 10px; }
.project-meta { color: #888; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 2px; }
.project-description { max-width: 800px; margin: 20px auto; color: #ccc; }

/* FILTROS (BOTONES) */
.filters { display: flex; justify-content: center; gap: 15px; margin-bottom: 30px; }
.filter-btn {
    background: transparent; border: 1px solid #444; color: #888;
    padding: 8px 20px; cursor: pointer; border-radius: 20px; transition: 0.3s;
}
.filter-btn:hover, .filter-btn.active { background: #fff; color: #000; border-color: #fff; }

/* GRILLAS PRINCIPALES (Portfolio y Tienda) */
.portfolio-grid, .shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Columnas automáticas */
    gap: 20px;
}

/* Tarjetas */
.portfolio-item, .product-card {
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
    position: relative;
    display: block;
}

.portfolio-item:hover, .product-card:hover { transform: translateY(-5px); }

.portfolio-item img, .product-card img {
    width: 100%;
    height: 250px; /* Altura fija para uniformidad */
    object-fit: cover;
    display: block;
}

/* Info superpuesta en Portfolio (Solo hover) */
.item-info {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 20px; opacity: 0; transition: 0.3s;
}
.portfolio-item:hover .item-info { opacity: 1; }
.item-info h3 { font-size: 1.1rem; margin-bottom: 5px; }
.item-info span { font-size: 0.75rem; color: #009ee3; text-transform: uppercase; }

/* Info Tienda (Siempre visible) */
.product-card { padding-bottom: 15px; text-align: center; }
.product-card h3 { margin: 15px 0 5px; font-size: 1.1rem; }
.product-card .price { display: block; font-size: 1.2rem; color: #009ee3; font-weight: bold; margin: 10px 0; }
.product-card .specs { font-size: 0.8rem; color: #666; }
.btn-buy { background: #009ee3; color: white; border: none; padding: 8px 20px; border-radius: 4px; cursor: pointer; font-weight: bold; }
.btn-buy:hover { background: #0077aa; }

/* GRILLA INTERNA DE PROYECTO (Dynamic Gallery) */
.dynamic-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}
.dynamic-gallery img {
    width: calc(33.33% - 10px); /* 3 columnas */
    aspect-ratio: 3/2;
    object-fit: cover;
    cursor: zoom-in;
    transition: 0.3s;
    border-radius: 4px;
}
.dynamic-gallery img:hover { filter: brightness(1.1); }

/* FOOTER */
footer {
    background: #000; padding: 40px 20px; border-top: 1px solid #222; text-align: center; margin-top: auto;
}
.footer-social { display: flex; justify-content: center; gap: 30px; margin-bottom: 20px; }
.social-link img { width: 25px; height: 25px; filter: brightness(0) invert(1); transition: 0.3s; }
.social-link:hover img { transform: scale(1.1); filter: invert(53%) sepia(66%) saturate(3000%) hue-rotate(166deg); }
.copyright { color: #444; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; }

/* LIGHTBOX & MODALES */
#lightbox, #checkout-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); display: none; justify-content: center; align-items: center;
    z-index: 3000;
}
.lb-close { position: absolute; top: 20px; right: 30px; color: white; font-size: 40px; cursor: pointer; }
#lightbox-img { max-width: 90%; max-height: 90%; border: 2px solid #333; box-shadow: 0 0 20px rgba(0,0,0,0.5); }

.checkout-box { background: #111; padding: 30px; border-radius: 8px; border: 1px solid #009ee3; width: 90%; max-width: 400px; }
.checkout-box input { width: 100%; padding: 10px; margin-bottom: 10px; background: #222; border: 1px solid #333; color: white; }
.checkout-actions { display: flex; gap: 10px; margin-top: 15px; }
.btn-confirm { flex: 1; background: #009ee3; border: none; padding: 10px; color: white; cursor: pointer; }
.btn-cancel { flex: 1; background: #444; border: none; padding: 10px; color: white; cursor: pointer; }

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
    header { padding: 15px 20px; }
    nav ul { gap: 15px; }
    nav a { font-size: 0.75rem; }
    main { padding: 20px; }
    
    .portfolio-grid, .shop-grid { grid-template-columns: 1fr; } /* 1 col en mobile */
    .dynamic-gallery img { width: 100%; } /* 1 col en galería interna */
    
    .project-header h1 { font-size: 1.8rem; }
}

/* --- FLECHAS DEL LIGHTBOX --- */
.lb-prev, .lb-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 40px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.3); /* Fondo sutil */
    border: none;
    z-index: 3001; /* Encima de la imagen */
}

.lb-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lb-prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.lb-prev:hover, .lb-next:hover {
    background-color: rgba(0,0,0,0.8);
}

/* --- ESTILOS PARA BOTONES DE VARIANTES (Tienda) --- */
.variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 15px 0;
}

.variant-btn {
    background: transparent;
    border: 1px solid #444;
    color: #aaa;
    padding: 6px 12px;
    border-radius: 20px; /* Bordes redondeados como en el ejemplo */
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.variant-btn:hover {
    border-color: #888;
    color: #fff;
}

/* Estado activo: Fondo azul y texto blanco */
.variant-btn.active {
    background: #009ee3;
    border-color: #009ee3;
    color: white;
    font-weight: bold;
}

/* Ocultar el precio base ya que ahora es dinámico */
.product-card .price {
    font-size: 1.3rem;
    color: #009ee3;
    font-weight: 700;
    margin-bottom: 10px;
    display: block;
}

/* --- CONTROLES DE CANTIDAD (EN TARJETA) --- */
.qty-control {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    border-radius: 4px;
    margin-right: 10px;
    border: 1px solid #444;
}
.qty-btn {
    background: transparent; border: none; color: white;
    padding: 5px 12px; cursor: pointer; font-size: 1.2rem;
}
.qty-btn:hover { color: #009ee3; }
.qty-val { width: 30px; text-align: center; font-weight: bold; font-size: 1rem; }

.buy-row {
    display: flex; justify-content: space-between; align-items: center; margin-top: 15px;
}
.btn-add {
    background: #ddd; color: #111; border: none; padding: 10px; 
    border-radius: 4px; cursor: pointer; font-weight: bold; flex: 1;
    text-transform: uppercase; letter-spacing: 1px; transition: 0.3s;
}
.btn-add:hover { background: #fff; }

/* --- BOTÓN FLOTANTE DEL CARRITO --- */
.cart-float {
    position: fixed; bottom: 30px; right: 30px;
    background: #009ee3; color: white;
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5); cursor: pointer;
    z-index: 2500; transition: transform 0.3s;
}
.cart-float:hover { transform: scale(1.1); }
.cart-count {
    position: absolute; top: 0; right: 0;
    background: red; color: white; font-size: 0.8rem;
    width: 20px; height: 20px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center; font-weight: bold;
}

/* --- LISTA DE ITEMS EN EL MODAL DE CHECKOUT --- */
.cart-list {
    max-height: 200px; overflow-y: auto; margin-bottom: 20px;
    border-bottom: 1px solid #333; padding-bottom: 10px;
}
.cart-item-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; font-size: 0.9rem; border-bottom: 1px solid #222; padding-bottom: 5px;
}
.cart-del { color: #f44336; cursor: pointer; margin-left: 10px; font-weight: bold; }