/**
 * Shop CSS
 * Shop page and product taxonomy archive styles
 * Mobile-first: default → 768px tablet → 1024px desktop
 */

/* ============================================================
   PAGE BACKGROUND
   ============================================================ */

body.woocommerce-shop,
body.tax-product_cat,
body.tax-age-group,
body.tax-areas,
body.tax-schedule,
body.post-type-archive-product {
    background-color: var(--color-bg-light-blue);
}

/* ============================================================
   SHOP MAP
   ============================================================ */

#product-map {
    width: 100%;
    height: 260px;
    border-radius: 0;
    margin-bottom: 0;
}

@media (min-width: 768px) {
    #product-map {
        height: 300px;
    }
}

/* Ensure slide-out filter sidebar stays above map */
.ast-off-canvas-overlay,
.ast-off-canvas-sidebar {
    z-index: 1001 !important;
}

/* Map tooltip — orange pill label */
.leaflet-tooltip {
    background-color: var(--color-orange);
    border: none;
    border-radius: var(--radius-button);
    padding: 5px 12px;
    font-size: 12px;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-white);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.leaflet-tooltip::before {
    display: none;
}

#product-map,
.leaflet-container {
    pointer-events: auto !important;
}

/* ============================================================
   FILTER SIDEBAR — WPC Filters widget
   ============================================================ */

/* White card wrapper */
.ast-filter-wrap .wpc-filters-widget-content {
    background-color: var(--color-white);
    border-radius: var(--radius-card);
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* "Filters" open/close toggle button */
.wpc-open-close-filters-button {
    background-color: var(--color-white);
    color: var(--color-indigo);
    border-radius: var(--radius-button);
    padding: 10px 20px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    border: 2px solid var(--color-indigo);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.wpc-open-close-filters-button:hover {
    background-color: var(--color-indigo);
    color: var(--color-white);
}

/* Filter section groups */
.wpc-filters-section {
    border-bottom: 1px solid var(--color-border-light);
    padding: 12px 0;
}

.wpc-filters-section:last-of-type {
    border-bottom: none;
}

/* Filter group header label */
.wpc-filter-title button {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    color: var(--color-indigo);
    text-align: left;
}

.wpc-filter-title button:hover {
    color: var(--color-cyan);
}

/* Filter option labels */
.wpc-filter-link {
    color: var(--color-body-text);
    text-decoration: none;
    font-size: 13px;
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
}

.wpc-filter-link:hover {
    color: var(--color-indigo);
    text-decoration: none;
}

/* Active/checked filter */
.wpc-filter-link.wpc-active,
.wpc-filter-link.wpc-selected {
    color: var(--color-orange);
    font-weight: 600;
}

/* Filter counts */
.wpc-filter-count {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* Chip/tag active filters */
.wpc-filter-chips-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

body .wpc-filter-chips-list li.wpc-filter-chip {
    background-color: var(--color-cyan) !important;
    color: var(--color-white) !important;
    border-radius: var(--radius-button) !important;
    padding: 4px 12px !important;
    font-size: 12px !important;
    font-family: var(--font-heading) !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    cursor: pointer;
}

body .wpc-filter-chips-list li.wpc-filter-chip a {
    color: var(--color-white) !important;
    text-decoration: none !important;
    border: none !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    font-family: var(--font-heading) !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    display: inline;
}

body .wpc-filter-chips-list li.wpc-filter-chip a:hover {
    text-decoration: none !important;
    color: var(--color-white) !important;
}

body .wpc-filter-chips-list li.wpc-filter-chip:hover {
    background-color: var(--color-cyan-dark) !important;
}

.wpc-filter-chips-list .wpc-chip-reset-all,
.wpc-filter-chips-list .wpc-chip-reset-all a {
    background-color: var(--color-indigo);
    border: none;
    border-color: transparent !important;
    outline: none;
    box-shadow: none;
}

.wpc-filter-chips-list .wpc-chip-reset-all:hover,
.wpc-filter-chips-list .wpc-chip-reset-all a:hover {
    background-color: #1a1043;
}

.wpc-chip-remove-icon {
    margin-left: 6px;
}

/* ============================================================
   RESULT COUNT & ORDERING
   ============================================================ */

.woocommerce-result-count {
    font-family: var(--font-body);
    color: var(--color-body-text);
    font-size: 13px;
}

.woocommerce-ordering select {
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-button);
    padding: 8px 14px;
    font-family: var(--font-body);
    color: var(--color-body-text);
    font-size: 13px;
    background-color: var(--color-white);
}

/* ============================================================
   PRODUCT GRID — mobile-first
   ============================================================ */

/* 1 column on mobile */
.woocommerce ul.products,
.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    width: 100% !important;
}

/* 2 columns at 768px */
@media (min-width: 768px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* 3 columns at 1024px */
@media (min-width: 1024px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* ============================================================
   PRODUCT CARDS — default state
   ============================================================ */

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    background-color: var(--color-white);
    border-radius: var(--radius-card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    float: none !important;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
    position: relative;
}

/* ---- Card image ---- */
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap,
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap {
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    background-color: var(--color-bg-grey);
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap a,
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap a {
    display: block;
}

.woocommerce ul.products li.product .astra-shop-thumbnail-wrap img,
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
}

/* Placeholder image — maintain same aspect ratio */
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap img.woocommerce-placeholder,
.woocommerce-page ul.products li.product .astra-shop-thumbnail-wrap img.woocommerce-placeholder {
    object-fit: contain;
    padding: 24px;
    background-color: var(--color-bg-grey);
}

/* Hide Astra's on-card basket overlay — Learn More replaces this */
.ast-on-card-button {
    display: none !important;
}

/* ---- Card summary body ---- */
.woocommerce ul.products li.product .astra-shop-summary-wrap,
.woocommerce-page ul.products li.product .astra-shop-summary-wrap {
    padding: 0 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ---- Product title link — remove default link style ---- */
.woocommerce ul.products li.product a.ast-loop-product__link,
.woocommerce-page ul.products li.product a.ast-loop-product__link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* ---- Price (output via hook before title) ---- */
.woocommerce ul.products li.product .so-loop-price {
    display: block;
    margin: 12px 0 4px;
}

.woocommerce ul.products li.product .so-loop-price .woocommerce-Price-amount,
.woocommerce ul.products li.product .so-loop-price .woocommerce-Price-amount bdi {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
    color: var(--color-indigo);
}

/* ---- Product title ---- */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce-page ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 17px;
    color: var(--color-indigo);
    margin: 0 0 8px;
    line-height: 1.3;
}

/* ---- Short description ---- */
.woocommerce ul.products li.product .ast-woo-shop-product-description,
.woocommerce-page ul.products li.product .ast-woo-shop-product-description {
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.woocommerce ul.products li.product .ast-woo-shop-product-description p,
.woocommerce-page ul.products li.product .ast-woo-shop-product-description p {
    color: var(--color-body-text);
    margin: 0;
}

/* ---- Learn More CTA wrapper + button ---- */
.so-learn-more-wrap {
    padding: 12px 0 16px;
    margin-top: auto;
}

.woocommerce ul.products li.product .so-learn-more-btn,
.woocommerce-page ul.products li.product .so-learn-more-btn {
    display: block !important;
    width: 100% !important;
    padding: 11px 20px !important;
    text-align: center !important;
    background-color: var(--color-orange) !important;
    color: var(--color-white) !important;
    border-radius: var(--radius-button) !important;
    font-family: var(--font-heading) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    text-decoration: none !important;
    border: none !important;
    box-sizing: border-box !important;
    transition: opacity 0.2s ease !important;
}

.woocommerce ul.products li.product .so-learn-more-btn:hover,
.woocommerce-page ul.products li.product .so-learn-more-btn:hover {
    opacity: 0.88 !important;
    color: var(--color-white) !important;
    text-decoration: none !important;
}

/* ============================================================
   CARD HOVER — SELECTED / ACTIVE STATE
   ============================================================ */

.woocommerce ul.products li.product:hover,
.woocommerce-page ul.products li.product:hover {
    background-color: var(--color-indigo);
    box-shadow: 0 4px 16px rgba(35, 21, 89, 0.25);
}

.woocommerce ul.products li.product:hover .woocommerce-loop-product__title,
.woocommerce-page ul.products li.product:hover .woocommerce-loop-product__title {
    color: var(--color-white);
}

.woocommerce ul.products li.product:hover .ast-woo-shop-product-description,
.woocommerce ul.products li.product:hover .ast-woo-shop-product-description p,
.woocommerce-page ul.products li.product:hover .ast-woo-shop-product-description,
.woocommerce-page ul.products li.product:hover .ast-woo-shop-product-description p {
    color: rgba(255, 255, 255, 0.85);
}

.woocommerce ul.products li.product:hover .so-loop-price .woocommerce-Price-amount,
.woocommerce ul.products li.product:hover .so-loop-price .woocommerce-Price-amount bdi,
.woocommerce-page ul.products li.product:hover .so-loop-price .woocommerce-Price-amount,
.woocommerce-page ul.products li.product:hover .so-loop-price .woocommerce-Price-amount bdi {
    color: var(--color-white);
}

/* Button inverts on card hover */
.woocommerce ul.products li.product:hover .so-learn-more-btn,
.woocommerce-page ul.products li.product:hover .so-learn-more-btn {
    background-color: var(--color-white) !important;
    color: var(--color-indigo) !important;
    opacity: 1 !important;
}

/* ============================================================
   PAGINATION — "View More" button
   ============================================================ */

.so-view-more-pagination {
    text-align: center;
    margin: 32px 0;
}

.so-view-more-btn {
    display: inline-block;
    padding: 12px 36px;
    border-radius: var(--radius-button);
    border: 2px solid var(--color-indigo);
    color: var(--color-indigo);
    background-color: transparent;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.so-view-more-btn:hover {
    background-color: var(--color-indigo);
    color: var(--color-white);
    text-decoration: none;
}
