/* ── Mateo Shop — Public CSS ── */

/* ── Wrapper ── */
.ms-shop-wrapper {
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif;
}

/* ══════════════════════════════════════════════
   FILTER BAR — minimal
══════════════════════════════════════════════ */

.ms-filter-bar {
    margin-bottom: 32px;
}

.ms-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #111;
    border-radius: 0;
    padding: 4px 0;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #111;
    cursor: pointer;
    transition: opacity .2s;
    box-shadow: none;
}
.ms-filter-toggle:hover { opacity: .55; }
.ms-filter-toggle:active { opacity: .35; }

.ms-filter-count {
    background: #111;
    color: #fff;
    border-radius: 20px;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 500;
    min-width: 18px;
    text-align: center;
    letter-spacing: 0;
}

.ms-toggle-arrow {
    font-size: 8px;
    transition: transform .25s;
    opacity: .5;
}
.ms-filter-toggle[aria-expanded="true"] .ms-toggle-arrow {
    transform: rotate(180deg);
}

/* Filter panel */
.ms-filter-panel {
    background: transparent;
    border: none;
    border-top: 1px solid #e5e5e5;
    border-radius: 0;
    box-shadow: none;
    margin-top: 16px;
    overflow: visible;
}

.ms-filter-inner {
    padding: 20px 0 4px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 3-column row */
.ms-filter-cols {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px 40px;
    align-items: start;
}

.ms-filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Right column stacks talle + color + ofertas */
.ms-filter-group--right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ms-filter-subgroup {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Solo ofertas row inside right col */
.ms-filter-sale-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 4px;
}
.ms-filter-sale-row .ms-filter-label { margin: 0; }

.ms-filter-label {
    font-size: 10px;
    font-weight: 400;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

/* Search */
.ms-filter-search {
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 20px;
}
.ms-search-wrap { position: relative; max-width: 400px; }
.ms-search-input {
    width: 100%;
    padding: 8px 36px 8px 0;
    border: none;
    border-bottom: 1px solid #d0d0d0;
    border-radius: 0;
    font-size: 13px;
    color: #111;
    background: transparent;
    box-shadow: none;
    outline: none;
    box-sizing: border-box;
    transition: border-color .2s;
    letter-spacing: .2px;
}
.ms-search-input::placeholder { color: #bbb; }
.ms-search-input:focus { border-color: #111; }
.ms-search-icon {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
    pointer-events: none;
}

/* Chips — minimal pills */
.ms-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ms-chip {
    background: transparent;
    color: #888;
    border: 1px solid #ddd;
    border-radius: 2px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: .6px;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap;
}
.ms-chip:hover {
    border-color: #999;
    color: #111;
}
.ms-chip--active {
    background: #111;
    color: #fff;
    border-color: #111;
}
.ms-chip--active .ms-chip-count {
    background: rgba(255,255,255,.25);
    color: #fff;
}

/* Count badge inside chip */
.ms-chip-count {
    display: inline-block;
    background: #e5e7eb;
    color: #6b7280;
    border-radius: 20px;
    padding: 0 6px;
    font-size: 10px;
    font-weight: 500;
    line-height: 16px;
    letter-spacing: 0;
    margin-left: 3px;
    vertical-align: middle;
    transition: background .15s, color .15s;
}

/* Toggle — minimal */
.ms-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}
.ms-toggle input { opacity: 0; width: 0; height: 0; }
.ms-toggle-slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #e5e5e5;
    border-radius: 20px;
    border: none;
    transition: background .2s;
}
.ms-toggle-slider:before {
    position: absolute; content: "";
    height: 14px; width: 14px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .2s;
}
.ms-toggle input:checked + .ms-toggle-slider { background: #111; }
.ms-toggle input:checked + .ms-toggle-slider:before { transform: translateX(16px); }

/* Clear filters */
.ms-filter-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}
.ms-btn-clear {
    background: none;
    border: none;
    padding: 4px 0;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #aaa;
    cursor: pointer;
    transition: color .2s;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.ms-btn-clear:hover { color: #111; }

/* ══════════════════════════════════════════════
   PRODUCTS GRID
══════════════════════════════════════════════ */

.ms-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px 24px;
}

/* ── Product card ── */
.ms-product-card {
    display: flex;
    flex-direction: column;
}

.ms-product-image-wrap {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 3/4;
    background: #f7f7f7;
    text-decoration: none;
    margin-bottom: 14px;
}

/* Primary / hover images */
.ms-img-primary,
.ms-img-hover {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity .4s ease;
}
.ms-img-hover { opacity: 0; }
.ms-product-image-wrap:hover .ms-img-primary { opacity: 0; }
.ms-product-image-wrap:hover .ms-img-hover   { opacity: 1; }

/* Sale badge — top RIGHT */
.ms-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    left: auto;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 2px;
    z-index: 2;
    line-height: 1;
}
.ms-badge--sale {
    background: #111;
    color: #fff;
}

/* Product info */
.ms-product-info {
    text-align: center;
}
.ms-product-title {
    margin: 0 0 5px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    color: #111;
    letter-spacing: .2px;
}
.ms-product-title a {
    color: inherit;
    text-decoration: none;
}
.ms-product-title a:hover { opacity: .6; }

.ms-product-price {
    font-size: 12px;
    color: #555;
    letter-spacing: .2px;
}
.ms-product-price del {
    color: #bbb;
    font-size: 11px;
    margin-right: 4px;
}
.ms-product-price ins {
    text-decoration: none;
}

/* No products */
.ms-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: #bbb;
    font-size: 13px;
    letter-spacing: .5px;
}

/* ── Loading ── */
.ms-loading-spinner {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}
.ms-spinner {
    width: 20px; height: 20px;
    border: 1.5px solid #e5e5e5;
    border-top-color: #999;
    border-radius: 50%;
    animation: ms-spin .8s linear infinite;
}
@keyframes ms-spin { to { transform: rotate(360deg); } }

/* No more */
.ms-no-more {
    text-align: center;
    padding: 32px 0;
    font-size: 10px;
    color: #ccc;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ══════════════════════════════════════════════
   MOBILE
══════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .ms-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 32px 20px;
    }
    .ms-filter-cols {
        grid-template-columns: 1fr 1fr;
    }
    /* Right col moves to its own row full width */
    .ms-filter-group--right {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 24px;
        align-items: flex-start;
    }
    .ms-filter-subgroup { flex: 1; min-width: 140px; }
    .ms-filter-sale-row { flex: 0 0 auto; align-self: flex-end; padding-top: 0; }
}

@media (max-width: 768px) {
    .ms-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px 12px;
    }
    .ms-filter-cols {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .ms-filter-group--right {
        grid-column: 1;
        flex-direction: column;
        gap: 16px;
    }
    .ms-filter-subgroup { min-width: unset; }
    .ms-search-wrap { max-width: 100%; }
    .ms-filter-sale-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .ms-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 10px;
    }
    .ms-product-title { font-size: 11px; }
    .ms-product-price { font-size: 11px; }
}
