/*
Theme Name: Mobile Woo Theme Filters
Theme URI: https://example.com/mobile-woo-theme
Author: Antigravity
Author URI: https://example.com
Description: A fast, modern, and mobile-centric WooCommerce theme focusing on immediate category access and premium UX, with mobile off-canvas shop filters.
Version: 1.1.5
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mobile-woo-theme
Tags: woocommerce, mobile-first, clean, modern, grid-layout
*/

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius-lg: 1rem;
    --radius-full: 9999px;
    --font-main: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding-bottom: 80px;
    /* Space for bottom nav */
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    /* Increased for Tablets/PC */
    margin: 0 auto;
    padding: 0 1.25rem;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.category-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #e2e8f0;
    box-shadow: var(--shadow-sm);
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-card:active img {
    transform: scale(1.05);
}

.category-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.category-card h3 {
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    height: 64px;
    border-radius: var(--radius-full);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

@media (min-width: 768px) {
    .bottom-nav {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav-item.active {
    color: var(--primary);
}

.nav-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

/* Active Order Flashing Icon */
.active-order-flashing {
    color: #ef4444 !important;
    /* Urgent Red */
    animation: pulse-red 1.5s infinite ease-in-out;
}

.active-order-flashing .nav-icon {
    font-size: 1.75rem !important;
    /* Slightly larger */
}

@keyframes pulse-red {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* WooCommerce Overrides */
/* Grid handled below in Shop Layout Fixes Section */

/* Shop Layout Fixes - SUPER COMPACT HIGH DENSITY GRID */
.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    /* Mobile: 2 cols */
    gap: 0.5rem !important;
    margin: 0 !important;
    padding: 0.5rem !important;
    list-style: none !important;
}

/* Ensure no ghost columns or floats */
.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none !important;
}

.woocommerce ul.products li.product {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    background: white !important;
    padding: 0.5rem !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    transition: transform 0.2s ease !important;
}

/* High Density Image */
.woocommerce ul.products li.product img {
    height: 100px !important;
    object-fit: contain !important;
    margin-bottom: 0.5rem !important;
    background: #fcfcfc;
    border-radius: 4px;
}

/* Typography tweaks for compact cards */
.woocommerce-loop-product__title {
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    margin: 0 0 0.5rem 0 !important;
    padding-bottom: 0.2rem !important;
    line-height: 1.4 !important;
    min-height: 2.8em !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.price {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: var(--primary) !important;
    margin-bottom: 0.5rem !important;
}

/* Add to Cart button highly compact */
.button.add_to_cart_button,
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .out-of-stock {
    position: relative !important;
    z-index: 10 !important;
    background-color: var(--primary) !important;
    color: white !important;
    padding: 0.5rem 0.5rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    width: 100% !important;
    text-align: center !important;
    margin-top: auto !important;
    display: block !important;
    border: none !important;
    cursor: pointer !important;
}

.woocommerce ul.products li.product .out-of-stock {
    background-color: #ef4444 !important;
    margin-top: 5px !important;
}

.button.add_to_cart_button:active {
    transform: scale(0.95);
}

@media (min-width: 500px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (min-width: 768px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.75rem !important;
    }

    .woocommerce ul.products li.product img {
        height: 120px !important;
    }
}

@media (min-width: 1024px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(6, 1fr) !important;
    }
}

/* Remove weird highlights on WooCommerce defaults */
.woocommerce ul.products li.product .count {
    background: none !important;
    color: var(--text-muted) !important;
    font-size: 0.8rem !important;
    padding: 0 !important;
    font-weight: normal !important;
}

/* Force Grid Only by Hiding the Toggle */
.gridlist-toggle,
#gridlist-toggle,
.woocommerce-grid-list-toggle,
.grid-list-toggle {
    display: none !important;
}


/* Force vertical layout for complex shipping rows to give more space on mobile */
@media (max-width: 767px) {

    .woocommerce-shipping-totals th,
    .woocommerce-shipping-totals td {
        display: block !important;
        width: 100% !important;
        text-align: left !important;
    }

    .woocommerce-shipping-totals th {
        padding-bottom: 0 !important;
        border-bottom: none !important;
    }
}

.shop_table.woocommerce-checkout-review-order-table th,
.shop_table.cart_totals_table th,
.shop_table.woocommerce-cart-totals th:not(.woocommerce-shipping-totals th) {
    font-weight: 700;
    color: var(--text-main);
    width: 35%;
    text-align: left;
}

.shop_table.woocommerce-checkout-review-order-table td,
.shop_table.cart_totals_table td,
.shop_table.woocommerce-cart-totals td:not(.woocommerce-shipping-totals td) {
    text-align: right !important;
    color: var(--text-main);
}

.order-total th,
.order-total td {
    border-bottom: none !important;
    font-size: 1.25rem;
    padding-top: 1.5rem !important;
}

.order-total td strong {
    color: var(--primary);
    font-weight: 800;
}

/* Fix for shipping address and long text in totals */
.woocommerce-shipping-totals ul {
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: right;
}

@media (max-width: 767px) {
    .woocommerce-shipping-totals ul {
        text-align: left !important;
    }
}

.woocommerce-shipping-destination {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
    line-height: 1.4;
}

.checkout-button {
    margin-top: 1.5rem !important;
    background: var(--primary) !important;
    color: white !important;
    border-radius: var(--radius-full) !important;
    padding: 1.25rem !important;
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    width: 100% !important;
    display: block !important;
    text-align: center !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2) !important;
}

/* Local Pickup Plus Appointment Picker Enhancements - SUPER AGGRESSIVE */
.pickup-appointment-picker,
.woocommerce-shipping-totals .pickup-appointment-picker {
    display: block !important;
    margin: 1.5rem 0 !important;
    padding: 1.25rem !important;
    background: #eff6ff !important;
    border: 2px solid var(--primary) !important;
    border-radius: 12px !important;
    text-align: left !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.pickup-appointment-picker label,
.woocommerce-shipping-totals label[for="pickup_appointment_date"] {
    display: block !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    color: var(--primary) !important;
    margin-bottom: 0.75rem !important;
    text-align: left !important;
}

input#pickup_appointment_date,
input[name*="pickup_appointment_date"],
#pickup_appointment_date {
    display: block !important;
    width: 100% !important;
    height: 60px !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    padding: 0 1.25rem !important;
    border-radius: 10px !important;
    border: 2px solid #cbd5e1 !important;
    background-color: white !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    color: var(--text-main) !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

input#pickup_appointment_date:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1) !important;
}

/* Datepicker Icon adjustment */
.pickup-appointment-picker .ui-datepicker-trigger {
    display: none !important;
}

/* Checkout Layout Optimization */
.woocommerce-checkout-review-order-table thead {
    display: none;
    /* Hide product/total headers for cleaner look */
}

.woocommerce-checkout-review-order-table .cart_item td {
    padding: 1rem 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.woocommerce-checkout-review-order-table .product-name {
    font-weight: 600;
    color: var(--text-main);
}

.woocommerce-checkout-review-order-table .product-total {
    font-weight: 700;
    color: var(--primary);
}

/* Premium Pickup Station Styling */
.woocommerce-shipping-totals {
    background: #f8fafc !important;
    border-radius: 12px !important;
    margin: 1rem 0 !important;
}

.woocommerce-shipping-totals th {
    vertical-align: top !important;
    padding-top: 1.5rem !important;
}

.woocommerce-shipping-totals td {
    padding: 1.5rem !important;
}

.pickup-location-details,
.woocommerce-shipping-totals .pickup-location-details {
    background: white !important;
    padding: 1rem !important;
    border-radius: 10px !important;
    border: 1px solid #e2e8f0 !important;
    margin-bottom: 1rem !important;
    box-shadow: var(--shadow-sm) !important;
}

/* Hide Redundant WW Parked Floating Bubble in Mobile Theme */
#ww-parked-bubble-trigger {
    display: none !important;
}

.pickup-location-details b {
    display: block !important;
    color: var(--primary) !important;
    margin-bottom: 0.25rem !important;
    font-size: 1rem !important;
}


/* Make sure the appointment picker fills the space and matches the theme */
.pickup-appointment-picker {
    margin: 0 !important;
    border: 1px solid #e2e8f0 !important;
    background: white !important;
    box-shadow: var(--shadow-sm) !important;
}

/* Mobile Search Overlay */
.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.82);
    transition: all 0.3s ease;
}

.mobile-search-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.search-overlay-inner {
    width: 90%;
    max-width: 500px;
    position: relative;
    padding: 20px;
}

.mobile-search-overlay .search-form {
    display: flex;
    background: #fff;
    padding: 6px;
    border-radius: 18px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-search-overlay .search-field {
    border: none;
    background: transparent;
    padding: 12px 18px;
    font-size: 1.15rem;
    width: 100%;
    outline: none;
    font-family: inherit;
    color: #1a1a1a;
}

.mobile-search-overlay .search-submit {
    background: var(--primary);
    color: #fff;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.mobile-search-overlay .search-submit:active {
    transform: scale(0.92);
}

.close-search {
    position: absolute;
    top: -60px;
    right: 20px;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-search:active {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(0.9);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   Brand Filter â€“ Pill Strip
   ============================================================ */

.brand-filter-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* Firefox */
    padding: 0.75rem 0 0.9rem;
    margin-bottom: 1rem;
    /* Subtle bottom separator */
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.brand-filter-wrap::-webkit-scrollbar {
    display: none;
    /* Chrome / Safari */
}

.brand-pill {
    flex-shrink: 0;
    scroll-snap-align: start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 1rem;
    border-radius: var(--radius-full);
    border: 1.5px solid rgba(37, 99, 235, 0.25);
    background: var(--bg-white);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
        transform 0.15s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    /* Ensure 44px touch target via padding compensation */
    min-width: 60px;
    box-shadow: var(--shadow-sm);
}

.brand-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.brand-pill:active {
    transform: scale(0.95);
}

.brand-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Loading shimmer over the product grid while AJAX runs */
.woocommerce.brand-filter-loading {
    position: relative;
    pointer-events: none;
}

.woocommerce.brand-filter-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.7) 50%,
            rgba(255, 255, 255, 0) 100%);
    background-size: 200% 100%;
    animation: brand-shimmer 1.2s infinite;
    border-radius: var(--radius-lg);
    z-index: 10;
}

@keyframes brand-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* No-results message */
.ww-no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 1rem;
    grid-column: 1 / -1;
}

/* ============================================================
   Off-Canvas Filter Drawer
   ============================================================ */
.ww-filter-fab {
    position: fixed;
    bottom: 90px;
    right: 1.25rem;
    z-index: 999;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.ww-filter-fab:active {
    transform: scale(0.95);
}

.ww-filter-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85%;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-light);
    z-index: 10002;
    transition: right 0.3s cubic-bezier(0.82, 0.085, 0.395, 0.895);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
}

.ww-filter-drawer.active {
    right: 0;
}

.ww-filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ww-filter-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ww-filter-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: white;
}

.ww-filter-drawer-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

#ww-filter-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.ww-filter-drawer-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.ww-filter-drawer-content .widget {
    margin-bottom: 1.5rem;
    background: white;
    padding: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.ww-filter-drawer-content .widget-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

/* Custom Options-based Filters Styling */
.ww-custom-filters {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ww-filter-section {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.ww-filter-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-main);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg-light);
    outline: none;
    transition: all 0.2s ease;
}

.filter-search input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.filter-price .price-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-price input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg-light);
    text-align: center;
    outline: none;
    transition: all 0.2s ease;
}

.filter-price input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.filter-price span {
    color: var(--text-muted);
    font-weight: 600;
}

.filter-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.95rem;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
}

.filter-checkbox-label input[type="radio"],
.filter-checkbox-label input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--primary);
    cursor: pointer;
    border: 1.5px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.25rem;
}

.ww-filter-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-bottom: 2rem;
}

.ww-filter-actions button {
    width: 100%;
    padding: 0.85rem;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.ww-filter-actions .btn-apply {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.ww-filter-actions .btn-apply:active {
    transform: scale(0.98);
}

.ww-filter-actions .btn-clear {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.ww-filter-actions .btn-clear:active {
    background: rgba(0, 0, 0, 0.05);
}