/* ================================
   TITLE BAR
================================ */

.products-bar{
    width:100%;
    max-width:1600px;
    margin:20px auto;
    padding:0 32px;
    box-sizing:border-box;
}

.products-bar-text{
    width:100%;
    padding:14px 32px;
    min-height:65px;
    display:flex;
    align-items:center;
    background:#0aa64f;
    color:#fff;
    font-size:28px;
    border-radius:20px;
    box-sizing:border-box;
}


/* ================================
   SHOPBAR
================================ */

.products-shopbar{
    max-width:1600px;
    margin:14px auto 22px;
    padding:0 32px;
    box-sizing:border-box;
}

.products-shopbar-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    flex-wrap:wrap;
}


/* SEARCH */

.products-search{
    flex:1;
    min-width:0;
    height:44px;
    border:2px solid #0b78c6;
    border-radius:999px;
    background:#fff;
    display:flex;
    align-items:center;
    gap:10px;
    padding:0 16px;
    box-sizing:border-box;
}

.products-search-input{
    width:100%;
    min-width:0;
    border:0;
    outline:none;
    background:transparent;
    font-size:16px;
}

.products-search-submit{
    flex-shrink:0;
    width:30px;
    height:30px;
    border-radius:50%;
    border:0;
    background:#0b78c6;
    color:#fff;
    font-size:15px;
    font-weight:700;
    cursor:pointer;
    display:grid;
    place-items:center;
    line-height:1;
    padding:0;
}


/* ACTIONS */

.products-actions{
    display:flex;
    align-items:center;
    gap:14px;
    flex-wrap:wrap;
}


/* SELECT */

.products-category-select{
    min-width:200px;
    height:44px;
    border:2px solid #0b78c6;
    border-radius:999px;
    padding:0 42px 0 18px;
    font-size:16px;
    font-weight:600;
    color:#0b78c6;
    background:#fff;
    appearance:none;
    cursor:pointer;
    box-sizing:border-box;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath fill='%230b78c6' d='M7 10l5 5l5-5z'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 14px center;
}


/* CART */

.products-cart{
    width:54px;
    height:54px;
    display:grid;
    place-items:center;
    position:relative;
    flex-shrink:0;
}

.products-cart img{
    width:52px;
    height:52px;
    display:block;
}

.products-cart-badge{
    position:absolute;
    top:-2px;
    right:-2px;
    min-width:22px;
    height:22px;
    padding:0 6px;
    background:#0aa64f;
    color:#fff;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:12px;
    font-weight:900;
}


/* ================================
   PRODUCTS GRID (DESKTOP)
================================ */

.products-grid{
    width:100%;
    max-width:1600px;
    margin:0 auto;
    padding:0 32px;
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:40px;
    box-sizing:border-box;
    align-items:stretch;
}

.products-grid > *{
    min-width:0;
    height:100%;
}


/* ================================
   PAGER
================================ */

.products-pager-wrap{
    width:100%;
    margin:30px 0 0;
    display:flex;
    justify-content:center;
    padding:30px 0 50px;
}

.products-pager{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
    justify-content:center;
}

.products-pager-btn{
    width:32px;
    height:32px;
    border-radius:999px;
    background:#0b78c6;
    border:1px solid #0b78c6;
    display:grid;
    place-items:center;
    font-size:14px;
    font-weight:900;
    text-decoration:none;
    cursor:pointer;
    box-shadow:0 8px 20px rgba(0,0,0,.12);
    color:#fff;
}

.products-pager-btn:hover{
    transform:translateY(-1px);
}

.products-pager-btn.is-disabled{
    opacity:.4;
    pointer-events:none;
}


/* ================================
   FILTERS ROW
================================ */

.products-filters-row{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:10px;
    margin-top:12px;
}

.products-filter-select{
    height:38px;
    border:1.5px solid #cbd5e1;
    border-radius:999px;
    padding:0 38px 0 16px;
    font-size:14px;
    font-weight:500;
    color:#374151;
    background:#fff;
    appearance:none;
    cursor:pointer;
    box-sizing:border-box;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cpath fill='%2394a3b8' d='M5 8l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 12px center;
    transition:border-color .2s, box-shadow .2s;
}

.products-filter-select:focus{
    outline:none;
    border-color:#0b78c6;
    box-shadow:0 0 0 3px rgba(11,120,198,.10);
}

.products-filter-select.is-active{
    border-color:#0b78c6;
    color:#0b78c6;
    font-weight:700;
}

.products-filter-clear{
    height:38px;
    display:inline-flex;
    align-items:center;
    padding:0 16px;
    border:1.5px solid #fca5a5;
    border-radius:999px;
    font-size:13px;
    font-weight:600;
    color:#dc2626;
    background:#fff;
    text-decoration:none;
    white-space:nowrap;
    box-sizing:border-box;
}


/* ================================
   SELECT ESTADO ACTIVO (filtro aplicado)
================================ */

.products-category-select.is-active {
    border-color: #0aa64f;
    color: #0aa64f;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath fill='%230aa64f' d='M7 10l5 5l5-5z'/%3E%3C/svg%3E");
}


/* ================================
   BOTÓN FILTROS (desktop)
   Mismo tamaño que adminFiltros__btnMas
================================ */

.products-btn-mas-filtros {
    height: 44px;
    padding: 0 18px;
    border: 2px solid #bfdbfe;
    border-radius: 999px;
    background: transparent;
    color: #0b78c6;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
    transition: background .15s, border-color .15s;
}

.products-btn-mas-filtros:hover,
.products-btn-mas-filtros.is-active {
    border-color: #0b78c6;
    background: #eff6ff;
}

.products-btn-mas-filtros__badge {
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #0b78c6;
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}


/* ================================
   BOTÓN FILTROS MOBILE
================================ */

.products-btn-filtros-mobile {
    display: none; /* visible solo en mobile — ver media query */
    height: 44px;
    padding: 0 18px;
    border: 2px solid #0b78c6;
    border-radius: 999px;
    background: #fff;
    color: #0b78c6;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.products-btn-filtros-mobile__badge {
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #0aa64f;
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}


/* ================================
   PANEL AVANZADO DESKTOP (clasificadores)
   Grid de columnas iguales — mismo patrón visual que adminFiltros__avanzados
================================ */

.products-filtros-avanzados {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.products-filtros-avanzados.is-open {
    display: grid;
}


/* select del panel avanzado — alineado con adminFiltros__select--avz */
.products-filtros-avanzados .products-filter-select {
    height: 44px;
    width: 100%;           /* ocupa toda la celda del grid */
    min-width: 0;          /* no desborda la columna */
    border: 2px solid #0b78c6;
    border-radius: 999px;
    padding: 0 32px 0 16px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background-color: #fff;
    appearance: none;
    cursor: pointer;
    box-sizing: border-box;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath fill='%230b78c6' d='M4 7l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color .15s;
}

.products-filtros-avanzados .products-filter-select:focus {
    border-color: #0b78c6;
    outline: none;
}

.products-filtros-avanzados .products-filter-select.is-active {
    border-color: #0b78c6;
    color: #0b78c6;
    font-weight: 700;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Cpath fill='%230b78c6' d='M4 7l5 5 5-5z'/%3E%3C/svg%3E");
}

.products-filtros-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.products-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #1d4ed8;
    white-space: nowrap;
}

.products-chip__remove {
    color: #6b7280;
    text-decoration: none;
    font-size: 12px;
    line-height: 1;
    flex-shrink: 0;
}

.products-chip__remove:hover {
    color: #dc2626;
}


/* ================================
   BOTTOM-SHEET MOBILE
================================ */

.products-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1100;
}

.products-sheet-overlay.is-active {
    display: block;
}

.products-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1101;
    background: #fff;
    border-radius: 20px 20px 0 0;
    max-height: 88vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.32,.72,0,1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.products-sheet.is-open {
    transform: translateY(0);
}

.products-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #f1f5f9;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.products-sheet__title {
    font-size: 17px;
    font-weight: 800;
    color: #1f2937;
}

.products-sheet__close {
    width: 32px;
    height: 32px;
    border: 0;
    background: #f1f5f9;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: grid;
    place-items: center;
    color: #374151;
}

.products-sheet__close:hover {
    background: #e2e8f0;
}

.products-sheet__body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.products-sheet__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.products-sheet__label {
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.products-filter-select--full {
    width: 100%;
    border-radius: 12px;
    height: 46px;
    font-size: 15px;
}

.products-search--sheet {
    border-radius: 12px;
    height: 46px;
    border-color: #d1d5db;
}

.products-sheet__footer {
    display: flex;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    margin-top: 4px;
}

.products-sheet__btn {
    flex: 1;
    height: 48px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.products-sheet__btn--clear {
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid #cbd5e1;
}

.products-sheet__btn--clear:hover {
    background: #e2e8f0;
}

.products-sheet__btn--apply {
    background: #0b78c6;
    color: #fff;
}

.products-sheet__btn--apply:hover {
    background: #095fa3;
}


/* ================================
   TABLET
   768px - 1024px
================================ */

@media (min-width:768px) and (max-width:1024px){

    .products-bar{
        padding:0 24px;
    }

    .products-bar-text{
        font-size:24px;
        padding:14px 24px;
        border-radius:18px;
    }

    .products-shopbar{
        padding:0 24px;
    }

    .products-shopbar-row{
        display:grid;
        grid-template-columns:1fr auto;
        gap:12px;
        align-items:center;
    }

    .products-search{
        height:44px;
    }

    .products-search-input{
        font-size:15px;
    }

    .products-actions{
        gap:10px;
        justify-content:flex-end;
    }

    .products-category-select{
        min-width:180px;
        font-size:15px;
    }

    .products-cart{
        width:50px;
        height:50px;
    }

    .products-cart img{
        width:48px;
        height:48px;
    }

    .products-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
        gap:28px;
        padding:0 24px;
        align-items:stretch;
    }

    .products-grid > *{
        min-width:0;
        height:100%;
    }

    .products-filters-row{
        gap:10px;
    }

    .products-filter-select{
        flex:0 1 auto;
        min-width:150px;
    }
}


/* ================================
   MOBILE
   0px - 767px
================================ */

@media (max-width:767px){

    /* Mostrar botón mobile, ocultar elementos desktop */
    .products-btn-filtros-mobile {
        display: inline-flex;
    }

    .products-btn-mas-filtros,
    .products-filtros-avanzados {
        display: none !important;
    }

    .products-bar{
        padding:0 16px;
    }

    .products-bar-text{
        font-size:20px;
        padding:12px 16px;
        text-align:center;
        justify-content:center;
        border-radius:14px;
    }

    .products-shopbar{
        padding:0 16px;
    }

    .products-shopbar-row{
        flex-direction:column;
        align-items:stretch;
        gap:12px;
    }

    .products-search{
        width:100%;
        max-width:none;
    }

    .products-search-input{
        font-size:14px;
    }

    .products-actions{
        display:flex;
        align-items:center;
        gap:10px;
    }

    .products-category-select{
        flex:1;
        min-width:0;
        width:100%;
        font-size:14px;
    }

    .products-cart{
        flex-shrink:0;
        width:48px;
        height:48px;
    }

    .products-cart img{
        width:100%;
        height:100%;
    }

    .products-grid{
        grid-template-columns:1fr;
        gap:20px;
        padding:0 16px;
        align-items:stretch;
    }

    .products-grid > *{
        min-width:0;
        height:100%;
    }

    .products-filters-row{
        gap:8px;
    }

    .products-filter-select{
        flex:1 1 calc(50% - 8px);
        min-width:140px;
    }

    .products-filter-clear{
        flex:1 1 100%;
        justify-content:center;
    }

    .products-pager-wrap{
        padding:24px 0 40px;
    }
}


/* ================================
   MOBILE PEQUEÑO
   0px - 480px
================================ */

@media (max-width:480px){

    .products-actions{
        gap:8px;
    }

    .products-cart{
        width:44px;
        height:44px;
    }

    .products-filter-select{
        flex:1 1 100%;
        min-width:0;
    }
}
