/* =================================
   SHOP PAGE — FlexiPets branded
   Product cards: css/fp-v3-offers.css
   Layout shell: css/fp-shop-layout.css
   ================================= */

/* Hide default WC archive header (custom intro in fp-shop.php) */
.woocommerce-products-header {
    display: none;
}

/* Product grid — FlexiPets offer grid inside shop content */
body.fp-shop-page .fp-shop-content ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)) !important;
    justify-content: flex-start !important;
    gap: 18px !important;
    clear: both !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none;
    width: 100%;
    min-width: 0;
}

/* Card wrapper: inner .fp-v3-offer carries the visual style */
body.fp-shop-page .fp-shop-content ul.products li.product.fp-shop-card {
    width: 100% !important;
    min-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: none !important;
    overflow: visible;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

body.fp-shop-page .fp-shop-content ul.products li.product.fp-shop-card:hover {
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
}

body.fp-shop-page .fp-shop-content ul.products li.product.fp-shop-card .onsale {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    min-width: auto;
    min-height: auto;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ff72b6, #ff4c98);
    color: #fff;
    font-family: 'Baloo 2', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    box-shadow: 0 6px 14px rgba(255, 76, 152, 0.25);
}

body.fp-shop-page .fp-shop-content ul.products li.product.fp-shop-card .fp-shop-offer {
    position: relative;
}

/* Toolbar: result count + collapsible filters/sorting */
body.fp-shop-page .fp-shop-content .fp-shop-toolbar,
body.fp-shop-page .fp-shop-content .woocommerce-before-shop-loop {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin-bottom: 36px;
    padding: 14px 16px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 250, 245, 0.82) 100%);
    border: 1px solid rgba(139, 92, 246, 0.14);
    box-shadow: 0 10px 24px rgba(91, 53, 138, 0.07);
    overflow: hidden;
}

body.fp-shop-page .fp-shop-content .fp-shop-toolbar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    width: 100%;
}

body.fp-shop-page .fp-shop-content .woocommerce-result-count {
    flex: 0 1 auto;
    order: unset;
    margin: 0 !important;
    font-family: 'Baloo 2', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 800;
    color: #4b5060;
}

body.fp-shop-page .fp-shop-content .fp-shop-toolbar-toggle {
    flex: 0 0 auto;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px 0 14px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 999px;
    background: #fff;
    color: #342952;
    font-family: 'Baloo 2', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(91, 53, 138, 0.07);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

body.fp-shop-page .fp-shop-content .fp-shop-toolbar-toggle__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.1);
    color: #6d4bd1;
}

body.fp-shop-page .fp-shop-content .fp-shop-toolbar-toggle:hover {
    border-color: rgba(139, 92, 246, 0.32);
    box-shadow: 0 6px 18px rgba(91, 53, 138, 0.1);
    transform: translateY(-1px);
}

body.fp-shop-page .fp-shop-content .fp-shop-toolbar-toggle.is-active,
body.fp-shop-page .fp-shop-content .fp-shop-toolbar-toggle.is-open {
    border-color: rgba(139, 92, 246, 0.34);
    background: rgba(139, 92, 246, 0.06);
    color: #5b35b8;
}

body.fp-shop-page .fp-shop-content .fp-shop-toolbar-toggle.is-active .fp-shop-toolbar-toggle__icon,
body.fp-shop-page .fp-shop-content .fp-shop-toolbar-toggle.is-open .fp-shop-toolbar-toggle__icon {
    background: linear-gradient(180deg, #a66cff, #7f42f3);
    color: #fff;
}

body.fp-shop-page .fp-shop-content .fp-shop-toolbar-toggle__chevron {
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -2px;
    transition: transform 0.2s ease;
}

body.fp-shop-page .fp-shop-content .fp-shop-toolbar-toggle.is-open .fp-shop-toolbar-toggle__chevron {
    transform: rotate(-135deg);
    margin-top: 2px;
}

body.fp-shop-page .fp-shop-content .fp-shop-toolbar {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

body.fp-shop-page .fp-shop-content .fp-shop-toolbar-panel {
    flex: 1 0 100%;
    display: none;
    width: 100%;
    margin: 2px 0 0;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(139, 92, 246, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

body.fp-shop-page .fp-shop-content .fp-shop-toolbar-panel.is-open {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    gap: 14px;
    align-items: end;
    box-sizing: border-box;
}

body.fp-shop-page .fp-shop-content .fp-shop-filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    gap: 14px;
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
}

body.fp-shop-page .fp-shop-content .fp-shop-ordering-field {
    min-width: 0;
    width: 100%;
}

body.fp-shop-page .fp-shop-content .fp-shop-field,
body.fp-shop-page .fp-shop-content .fp-shop-filter {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

body.fp-shop-page .fp-shop-content .fp-shop-field__label,
body.fp-shop-page .fp-shop-content .fp-shop-filter__label {
    font-family: 'Baloo 2', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    color: #5b35b8;
}

body.fp-shop-page .fp-shop-content .fp-shop-field__control,
body.fp-shop-page .fp-shop-content .fp-shop-ordering-field .woocommerce-ordering {
    width: 100%;
    margin: 0 !important;
    float: none !important;
}

body.fp-shop-page .fp-shop-content .fp-shop-ordering-field form,
body.fp-shop-page .fp-shop-content .fp-shop-ordering-field .woocommerce-ordering {
    display: block;
    width: 100%;
}

body.fp-shop-page .fp-shop-content .fp-shop-field__select,
body.fp-shop-page .fp-shop-content .fp-shop-filter__select,
body.fp-shop-page .fp-shop-content .woocommerce-ordering select {
    appearance: none;
    width: 100%;
    min-height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(139, 92, 246, 0.18);
    padding: 0 38px 0 14px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238B5CF6' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
    font-family: 'Baloo 2', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #342952;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(91, 53, 138, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.fp-shop-page .fp-shop-content .fp-shop-field__select:focus,
body.fp-shop-page .fp-shop-content .fp-shop-filter__select:focus,
body.fp-shop-page .fp-shop-content .woocommerce-ordering select:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.42);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

body.fp-shop-page .fp-shop-content .fp-shop-filter__reset {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: start;
    min-height: 40px;
    padding: 0 16px;
    margin-top: 2px;
    border-radius: 999px;
    background: rgba(255, 114, 182, 0.12);
    color: #c21872 !important;
    font-family: 'Baloo 2', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none !important;
    white-space: nowrap;
}

body.fp-shop-page .fp-shop-content .fp-shop-filter__reset:hover {
    background: rgba(255, 114, 182, 0.18);
}

body.fp-shop-page .fp-shop-content ul.products {
    margin-top: 8px !important;
}

body.fp-shop-page .fp-shop-content .woocommerce-ordering {
    float: none !important;
    width: 100%;
    margin: 0 !important;
}

/* Pagination */
body.fp-shop-page .fp-shop-content .woocommerce-pagination {
    margin-top: 28px;
}

body.fp-shop-page .fp-shop-content .woocommerce-pagination ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    border: none;
}

body.fp-shop-page .fp-shop-content .woocommerce-pagination ul li {
    border: none;
}

body.fp-shop-page .fp-shop-content .woocommerce-pagination ul li a,
body.fp-shop-page .fp-shop-content .woocommerce-pagination ul li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    font-family: 'Baloo 2', system-ui, sans-serif;
    font-weight: 800;
    text-decoration: none !important;
    color: #342952 !important;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(139, 92, 246, 0.14);
}

body.fp-shop-page .fp-shop-content .woocommerce-pagination ul li span.current {
    background: linear-gradient(180deg, #a66cff, #7f42f3);
    color: #fff !important;
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(125, 60, 242, 0.22);
}

/* Remove WC clearfix pseudo-elements */
.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce ul.products li.product::before,
.woocommerce ul.products li.product::after {
    display: none !important;
    content: none !important;
}

/* Empty state */
body.fp-shop-page .fp-shop-content .woocommerce-info {
    margin: 0;
    padding: 28px 24px;
    border-radius: 22px;
    border: 1px solid rgba(139, 92, 246, 0.16);
    background: rgba(255, 255, 255, 0.82);
    font-family: 'Baloo 2', system-ui, sans-serif;
    font-size: 17px;
    color: #4b5060;
}

@media (max-width: 960px) {
    body.fp-shop-page .fp-shop-content .fp-shop-toolbar,
    body.fp-shop-page .fp-shop-content .woocommerce-before-shop-loop {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 20px;
        padding: 12px 14px;
        box-sizing: border-box;
    }

    body.fp-shop-page .fp-shop-content .fp-shop-toolbar-head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }

    body.fp-shop-page .fp-shop-content .woocommerce-result-count {
        width: 100%;
        font-size: 14px;
        line-height: 1.4;
    }

    body.fp-shop-page .fp-shop-content .fp-shop-toolbar-toggle {
        width: 100%;
        margin-left: 0;
        justify-content: center;
    }

    body.fp-shop-page .fp-shop-content .fp-shop-toolbar-panel,
    body.fp-shop-page .fp-shop-content .fp-shop-toolbar-panel.is-open {
        grid-template-columns: 1fr;
        padding: 12px;
        margin-top: 0;
    }

    body.fp-shop-page .fp-shop-content .fp-shop-filters {
        grid-template-columns: 1fr;
    }

    body.fp-shop-page .fp-shop-content .fp-shop-field,
    body.fp-shop-page .fp-shop-content .fp-shop-filter,
    body.fp-shop-page .fp-shop-content .fp-shop-ordering-field {
        width: 100%;
    }

    body.fp-shop-page .fp-shop-content .fp-shop-field__select,
    body.fp-shop-page .fp-shop-content .fp-shop-filter__select,
    body.fp-shop-page .fp-shop-content .woocommerce-ordering select {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    body.fp-shop-page .fp-shop-content .fp-shop-filter__reset {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    body.fp-shop-page .fp-shop-content .fp-shop-toolbar-toggle__label {
        font-size: 13px;
    }

    body.fp-shop-page .fp-shop-content ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    body.fp-shop-page .fp-shop-content .fp-v3-offer,
    body.fp-shop-page .fp-shop-content .fp-shop-offer {
        padding: 16px 12px;
        border-radius: 22px;
    }

    body.fp-shop-page .fp-shop-content .fp-v3-offer img,
    body.fp-shop-page .fp-shop-content .fp-shop-offer img,
    body.fp-shop-page .fp-shop-content .fp-shop-offer .fp-shop-offer__img {
        height: 110px;
    }

    body.fp-shop-page .fp-shop-content .fp-v3-shop-btn {
        font-size: 14px;
        padding: 8px 14px;
    }
}

@media (max-width: 380px) {
    body.fp-shop-page .fp-shop-content ul.products {
        grid-template-columns: 1fr !important;
    }
}
