/* =====================================================
   RESET Y BASE
===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", system-ui, sans-serif;
}

body {
    background: #f8fafc;
    color: #0f172a;
}

/* =====================================================
   NAVBAR
===================================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 65px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 40px;
    z-index: 100;
}

.logo {
    font-weight: bold;
    letter-spacing: 2px;
    font-size: 18px;
}

/* =====================================================
   HERO (IMAGEN INDEX)
===================================================== */
.hero {
    width: 100%;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;

    /* 🔥 Corrección clave */
    margin-top: 65px;
    min-height: calc(100vh - 65px);
}

.hero img {
    width: 100%;
    max-width: 1100px;
    height: auto;
    max-height: 75vh;
    object-fit: contain;
    padding: 20px;
    display: block;
}

/* =====================================================
   LAYOUT GENERAL
===================================================== */
.layout {
    display: flex;
}

.content {
    flex: 1;
    padding: 40px;
}

/* =====================================================
   SIDEBAR (FILTROS)
===================================================== */
.sidebar {
    width: 270px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    padding: 35px 25px;
    position: sticky;
    top: 65px;
    height: calc(100vh - 65px);
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-filters {
    font-size: 22px;
    cursor: pointer;
    display: none;
}

.sidebar input {
    width: 100%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 12px;
    border-radius: 10px;
}

.filter-group {
    margin-top: 25px;
}

.filter-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
}

.filter-list {
    max-height: 260px;
    overflow-y: auto;
}

.filter-item {
    padding: 10px 14px;
    margin-bottom: 6px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}

.filter-item:hover,
.filter-item.active {
    background: #0f172a;
    color: #fff;
}

/* =====================================================
   HEADER DE CONTENIDO
===================================================== */
.content-header h1 {
    font-size: 32px;
}

.subtitle {
    color: #64748b;
    font-size: 14px;
    margin-top: 6px;
}

/* =====================================================
   CHIPS Y BOTÓN FILTROS
===================================================== */
.chips {
    margin-top: 25px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.chip,
.filter-btn {
    height: 40px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
}

.chip {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 6px 14px;
    font-size: 13px;
}

.filter-btn {
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    background: #f1f5f9;
    font-weight: 600;
    cursor: pointer;
    display: none;
}

/* =====================================================
   GRID DE PRODUCTOS
===================================================== */
.grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
}

/* =====================================================
   CARD PRODUCTO
===================================================== */
.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 22px;
    transition: 0.25s;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
}

.image-wrapper img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 6px;
}

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

.image-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url('/static/img/marca-agua.png') center / 250px no-repeat;
    opacity: 0.9;
    pointer-events: none;
}

.card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-top: 10px;
}

.brand {
    font-size: 13px;
    color: #475569;
}

.category {
    font-size: 11px;
    text-transform: uppercase;
}

/* =====================================================
   MODAL PRODUCTO
===================================================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-box {
    background: white;
    width: 900px;
    max-width: 95%;
    border-radius: 24px;
    padding: 30px;
    position: relative;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.modal-image-wrapper {
    background: #f8fafc;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
}

.modal-image-wrapper img {
    width: 100%;
    padding: 20px;
}

.modal-image-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url('/static/img/marca-agua.png') center / 200px no-repeat;
    pointer-events: none;
}

.close-modal {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 26px;
    cursor: pointer;
}

/* =====================================================
   RESPONSIVE
===================================================== */
@media (max-width: 768px) {

    .navbar {
        height: 55px;
    }

    .hero {
        margin-top: 55px;
        min-height: calc(100vh - 55px);
    }

    .hero img {
        max-height: 45vh;
        padding: 10px;
    }

    .layout {
        flex-direction: column;
    }

    .content {
        padding: 15px;
    }

    .content-header h1 {
        font-size: 22px;
    }

    .grid {
        gap: 16px;
    }

    .card {
        padding: 16px;
    }

    .sidebar {
        display: none;
        position: fixed;
        top: 55px;
        left: 0;
        width: 100%;
        height: calc(100vh - 55px);
        background: #fff;
        z-index: 1000;
        padding: 20px;
    }

    .sidebar.active {
        display: block;
    }

    .filter-btn {
        display: block;
    }

    .close-filters {
        display: block;
    }

    .modal-box {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
        padding: 18px;
    }

    .modal-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .modal-image-wrapper img {
        max-height: 300px;
        object-fit: contain;
    }
}
