/**
 * Theme Name:  Astra CSSMI
 * Template:    astra
 * Description: Astra child theme with customization for CSSMI usage
 * Version:     1.0.0
 * Author:      CSSMI
 */

/* Checkout section headings */
.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields h3,
.checkout .col2-set h3,
.woocommerce-checkout #order_review_heading {
    color: #1e3a5f !important;
    font-weight: 600 !important;
    border-left: 4px solid #ff8c42 !important;
    padding: 16px 24px !important;
    margin: 24px 0 20px 0 !important;
    background: #fafafa !important;
    font-size: 18px !important;
    border-radius: 0 !important;
}

/* Order review container - clean border */
.woocommerce-checkout-review-order {
    border: 1px solid #e5e7eb !important;
    border-radius: 0 !important;
    padding: 24px !important;
    margin: 20px 0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

/* Order review table */
.woocommerce-checkout-review-order-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: transparent !important;
    border: none !important;
}

/* Table cells */
.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
    padding: 12px 0 !important;
    border: none !important;
    border-bottom: 1px solid #e5e7eb !important;
}

/* Table headers */
.woocommerce-checkout-review-order-table thead th {
    color: #1e3a5f !important;
    font-weight: 600 !important;
    padding-bottom: 16px !important;
    border-bottom: 2px solid #e5e7eb !important;
}

/* Total row */
.woocommerce-checkout-review-order-table .order-total th,
.woocommerce-checkout-review-order-table .order-total td {
    font-weight: 600 !important;
    color: #1e3a5f !important;
    border-bottom: none !important;
    padding-top: 16px !important;
}

/* Right align prices */
.woocommerce-checkout-review-order-table .product-total {
    text-align: right !important;
}

/* Thank you page */
.woocommerce-thankyou-order-received {
    border-left: 4px solid #ff8c42;
    padding: 24px;
    background: #fafafa;
}
.woocommerce-thankyou-order-received .thank-you-h3 {
    font-size: 2.5rem;
    color: #1e3a5f;
    margin: 0 0 16px 0;
    font-weight: 600;
    line-height: 1.15;
}
.woocommerce-thankyou-order-received span {
    display: block;
    margin: 12px 0;
    line-height: 1.5;
}


 /* FOUC Prevention */
 .pills-category-nav {
     opacity: 0;
     transition: opacity 0.4s ease;
 }

.pills-category-nav.loaded {
    opacity: 1;
}

/* Skeleton Loading Animation */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.pills-skeleton-container {
    display: block;
}

.pills-skeleton-container.hidden {
    display: none;
}

.pills-grid-skeleton {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    padding: 16px !important;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, rgba(241, 245, 249, 0.4) 100%) !important;
    border-radius: 16px !important;
    border: 1px solid rgba(226, 232, 240, 0.5) !important;
}

.pill-skeleton {
    height: 44px !important;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%) !important;
    background-size: 200% 100% !important;
    animation: shimmer 2s infinite !important;
    border-radius: 20px !important;
}

/* Filters Section */
.filters-section {
    margin-bottom: 0px;
}

.filter-group {
    margin-bottom: 16px;
}

/* Mobile-First Responsive Grid */
.pills-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    padding: 16px !important;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, rgba(241, 245, 249, 0.4) 100%) !important;
    border-radius: 16px !important;
    border: 1px solid rgba(226, 232, 240, 0.5) !important;
}

/* Enhanced Pills - Mobile First with centered layout and tighter padding */
.pill {
    background: white !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 20px !important;
    padding: 10px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
    position: relative !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    outline: none !important;
    min-height: 42px !important;
    text-align: center !important;
    line-height: 1.2 !important;
}

.pill:hover {
    border-color: rgba(11, 44, 91, 0.2) !important;
    color: #0b2c5b !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(11, 44, 91, 0.08) !important;
}

.pill.active {
    background: #0b2c5b !important;
    color: white !important;
    border-color: #0b2c5b !important;
    font-weight: 700 !important;
    transform: none !important;
    box-shadow: 0 4px 16px rgba(11, 44, 91, 0.2) !important;
}

.pill-count {
    background: rgba(15, 23, 42, 0.1) !important;
    color: #475569 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 8px !important;
    min-width: 20px !important;
    text-align: center !important;
    flex-shrink: 0 !important;
    align-self: flex-start !important;
    margin-top: 2px !important;
    display: none !important; /* HIDE ON MOBILE */
}

.pill.active .pill-count {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

/* Animated bottom border pseudo-element */
.pill::after {
    content: '' !important;
    position: absolute !important;
    bottom: -2px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 0 !important;
    height: 3px !important;
    background: #0b2c5b !important;
    border-radius: 2px !important;
    transition: width 0.3s ease !important;
}

/* Hover state - show small bottom border */
.pill:hover::after {
    width: 20px !important;
}

/* Active state - show larger bottom border in white */
.pill.active::after {
    width: 24px !important;
    background: white !important;
}

/* Secondary Filters - Mobile Stack */
.secondary-filters-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin:10px 0;
}

.filter-controls-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.secondary-filters {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    max-width: 400px;
}

.month-selector {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 0;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    width: 100% !important;
    min-width: unset !important;
    cursor: pointer;
}

.month-selector:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.month-selector:focus-within {
    border-color: #0b2c5b;
    box-shadow: 0 0 0 3px rgba(11, 44, 91, 0.1);
}

.calendar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    color: #64748b;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    cursor: pointer;
}

.month-select-improved {
    appearance: none;
    background: transparent;
    border: none;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    flex: 1;
    cursor: pointer;
    outline: none;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 2;
}

.month-select-display {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    pointer-events: none;
}

.dropdown-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    color: #64748b;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.month-selector:hover .dropdown-arrow {
    transform: translateY(1px);
}

/* Subsidized Filter */
.subsidized-filter {
    display: flex;
    align-items: center;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 0;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    cursor: pointer;
    width: 100% !important;
    min-width: unset !important;
}

.subsidized-filter:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.subsidized-filter.active {
    border-color: #0b2c5b;
    background: rgba(11, 44, 91, 0.02);
}

.price-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    color: #64748b;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    border-radius: 11px 0 0 11px;
}

.subsidized-filter.active .price-icon {
    color: #0b2c5b;
    background: rgba(11, 44, 91, 0.05);
}

.subsidized-content {
    flex: 1;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subsidized-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.subsidized-filter.active .subsidized-checkbox {
    background: #0b2c5b;
    border-color: #0b2c5b;
}

.subsidized-text {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    user-select: none;
}

.subsidized-filter.active .subsidized-text {
    color: #0b2c5b;
    font-weight: 600;
}

/* Active Filters */
.active-filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    width: 100%;
    max-width: 400px;
}

.active-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideInFromLeft 0.3s ease;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.filter-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 8px 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    transition: all 0.2s ease;
}

.filter-tag:hover {
    background: #e2e8f0;
}

.filter-tag-text {
    white-space: nowrap;
}

.filter-tag-remove {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.filter-tag-remove:hover {
    background: #cbd5e1;
    color: #374151;
}

.filter-tag-remove:active {
    transform: scale(0.95);
}

/* Content Area */
.content-area-pills {
    position: relative !important;
    min-height: 200px;
}

/* Category Badges */
.product-categories-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.category-badge {
    background: #f1f5f9;
    color: #475569;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    display: inline-block;
}

/* Remove row gap on mobile from parent container */
.wp-block-uagb-container.uagb-block-4e9b386a {
    row-gap: 0 !important;
}

/* Tablet Responsive (768px+) - RESTORE ORIGINAL DESKTOP LAYOUT + FIX CENTERING */
@media (min-width: 768px) {
    .pills-grid-skeleton,
    .pills-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 16px !important;
        row-gap: 20px !important;
        padding: 20px !important;
        border-radius: 20px !important;
    }

    .pill-skeleton {
        height: 48px !important;
        border-radius: 24px !important;
        width: auto !important;
        min-width: 120px !important;
    }

    .pill {
        padding: 14px 28px !important;
        font-size: 15px !important;
        border-radius: 32px !important;
        min-height: 48px !important;
        /* RESTORE ORIGINAL DESKTOP CENTERED LAYOUT */
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 8px !important;
        width: auto !important;
        flex: 0 0 auto !important;
    }

    .pill-count {
        font-size: 12px !important;
        padding: 2px 8px !important;
        border-radius: 12px !important;
        /* RESTORE ORIGINAL DESKTOP ALIGNMENT */
        align-self: center !important;
        margin-top: 0 !important;
        margin-left: 4px !important;
        display: inline-flex !important; /* SHOW ON DESKTOP */
    }

    .secondary-filters-section {
        flex-direction: row !important;
        justify-content: center;
        margin:24px 0;
    }

    /* NEW: Center the filter controls container */
    .filter-controls-container {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 20px !important;
        width: auto !important;
    }

    .secondary-filters {
        flex-direction: row !important;
        align-items: center;
        width: auto !important;
        max-width: none !important;
        gap: 20px;
    }

    .month-selector,
    .subsidized-filter {
        width: auto !important;
        min-width: 220px !important;
    }

    .active-filters-container {
        width: auto !important;
        max-width: none !important;
    }
}

/* Desktop Responsive (1024px+) */
@media (min-width: 1024px) {
    .pills-grid-skeleton,
    .pills-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 20px !important;
        padding: 24px !important;
    }

    .pill {
        padding: 16px 24px !important;
        font-size: 15px !important;
        border-radius: 28px !important;
    }

    .pill-count {
        font-size: 12px !important;
        padding: 3px 8px !important;
    }

    .secondary-filters-section {
        margin:24px 0;
    }
}

/* Large Desktop (1200px+) - RESTORE ORIGINAL FLEX LAYOUT */
@media (min-width: 1200px) {
    .pills-grid-skeleton,
    .pills-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 16px !important;
        row-gap: 20px !important;
    }

    .pill-skeleton,
    .pill {
        flex: 0 0 auto !important;
        min-width: auto !important;
        width: auto !important;
    }
}

/* Focus States */
.pill:focus-visible {
    outline: 2px solid #0b2c5b !important;
    outline-offset: 3px !important;
    box-shadow: 0 4px 12px rgba(11, 44, 91, 0.08), 0 2px 6px rgba(11, 44, 91, 0.04), 0 0 0 4px rgba(11, 44, 91, 0.08) !important;
}

.month-select-improved:focus-visible,
.subsidized-filter:focus-visible {
    outline: 2px solid #0b2c5b !important;
    outline-offset: -2px !important;
}

.filter-tag-remove:focus-visible {
    outline: 2px solid #0b2c5b !important;
    outline-offset: 2px !important;
}
