/* --- VARIABLES GLOBALES (Fácil edición) --- */
:root {
    --color-primary: #00e676; /* Verde Neón ZyLogix */
    --color-primary-dark: #00b35c;
    --color-bg: #0a0a0a;
    --color-card: #141414;
    --color-text-main: #ffffff;
    --color-text-muted: #a1a1aa;
    --font-main: "Inter", sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow-glow: 0 0 20px rgba(0, 230, 118, 0.15);
}

::selection {
    background-color: var(--color-primary);
    color: black;
    text-shadow: none;
}

/* --- RESET & BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    font-family: var(--font-main);
    overflow-x: hidden;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* --- LAYOUT --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- HEADER & NAV --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 15px 0;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
}

.logo-img {
    height: 35px;
    width: auto;
    padding-right: 8px;
}

.logo span {
    color: var(--color-primary);
}

.header-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.cart-btn {
    position: relative;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: var(--shadow-glow);
}

.cart-count {
    background: var(--color-primary);
    color: black;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

/* --- HERO SECTION --- */
.hero {
    margin-top: 65px;
    height: 350px;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Elementos decorativos estilo ZyLogix */
.hero::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(
        circle,
        rgba(0, 230, 118, 0.15) 0%,
        rgba(0, 0, 0, 0) 70%
    );
    z-index: 1;
}

.hero-content {
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.hero h1 span {
    color: var(--color-primary);
    text-shadow: 0 0 30px rgba(0, 230, 118, 0.4);
}

.hero p {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    font-weight: 300;
}

/* --- FILTROS (Categorías) --- */
.filters {
    padding: 40px 0 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-muted);
    padding: 10px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.controls-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
}

/* Separated hover to avoid sticky hover on mobile */
@media (hover: hover) {
    .filter-btn:hover {
        background: var(--color-primary);
        color: black;
        border-color: var(--color-primary);
        font-weight: 600;
        box-shadow: 0 0 15px rgba(0, 230, 118, 0.4);
        transform: translateY(-2px);
    }
}

.filter-btn.active {
    background: var(--color-primary);
    color: black;
    border-color: var(--color-primary);
    font-weight: 600;
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.4);
    transform: translateY(-2px);
}

/* --- GRID DE PRODUCTOS --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    padding: 40px 0 80px;
}

/* Duplicate media query removed here */

.original-price {
    font-size: 0.85rem;
    color: #888;
    text-decoration: line-through;
    display: block;
    margin-bottom: 2px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    background: var(--color-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

@media (hover: hover) {
    .product-card:hover {
        transform: translateY(-10px);
        border-color: rgba(0, 230, 118, 0.5);
        box-shadow: 0 10px 40px -10px rgba(0, 230, 118, 0.1);
    }

    .product-card:hover .product-image {
        transform: scale(1.05);
    }

    .add-btn:hover {
        background: var(--color-primary);
        color: black;
        transform: rotate(90deg);
    }
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.5));
    transition: transform 0.4s ease;
}

.product-category {
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    flex-grow: 1;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.price {
    font-size: 1.25rem;
    font-weight: 800;
}

.add-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition-smooth);
}

/* --- CARRITO SIDEBAR --- */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    height: 100vh;
    background: #111;
    z-index: 2000;
    padding: 20px;
    transition: right 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
    box-shadow: -100px 0 200px rgba(0, 0, 0, 0.8);
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.close-cart {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 10px;
}

.cart-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
}

.cart-total-area {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.checkout-btn {
    width: 100%;
    background: var(--color-primary);
    color: black;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 10px;
    text-transform: uppercase;
    transition: var(--transition-smooth);
}

.checkout-btn:hover {
    background: white;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Responsive Extra */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    .product-card {
        padding: 15px;
    }
    .product-image {
        height: 140px;
    }
}

/* --- SEARCH & SORT CONTROLS --- */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    color: white;
    font-family: var(--font-main);
    transition: var(--transition-smooth);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
}

/* --- SORT DROPDOWN --- */
.sort-dropdown {
    position: relative;
    z-index: 100;
}

.sort-trigger {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-muted);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
    min-width: 160px;
    justify-content: space-between;
}

@media (hover: hover) {
    .sort-trigger:hover {
        border-color: var(--color-primary);
        color: white;
    }
}

.sort-options {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    min-width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-smooth);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.sort-dropdown.active .sort-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-option {
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s;
    color: #ccc;
    font-size: 0.9rem;
}

@media (hover: hover) {
    .sort-option:hover {
        background: rgba(0, 230, 118, 0.1);
        color: white;
    }
}

/* ... existing sections ... */

/* MOVED MOBILE STYLES TO END FOR SPECIFICITY */
@media (max-width: 600px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 20px 0 60px;
    }

    .product-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .price {
        font-size: 1rem;
    }

    .hero::before {
        opacity: 0.2;
    }

    .footer-col,
    .footer-bottom {
        text-align: center;
    }

    .footer-col {
        align-items: center;
        display: flex;
        flex-direction: column;
    }

    /* Sort Button Mobile */
    .controls-bar {
        flex-wrap: nowrap; /* Prevent wrapping */
        gap: 10px;
    }

    .sort-trigger {
        min-width: 44px; /* Force small square */
        width: 44px;
        height: 44px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
        font-size: 0 !important; /* Force hide text */
    }

    .sort-arrow {
        font-size: 1.2rem;
        margin: 0;
    }
}

/* --- LABELS --- */
.product-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--color-primary);
    color: black;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 5px;
    z-index: 10;
    text-transform: uppercase;
}

.product-label.oferta {
    background: #ff4081;
    color: white;
}
.product-label.nuevo {
    background: #00e676;
}
.product-label.mas-vendido {
    background: #ffeb3b;
}
.product-label.ultimas {
    background: #ff9800;
    color: black;
}

/* --- CAROUSEL --- */
.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 40px 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: "";
    width: 5px;
    height: 30px;
    background: var(--color-primary);
    border-radius: 5px;
}

.carousel-container {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 20px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.carousel-container::-webkit-scrollbar {
    display: none;
}

.carousel-item {
    min-width: 250px;
    max-width: 250px;
    flex: 0 0 auto;
}

/* --- MODAL OVERLAY --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Modal Scroll Fix */
.modal-content {
    background: #111;
    width: 100%;
    max-width: 900px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    overflow-y: auto; /* Allow scroll on mobile */
    max-height: 85vh;
    animation: slideUp 0.4s ease-out;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
    .modal-content {
        flex-direction: row;
        overflow: hidden; /* Desktop split scroll */
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-image-col {
    background: #0f0f0f;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
}

.modal-image-col img {
    width: 100%;
    max-width: 300px;
    object-fit: contain;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5));
}

.modal-info-col {
    padding: 40px;
    flex: 1.5;
    /* overflow-y handled by parent on mobile */
    position: relative;
}

@media (min-width: 768px) {
    .modal-info-col {
        overflow-y: auto;
    }
}

/* Add Button Text/Icon Logic */
.btn-text {
    display: none;
}
.btn-icon {
    display: inline;
}

@media (max-width: 768px) {
    .btn-text {
        display: inline;
        font-size: 0.9rem;
        font-weight: 700;
        text-transform: uppercase;
    }
    .btn-icon {
        display: none;
    }

    .add-btn {
        width: 100%;
        border-radius: 10px;
        height: 40px;
        background: var(--color-primary);
        color: black;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .add-btn:hover {
        transform: none;
        background: white;
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 10;
}

.modal-close:hover {
    background: var(--color-primary);
    color: black;
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 5px;
}
.modal-category {
    color: var(--color-primary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-weight: 600;
}

.tabs {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}
.tab-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    padding-bottom: 10px;
    cursor: pointer;
    font-weight: 600;
    border-bottom: 2px solid transparent;
}
.tab-btn.active {
    color: white;
    border-color: var(--color-primary);
}

.tab-content {
    display: none;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #ccc;
}
.tab-content.active {
    display: block;
}
.tab-content ul {
    padding-left: 20px;
}
.tab-content li {
    margin-bottom: 5px;
}

/* --- FOOTER --- */
.site-footer {
    background: #050505;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: white;
    margin-bottom: 20px;
    font-weight: 700;
}
.footer-col ul {
    list-style: none;
}
.footer-col ul li {
    margin-bottom: 10px;
}
.footer-col ul li a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: 0.3s;
}
.footer-col ul li a:hover {
    color: var(--color-primary);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}
.social-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: 0.3s;
}
.social-icon:hover {
    background: var(--color-primary);
    color: black;
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* FIX: Corrected Mobile Layout & Gallery Styles */
@media (max-width: 600px) {
    /* Clear previous conflicting styles if any */
    .controls-bar,
    .controls-top,
    .filters,
    .search-box,
    .sort-trigger {
        flex-wrap: unset;
    }

    /* Mobile Controls Layout */
    .controls-bar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
        display: flex;
    }

    .controls-top {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .search-box {
        flex-grow: 1;
        max-width: none;
    }

    .filters {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
        display: flex;
        gap: 10px;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        margin: 0;
    }

    .filter-btn {
        flex: 0 0 auto;
    }

    .sort-trigger {
        min-width: 44px;
        width: 44px;
        height: 44px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
        font-size: 0 !important;
    }

    .sort-arrow {
        font-size: 1.2rem;
        margin: 0;
        padding: 0 7px 0 0;
    }
}

/* --- PRODUCT GALLERY --- */
.thumb-list {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
}
.thumb-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    transition: var(--transition-smooth);
}
.thumb-img:hover,
.thumb-img.active {
    border-color: var(--color-primary);
    transform: scale(1.05);
}
