/*
 * Alfa Sport - Archive product / Shop
 * Diseño del catálogo principal y componentes compartidos con categorías.
 */

:root {
    --alfa-green: #003C32;
    --alfa-green-dark: #002A24;
    --alfa-green-soft: #0B5145;
    --alfa-red: #A61916;
    --alfa-ink: #15211E;
    --alfa-muted: #5F6764;
    --alfa-line: #DDDCD5;
    --alfa-paper: #F7F5F0;
    --alfa-white: #FFFFFF;
    --alfa-radius: 6px;
    --alfa-shadow: 0 10px 30px rgba(0, 25, 20, .08);
}

.alfa-shop,
.alfa-product-archive {
    width: 100%;
    min-width: 0;
    color: var(--alfa-ink);
    background: var(--alfa-paper);
    font-family: var(--alfa-font-primary, "Manrope", Arial, sans-serif);
}

.alfa-shop *,
.alfa-product-archive *,
.alfa-shop *::before,
.alfa-shop *::after,
.alfa-product-archive *::before,
.alfa-product-archive *::after {
    box-sizing: border-box;
}

.alfa-shop a,
.alfa-product-archive a {
    color: inherit;
}

.alfa-shop-container,
.alfa-product-archive__container {
    width: 100%;
    max-width: var(--alfa-container-wide);
    margin-inline: auto;
    padding-inline: var(--alfa-gutter);
}

/* Cabecera de tienda */
.alfa-shop-hero,
.alfa-product-archive__hero {
    padding-block: var(--alfa-space-2xl, 48px) var(--alfa-space-xl, 32px);
    border-bottom: 1px solid var(--alfa-line);
background: linear-gradient(90deg, rgba(0, 18, 14, .90) 0%, rgba(0, 18, 14, .65) 40%, rgba(0, 18, 14, .15) 100%), url(https://alfasport.es/wp-content/uploads/2026/09/alfasport-alfaromeo-2.png) center / cover no-repeat;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.alfa-shop-breadcrumb,
.alfa-product-archive__breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    color: var(--alfa-muted);
    font-size: 12px;
}

.alfa-shop-breadcrumb a,
.alfa-product-archive__breadcrumb a {
    text-decoration: none;
}

.alfa-shop-breadcrumb a:hover,
.alfa-product-archive__breadcrumb a:hover {
    color: var(--alfa-green);
    text-decoration: underline;
}

.alfa-shop-hero h1,
.alfa-product-archive__hero h1 {
    max-width: 850px;
    margin: 0;
    color: var(--alfa-line);
    font-size: clamp(38px, 5vw, 62px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -.045em;
}

.alfa-shop-hero p,
.alfa-product-archive__hero p {
    max-width: 720px;
    margin: 13px 0 0;
    color: var(--alfa-muted);
    font-size: 15px;
    line-height: 1.65;
}

/* Barra de catálogo */
.alfa-shop-catalogue,
.alfa-product-archive__catalogue {
    padding-block: var(--alfa-space-xl, 32px) var(--alfa-space-4xl, 80px);
}

.alfa-shop-toolbar,
.alfa-product-archive__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.alfa-shop-toolbar__search,
.alfa-product-archive__search {
    display: flex;
    flex: 1 1 520px;
    max-width: 620px;
    min-width: 0;
}

.alfa-shop-toolbar input[type='search'],
.alfa-shop-toolbar input[type='text'],
.alfa-product-archive__search input[type='search'],
.alfa-product-archive__search input[type='text'] {
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
    border: 1px solid #cbd5d1;
    border-radius: var(--alfa-radius) 0 0 var(--alfa-radius);
    background: var(--alfa-white);
    color: var(--alfa-ink);
    font: inherit;
    font-size: 13px;
}

.alfa-shop-toolbar button,
.alfa-product-archive__search button {
    min-width: 52px;
    border: 0;
    border-radius: 0 var(--alfa-radius) var(--alfa-radius) 0;
    background: var(--alfa-green);
    color: var(--alfa-white);
    cursor: pointer;
}

.alfa-shop-toolbar select,
.alfa-product-archive__toolbar select,
.woocommerce-ordering select {
    min-height: 46px !important;
    min-width: 190px;
    padding: 0 34px 0 13px;
    border: 1px solid #cbd5d1;
    border-radius: var(--alfa-radius);
    background: var(--alfa-white);
    color: var(--alfa-ink);
    font: inherit;
    font-size: 13px;
}

.alfa-shop-results,
.alfa-product-archive__results,
.woocommerce-result-count {
    margin: 0;
    color: var(--alfa-muted);
    font-size: 13px;
}

/* Layout lateral + productos */
.alfa-shop-layout,
.alfa-product-archive__layout {
    display: grid;
    grid-template-columns: 258px minmax(0, 1fr);
    grid-template-columns: 285px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.alfa-shop-filters,
.alfa-product-archive__filters {
    position: sticky;
    top: 20px;
    min-width: 0;
    padding: 18px 14px;
    border: 1px solid var(--alfa-line);
    border-radius: var(--alfa-radius);
    background: var(--alfa-white);
    box-shadow: var(--alfa-shadow);
}

.alfa-shop-filters form,
.alfa-product-archive__filters form {
    display: grid;
    gap: 10px;
}

.alfa-mobile-filters-toggle,
.alfa-shop-filters__close {
    display: none;
}

.alfa-shop-filters__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.alfa-shop-filters h2,
.alfa-shop-filters h3,
.alfa-product-archive__filters h2,
.alfa-product-archive__filters h3 {
    margin: 0;
    color: var(--alfa-green);
    font-family: var(--alfa-font-display, Georgia, 'Times New Roman', serif);
    font-size: 19px;
    margin-bottom: 10px;
}

.alfa-shop-filter summary, .alfa-product-archive__filter summary{
    margin:0px;
}


.alfa-product-archive__filter label:nth-of-type(1){
    margin-top:10px !important;
}

.alfa-shop-filter,
.alfa-product-archive__filter {
    min-width: 0;
    margin: 0;
    border: 0;
}

.alfa-shop-filter,
.alfa-product-archive__filter {
    padding: 15px 13px;
    border: 1px solid var(--alfa-border-light, #E8E6DF);
    border-radius: var(--alfa-radius-sm, 6px);
    background: rgba(247, 245, 240, .48);
}

.alfa-shop-filter summary,
.alfa-product-archive__filter summary {
    float: none;
    width: 100%;
    list-style: none;
    cursor: pointer;
}

.alfa-shop-filter summary::-webkit-details-marker,
.alfa-product-archive__filter summary::-webkit-details-marker {
    display: none;
}

.alfa-shop-filter summary::after,
.alfa-product-archive__filter summary::after {
    content: '+';
    float: right;
    color: var(--alfa-green);
    font-size: 19px;
    font-weight: 400;
    line-height: 1;
}

.alfa-shop-filter[open] summary::after,
.alfa-product-archive__filter[open] summary::after {
    content: '−';
}

.alfa-shop-filter:first-of-type,
.alfa-product-archive__filter:first-of-type {
    padding-top: 15px;
}

.alfa-shop-filter:last-child,
.alfa-product-archive__filter:last-child {
    border-bottom: 1px solid var(--alfa-border-light, #E8E6DF);
}

.alfa-shop-filter__title,
.alfa-product-archive__filter-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    color: var(--alfa-ink);
    font-size: 13px;
    font-weight: 700;
}

.alfa-shop-filter legend,
.alfa-product-archive__filter legend {
    float: left;
    width: 100%;
}

.alfa-shop-filter legend::after,
.alfa-product-archive__filter legend::after {
    content: '';
    display: block;
    clear: both;
}

.alfa-shop-filter input[type='search'],
.alfa-shop-filter input[type='text'],
.alfa-product-archive__filter input[type='search'],
.alfa-product-archive__filter input[type='text'] {
    width: 100%;
    min-height: 38px;
    margin-bottom: 10px;
    padding: 0 10px;
    border: 1px solid #d0d9d5;
    border-radius: 4px;
    background: var(--alfa-white);
    font: inherit;
    font-size: 12px;
}

.alfa-shop-filter label,
.alfa-product-archive__filter label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 0;
    color: #53615c;
    font-size: 12px;
    line-height: 1.35;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color var(--alfa-transition-fast, 160ms ease), color var(--alfa-transition-fast, 160ms ease);
}

.alfa-shop-filter label > span:not(.alfa-shop-filter__count),
.alfa-product-archive__filter label > span:not(.alfa-product-archive__filter-count) {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}

.alfa-shop-filter label:hover,
.alfa-product-archive__filter label:hover {
    background: var(--alfa-green-soft, #0B5145);
    color: var(--alfa-white, #fff);
}

.alfa-shop-filter input[type='checkbox'],
.alfa-shop-filter input[type='radio'],
.alfa-product-archive__filter input[type='checkbox'],
.alfa-product-archive__filter input[type='radio'] {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--alfa-green);
    cursor: pointer;
}

.alfa-shop-filter__count,
.alfa-product-archive__filter-count {
    margin-left: auto;
    color: #89948f;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.alfa-shop-filter__hint,
.alfa-product-archive__filter-hint {
    margin: 2px 0 0;
    color: var(--alfa-text-muted, #7B817E);
    font-size: 12px;
    line-height: 1.45;
}

.alfa-shop-filter__more,
.alfa-product-archive__filter-more {
    display: inline-block;
    margin-top: 7px;
    color: var(--alfa-green);
    font-size: 12px;
    text-decoration: underline;
}

.alfa-shop-filter__actions button,
.alfa-product-archive__filter-actions button {
    width: 100%;
    min-height: 42px;
    border: 0;
    border-radius: 4px;
    background: var(--alfa-green);
    color: var(--alfa-white);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.alfa-shop-filter__reset,
.alfa-product-archive__filter-reset {
    display: block;
    margin: 14px auto 0;
    color: var(--alfa-green);
    font-size: 12px;
    text-align: center;
    text-decoration: underline;
}

/* Grid y tarjetas WooCommerce */
.alfa-shop-products,
.alfa-product-archive__products {
    min-width: 0;
}

.alfa-shop-products ul.products,
.alfa-product-archive__products ul.products,
.woocommerce ul.products {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
}

.alfa-shop-products ul.products::before,
.alfa-shop-products ul.products::after,
.alfa-product-archive__products ul.products::before,
.alfa-product-archive__products ul.products::after,
.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none;
}

.alfa-shop-products ul.products li.product,
.alfa-product-archive__products ul.products li.product,
.woocommerce ul.products li.product {
    display: flex;
    flex-direction: column;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 10px 10px 12px;
    border: 1px solid var(--alfa-line);
    border-radius: var(--alfa-radius);
    background: var(--alfa-white);
    box-shadow: 0 3px 12px rgba(15, 48, 41, .04);
    transition: transform .2s ease, box-shadow .2s ease;
}

.alfa-shop-products ul.products li.product:hover,
.alfa-product-archive__products ul.products li.product:hover,
.woocommerce ul.products li.product:hover {
    transform: translateY(-3px);
    box-shadow: var(--alfa-shadow);
}

.alfa-shop-products ul.products li.product a img,
.alfa-product-archive__products ul.products li.product a img,
.woocommerce ul.products li.product a img {
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0 0 12px;
    object-fit: contain;
    background: #f7f9f8;
}

.alfa-shop-products ul.products li.product .woocommerce-loop-product__title,
.alfa-product-archive__products ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    min-height: 40px;
    margin: 0 0 6px;
    color: var(--alfa-ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.28;
}

.alfa-shop-products .price,
.alfa-product-archive__products .price,
.woocommerce ul.products li.product .price {
    margin: 0 0 8px;
    color: var(--alfa-red);
    font-size: 16px;
    font-weight: 800;
}

.alfa-shop-products .button,
.alfa-product-archive__products .button,
.woocommerce ul.products li.product .button {
    width: 100%;
    min-height: 38px;
    margin-top: auto;
    padding: 9px 10px;
    border: 0;
    border-radius: 4px;
    background: var(--alfa-green);
    color: var(--alfa-white);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
        display: flex;
    justify-content: center;
    align-items: center;
}

.alfa-shop-products .button:hover,
.alfa-product-archive__products .button:hover,
.woocommerce ul.products li.product .button:hover {
    background: var(--alfa-green-dark);
    color: var(--alfa-white);
}

.alfa-product-stock,
.alfa-shop-products .stock {
    margin: 0 0 9px;
    color: #168a39;
    font-size: 12px;
}

.alfa-product-stock.is-unavailable,
.alfa-shop-products .out-of-stock {
    color: #777;
}

/* Paginación y estados */
.alfa-shop-pagination,
.alfa-product-archive__pagination {
    margin-top: 28px;
    text-align: center;
}

.woocommerce-pagination{
    margin-top: 50px;
}

.alfa-shop-pagination .page-numbers,
.alfa-product-archive__pagination .page-numbers,
.woocommerce nav.woocommerce-pagination ul {
    display: inline-flex;
    gap: 5px;
    margin: 0;
    padding: 0;
    border: 0;
    list-style: none;
}

.alfa-shop-pagination a,
.alfa-shop-pagination span,
.alfa-product-archive__pagination a,
.alfa-product-archive__pagination span,
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    display: inline-grid;
    min-width: 34px;
    min-height: 34px;
    place-items: center;
    padding: 0 8px;
    border: 1px solid var(--alfa-line);
    border-radius: 4px;
    background: var(--alfa-white);
    color: var(--alfa-ink);
    font-size: 12px;
    text-decoration: none;
}

.alfa-shop-pagination .current,
.alfa-product-archive__pagination .current,
.woocommerce nav.woocommerce-pagination ul li span.current {
    border-color: var(--alfa-green);
    background: var(--alfa-green);
    color: var(--alfa-white);
}

.alfa-shop-empty,
.alfa-product-archive__empty {
    padding: 60px 25px;
    border: 1px solid var(--alfa-line);
    background: var(--alfa-white);
    text-align: center;
}

/* Responsive */
@media (max-width: 1120px) {
    .alfa-shop-products ul.products,
    .alfa-product-archive__products ul.products,
    .woocommerce ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .alfa-shop-container,
    .alfa-product-archive__container {
        padding-inline: var(--alfa-gutter-tablet, 28px);
    }

    .alfa-shop-toolbar,
    .alfa-product-archive__toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .alfa-shop-toolbar__search,
    .alfa-product-archive__search {
        max-width: none;
        flex-basis: auto;
    }

    .alfa-shop-toolbar select,
    .alfa-product-archive__toolbar select,
    .woocommerce-ordering select {
        width: 100%;
    }

}

@media (max-width: 767px) {
    body.alfa-filters-lock {
        overflow: hidden;
    }

    .alfa-shop::before {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 1000;
        background: rgba(0, 31, 26, .52);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--alfa-transition, 250ms ease);
    }

    .alfa-shop.is-filters-open::before {
        opacity: 1;
        pointer-events: auto;
    }

    .alfa-mobile-filters-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 9px;
        width: 100%;
        min-height: 46px;
        margin: 0 0 14px;
        border: 1px solid var(--alfa-green);
        border-radius: var(--alfa-radius-sm, 6px);
        background: var(--alfa-green);
        color: var(--alfa-white);
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
    }

    .alfa-shop-layout,
    .alfa-product-archive__layout {
        display: block;
    }

    .alfa-shop-filters,
    .alfa-product-archive__filters {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1001;
        display: block;
        width: min(94vw, 390px);
        height: 100dvh;
        max-height: none;
        margin: 0;
        padding: 22px 18px 34px;
        overflow-y: auto;
        border: 0;
        border-radius: 0;
        box-shadow: 12px 0 35px rgba(0, 31, 26, .2);
        transform: translateX(-105%);
        transition: transform var(--alfa-transition, 250ms ease);
    }

    .alfa-shop-filters__heading,
    .alfa-product-archive__filters .alfa-shop-filters__heading {
        position: sticky;
        top: -22px;
        z-index: 2;
        margin: -22px -18px 4px;
        padding: 18px;
        border-bottom: 1px solid var(--alfa-border-light, #E8E6DF);
        background: var(--alfa-white, #fff);
    }

    .alfa-shop-filter,
    .alfa-product-archive__filter {
        padding: 16px 13px;
        background: var(--alfa-bg, #F7F5F0);
    }

    .alfa-shop-filter:nth-of-type(1),
    .alfa-shop-filter:nth-of-type(2),
    .alfa-product-archive__filter:nth-of-type(1),
    .alfa-product-archive__filter:nth-of-type(2) {
        max-height: 310px;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--alfa-green) transparent;
    }

    .alfa-shop.is-filters-open .alfa-shop-filters,
    .alfa-shop.is-filters-open .alfa-product-archive__filters {
        transform: translateX(0);
    }

    .alfa-shop-filters__close {
        display: inline-grid;
        width: 34px;
        height: 34px;
        place-items: center;
        border: 1px solid var(--alfa-border, #DDDCD5);
        border-radius: 50%;
        background: transparent;
        color: var(--alfa-green);
        font-size: 24px;
        line-height: 1;
        cursor: pointer;
    }

    .alfa-shop-products ul.products,
    .alfa-product-archive__products ul.products,
    .woocommerce ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
    }

    .alfa-shop-products ul.products li.product,
    .alfa-product-archive__products ul.products li.product,
    .woocommerce ul.products li.product {
        width: auto !important;
        float: none !important;
        margin: 0 !important;
    }
    .alfa-shop-hero,
    .alfa-product-archive__hero {
        padding-block: var(--alfa-space-xl, 32px) var(--alfa-space-lg, 24px);
    }

    .alfa-shop-hero h1,
    .alfa-product-archive__hero h1 {
        font-size: 40px;
    }

    .alfa-shop-products ul.products,
    .alfa-product-archive__products ul.products,
    .woocommerce ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .alfa-shop-products ul.products li.product,
    .alfa-product-archive__products ul.products li.product,
    .woocommerce ul.products li.product {
        padding: 7px 7px 9px;
    }

    .alfa-shop-products ul.products li.product .woocommerce-loop-product__title,
    .alfa-product-archive__products ul.products li.product .woocommerce-loop-product__title,
    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        min-height: 48px;
        font-size: 12px;
    }

    .alfa-shop-products .price,
    .alfa-product-archive__products .price,
    .woocommerce ul.products li.product .price {
        font-size: 14px;
    }

    .alfa-shop-hero, .alfa-product-archive__hero{
        align-items: flex-end;
    }   
}

@media (max-width: 480px) {
    .alfa-shop-container,
    .alfa-product-archive__container {
        padding-inline: var(--alfa-gutter-mobile, 20px);
    }

    .alfa-shop-products ul.products,
    .alfa-product-archive__products ul.products,
    .woocommerce ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

.woocommerce-breadcrumb{
    display: none;
}