/**
 * Shop page filters — desktop full sidebar, mobile top bar + drawer
 * Scoped: body.pahal-shop-page
 */

body.pahal-shop-page {
    background: #f4f7fb;
}

.pahal-shop-page-header {
    padding: 36px 0 !important;
    background: linear-gradient(135deg, #0b1f3a 0%, #0d2a4d 100%) !important;
    color: #fff !important;
    border-bottom: 3px solid #ffb31a !important;
}

.pahal-shop-page-header h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: none;
}

.pahal-shop-container {
    position: relative;
}

/* Mobile filter bar — top of shop, always visible on phone */
.pahal-shop-toolbar {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.pahal-filter-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
    min-height: 50px;
    padding: 0 18px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #0b1f3a, #0d2a4d);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(11, 31, 58, 0.2);
}

.pahal-filter-open i {
    color: #ffb31a;
}

.pahal-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #ffb31a;
    color: #0b1f3a;
    font-size: 11px;
    font-weight: 900;
}

.pahal-filter-clear-inline {
    display: inline-flex;
    align-items: center;
    min-height: 50px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid rgba(10, 91, 216, 0.2);
    background: #fff;
    color: #0a5bd8;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

/* Layout */
.pahal-shop-layout {
    display: grid;
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

/* Shared filter UI (all breakpoints) */
.pahal-filter-group + .pahal-filter-group {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.pahal-filter-group .widget-title,
body.pahal-shop-page .pahal-sidebar .widget-title {
    margin-bottom: 14px;
    font-size: 16px;
    font-weight: 800;
    color: #0b1f3a;
    border-bottom: 2px solid #ffb31a;
    padding-bottom: 8px;
    display: inline-block;
}

.pahal-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pahal-filter-list li {
    margin: 0 0 8px;
}

.pahal-filter-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: #f8fafc;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.pahal-filter-option:hover {
    background: #fff;
    border-color: rgba(10, 91, 216, 0.18);
}

.pahal-filter-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.pahal-filter-option__box {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    position: relative;
}

.pahal-filter-list--radio .pahal-filter-option__box {
    border-radius: 50%;
}

.pahal-filter-input:checked + .pahal-filter-option__box {
    border-color: #0a5bd8;
    background: linear-gradient(135deg, #0a5bd8, #0847aa);
}

.pahal-filter-list--radio .pahal-filter-input:checked + .pahal-filter-option__box::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: #fff;
}

.pahal-filter-list--check .pahal-filter-input:checked + .pahal-filter-option__box::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.pahal-filter-option:has(.pahal-filter-input:checked) {
    background: #f0f6ff;
    border-color: rgba(10, 91, 216, 0.22);
}

a.pahal-filter-option {
    text-decoration: none;
    color: inherit;
}

a.pahal-filter-option.is-active {
    background: #f0f6ff;
    border-color: rgba(10, 91, 216, 0.22);
}

.pahal-filter-list--radio .pahal-filter-option--link.is-active .pahal-filter-option__box {
    border-color: #0a5bd8;
    background: linear-gradient(135deg, #0a5bd8, #0847aa);
}

.pahal-filter-list--radio .pahal-filter-option--link.is-active .pahal-filter-option__box::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: #fff;
}

.pahal-filter-option__label {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: #334155;
    font-weight: 600;
}

.pahal-filter-option__label em {
    font-style: normal;
    color: #94a3b8;
    font-size: 12px;
}

.pahal-filter-empty {
    padding: 10px 0;
    color: #64748b;
    font-size: 13px;
}

/* Active chips */
.pahal-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.pahal-active-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(10, 91, 216, 0.08);
    border: 1px solid rgba(10, 91, 216, 0.14);
    color: #0b1f3a;
    font-size: 12px;
    font-weight: 700;
}

.pahal-active-chip a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0a5bd8;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
}

.pahal-shop-main {
    min-width: 0;
}

/* Overlay — mobile only */
.pahal-filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(7, 17, 32, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pahal-filter-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

body.pahal-filter-open {
    overflow: hidden;
}

/* ============================================================
   MOBILE — Meesho-style bottom bar + bottom-sheet filter drawer
   ============================================================ */
@media (max-width: 991.98px) {
	.pahal-shop-container {
		padding-bottom: calc(72px + env(safe-area-inset-bottom));
	}

	.pahal-shop-toolbar {
		display: flex;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		top: auto;
		z-index: 1030;
		align-items: center;
		gap: 10px;
		margin: 0;
		padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
		background: #fff;
		border-top: 1px solid rgba(15, 23, 42, 0.1);
		box-shadow: 0 -10px 28px rgba(7, 17, 32, 0.1);
	}

	.pahal-filter-open {
		flex: 1;
		min-height: 48px;
		border-radius: 12px;
		background: #fff;
		color: #0b1f3a;
		border: 1.5px solid rgba(11, 31, 58, 0.14);
		box-shadow: none;
		font-size: 15px;
		font-weight: 700;
	}

	.pahal-filter-open i {
		color: #0a5bd8;
		font-size: 16px;
	}

	.pahal-filter-clear-inline {
		flex: 1;
		min-height: 48px;
		justify-content: center;
		border-radius: 12px;
	}

    .pahal-shop-layout {
        display: block;
    }

    /* Hidden until user taps Filters — removed from page flow */
    body.pahal-shop-page .pahal-sidebar.pahal-filter-panel {
        display: none !important;
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        z-index: 1050 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 88vh !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 20px 20px 0 0 !important;
        border: none !important;
        box-shadow: 0 -16px 48px rgba(7, 17, 32, 0.35) !important;
        flex-direction: column !important;
        transform: translateY(100%) !important;
        transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1) !important;
        overflow: hidden !important;
        visibility: hidden !important;
    }

    body.pahal-shop-page .pahal-sidebar.pahal-filter-panel.is-open {
        display: flex !important;
        transform: translateY(0) !important;
        visibility: visible !important;
    }

    .pahal-filter-overlay {
        display: block;
    }

    body.pahal-shop-page .pahal-filter-panel__head {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
        padding: 16px 18px 12px;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08);
        background: #fff;
        position: relative;
    }

    body.pahal-shop-page .pahal-filter-panel__head::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        border-radius: 4px;
        background: #e2e8f0;
    }

    body.pahal-shop-page .pahal-filter-panel__title {
        margin: 6px 0 0;
        font-size: 17px;
        font-weight: 800;
        color: #0b1f3a;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    body.pahal-shop-page .pahal-filter-panel__title i {
        color: #0a5bd8;
    }

	body.pahal-shop-page .pahal-filter-close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;   /* T-03 fix: was 40px */
		height: 44px;  /* T-03 fix: was 40px */
		border: none;
		border-radius: 12px;
		background: #f1f5f9;
		color: #0f172a;
		font-size: 18px;
		cursor: pointer;
	}

    body.pahal-shop-page .pahal-filter-panel__body {
        flex: 1 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 14px 16px !important;
        background: #fff !important;
        max-height: calc(92vh - 130px) !important;
    }

    body.pahal-shop-page .pahal-filter-panel__foot {
        display: flex !important;
        flex-shrink: 0;
        align-items: center;
        gap: 10px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid rgba(15, 23, 42, 0.08);
        background: #fff;
    }

    body.pahal-shop-page .pahal-filter-clear {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 46px;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        background: #f8fafc;
        color: #475569;
        font-size: 14px;
        font-weight: 800;
        text-decoration: none;
    }

    body.pahal-shop-page .pahal-filter-apply,
    body.pahal-shop-page .pahal-filter-done {
        flex: 1.3;
        min-height: 46px;
        border: none;
        border-radius: 12px;
        background: linear-gradient(135deg, #0a5bd8, #0847aa);
        color: #fff;
        font-size: 14px;
        font-weight: 800;
        cursor: pointer;
    }

    body.pahal-shop-page .pahal-filter-done {
        flex: 1;
    }

    .pahal-shop-main {
        width: 100%;
    }
}

/* Desktop explicit reset (wins over any mobile leak) */
@media (min-width: 992px) {
    .pahal-shop-toolbar {
        display: none !important;
    }

    .pahal-filter-overlay {
        display: none !important;
        pointer-events: none !important;
    }

    .pahal-shop-container {
        padding-bottom: 0;
    }

    /* ============================================================
       DESKTOP SIDEBAR — always visible in grid
       ============================================================ */
    body.pahal-shop-page .pahal-sidebar.pahal-filter-panel {
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: auto !important;
        max-height: none !important;
        height: auto !important;
        min-height: 0 !important;
        transform: none !important;
        visibility: visible !important;
        display: block !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 22px 18px !important;
        background: #fff !important;
        border: 1px solid rgba(15, 23, 42, 0.08) !important;
        border-radius: 20px !important;
        box-shadow: 0 14px 40px rgba(11, 31, 58, 0.06) !important;
        z-index: 1 !important;
    }

    body.pahal-shop-page .pahal-filter-panel__head,
    body.pahal-shop-page .pahal-filter-panel__foot {
        display: none !important;
    }

    body.pahal-shop-page .pahal-filter-panel__body {
        overflow: visible !important;
        max-height: none !important;
        height: auto !important;
        padding: 0 !important;
        flex: none !important;
    }
}

@media (max-width: 575px) {
    .pahal-filter-option {
        padding: 10px;
    }

    .pahal-filter-option__label {
        font-size: 13px;
    }
}

/* ============================================================
   F-03 FIX — Active filter chip remove button: proper touch target
   Was: 18×18px (too small). Now: 28px with extra tap area via padding.
   ============================================================ */
.pahal-active-chip a,
.pahal-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Visual size stays small inside the chip */
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0a5bd8;
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    line-height: 1;
    /* Expand tap area outward without affecting layout */
    padding: 8px;
    margin: -8px -6px -8px 2px;
    box-sizing: content-box;
    transition: background 0.2s ease, transform 0.2s ease;
}

.pahal-active-chip a:hover,
.pahal-chip-remove:hover {
    background: #0847aa;
    transform: scale(1.1);
}

/* ============================================================
   F-01 FIX — Desktop "Apply Filters" button inside sidebar body
   Hidden on mobile (mobile uses .pahal-filter-panel__foot).
   Shown only on desktop (≥ 992px).
   ============================================================ */
.pahal-filter-desktop-foot {
    display: none; /* hidden by default; shown on desktop below */
}

@media (min-width: 992px) {
    .pahal-filter-desktop-foot {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: 22px;
        padding-top: 18px;
        border-top: 1px solid rgba(15, 23, 42, 0.06);
    }

    .pahal-filter-desktop-foot .pahal-filter-clear {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        background: #f8fafc;
        color: #475569;
        font-size: 13px;
        font-weight: 700;
        text-decoration: none;
        transition: background 0.2s ease, border-color 0.2s ease;
    }

    .pahal-filter-desktop-foot .pahal-filter-clear:hover {
        background: #fff;
        border-color: #cbd5e1;
    }

    .pahal-filter-desktop-foot .pahal-filter-apply {
        display: none;
    }
}

/* ============================================================
   Shop product card — premium golden ratings (centered)
   ============================================================ */
body.pahal-shop-page .pahal-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 2px auto 12px;
    min-height: 28px;
}

body.pahal-shop-page .pahal-rating-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

body.pahal-shop-page .pahal-rating .star-rating {
    float: none !important;
    margin: 0 !important;
    font-size: 15px !important;
    width: 5.2em !important;
    height: 1em;
    line-height: 1;
    color: #ffb31a !important;
    letter-spacing: 0.02em;
    filter: drop-shadow(0 1px 2px rgba(232, 154, 0, 0.22));
}

body.pahal-shop-page .pahal-rating .star-rating::before {
    color: rgba(255, 179, 26, 0.28) !important;
    opacity: 1;
}

body.pahal-shop-page .pahal-rating .star-rating span::before {
    color: #ffb31a !important;
}

body.pahal-shop-page .pahal-rating-count {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    line-height: 1;
    white-space: nowrap;
}

body.pahal-shop-page .pahal-rating-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 179, 26, 0.18), rgba(255, 211, 109, 0.28));
    border: 1px solid rgba(255, 179, 26, 0.35);
    color: #9a6700;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.02em;
}

body.pahal-shop-page .pahal-rating-none {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    text-align: center;
}

body.pahal-shop-page .pahal-rating-none__stars {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 13px;
    line-height: 1;
    color: #ffb31a;
}

body.pahal-shop-page .pahal-rating-none__stars i {
    color: rgba(255, 179, 26, 0.42);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

body.pahal-shop-page .pahal-rating-none small {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #c9a227;
}
