/* ============================================
   public/css/product.css
   Product Listing Page — "Collections" layout
   ============================================ */

/* ============================================
   SHOP WRAPPER
   ============================================ */
.shop-wrapper {
    padding-top: 1.5rem;
    padding-bottom: 4rem;
}

/* ============================================
   BREADCRUMB + TITLE ROW
   ============================================ */
.shop-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 12px;
}

.breadcrumb-custom {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
}

.breadcrumb-custom a {
    color: #86868b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.breadcrumb-custom a:hover {
    color: #1d1d1f;
}

.breadcrumb-custom i {
    font-size: 0.6rem;
    color: #c7c7cc;
}

.breadcrumb-custom .active {
    color: #1d1d1f;
    font-weight: 600;
}

.collections-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #1d1d1f;
    letter-spacing: -0.04em;
    margin: 0;
}

/* ============================================
   CONTROLS TOOLBAR  (Filter + Sort)
   ============================================ */
.controls-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 1.75rem;
    /* Subtle divider line above the content row */
    padding: 12px 0;
    border-top: 1px solid #f2f2f2;
    border-bottom: 1px solid #f2f2f2;
}

/* ── Filter Button ──────────────────────────────── */
.ctrl-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    background: #ffffff;
    border: 1.5px solid #e5e5e7;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1d1d1f;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04), 0 2px 10px rgba(0, 0, 0, 0.03);
    transition:
        background  0.2s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow  0.2s cubic-bezier(0.16, 1, 0.3, 1),
        transform   0.15s cubic-bezier(0.16, 1, 0.3, 1);
    /* Prevent text selection on fast double-tap */
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.ctrl-filter-btn .ctrl-icon {
    flex-shrink: 0;
    color: #86868b;
    transition: color 0.2s ease;
}

.ctrl-filter-btn:hover {
    background: #f5f5f7;
    border-color: #d1d1d6;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
    transform: translateY(-1px);
}

.ctrl-filter-btn:hover .ctrl-icon {
    color: #1d1d1f;
}

.ctrl-filter-btn:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.ctrl-filter-btn:focus-visible {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

/* ── Sort Wrapper ───────────────────────────────── */
.ctrl-sort-wrap {
    /* Pushes to right on desktop; on mobile it grows to fill remaining space */
    margin-left: auto;
}

/* Sort text and label layout */
.ctrl-sort-text {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctrl-sort-prefix {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

#customSortLabel {
    display: none;
}

/* ── Upgraded sort selected trigger ────────────── */
/* (keeps existing .custom-sort-selected class, just overrides a few values) */
.controls-toolbar .custom-sort-selected {
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04), 0 2px 10px rgba(0, 0, 0, 0.03);
    transition:
        background   0.2s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow   0.2s cubic-bezier(0.16, 1, 0.3, 1),
        transform    0.15s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
}

.controls-toolbar .custom-sort-selected:hover {
    background: #f5f5f7;
    border-color: #d1d1d6;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
    transform: translateY(-1px);
}

.controls-toolbar .custom-sort-selected:active {
    transform: scale(0.98);
}

/* Dropdown panel: slightly larger radius to match the new trigger */
.controls-toolbar .custom-sort-options {
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.09), 0 2px 10px rgba(0, 0, 0, 0.03);
}


.custom-sort-dropdown {
    position: relative;
    width: 200px; /* Consistent fixed width for premium look */
    font-family: inherit;
}

.custom-sort-selected {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 44px; /* Touch-friendly height */
    padding: 0 16px;
    background: #fff;
    border: 1.5px solid #e5e5e7;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
}

.custom-sort-selected:hover {
    border-color: #d1d1d6;
}

.custom-sort-selected:focus-visible {
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.custom-sort-arrow {
    color: #86868b;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-sort-dropdown.open .custom-sort-selected {
    border-color: #1d1d1f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.custom-sort-dropdown.open .custom-sort-arrow {
    transform: rotate(180deg);
}

.custom-sort-options {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 100%;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #f2f2f2;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.08), 0 2px 10px rgba(0, 0, 0, 0.02);
    margin: 0;
    padding: 8px;
    list-style: none;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 280px;
    overflow-y: auto;
}

/* Scrollbar styling for options */
.custom-sort-options::-webkit-scrollbar {
    width: 4px;
}
.custom-sort-options::-webkit-scrollbar-thumb {
    background: #e5e5e7;
    border-radius: 4px;
}

.custom-sort-dropdown.open .custom-sort-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-sort-option {
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1d1d1f;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
}

.custom-sort-option:hover {
    background: #f5f5f7;
}

.custom-sort-option.active {
    background: #f5f5f7;
    font-weight: 700;
    color: #1d1d1f;
}

/* Checkmark for selected option */
.custom-sort-option.active::after {
    content: '';
    margin-left: auto;
    width: 6px;
    height: 10px;
    border: solid #1d1d1f;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-right: 4px;
}


/* ============================================
   CONTENT ROW (sidebar + grid)
   ============================================ */
.shop-content-row {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

/* ============================================
   FILTER SIDEBAR
   ============================================ *//* ============================================
   FILTER SIDEBAR
   ============================================ */
.filter-sidebar {
    flex: 0 0 320px;
    width: 320px;
    position: sticky;
    top: 86px;
    height: calc(100vh - 120px);
    max-height: 800px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #f2f2f2;
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow: hidden;
}

.filter-sidebar-header {
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #f2f2f2;
    flex-shrink: 0;
}

.filter-sidebar-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    color: #1d1d1f;
}

.filter-clear-link {
    background: none;
    border: none;
    font-size: 0.72rem;
    font-weight: 700;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.filter-clear-link:hover {
    color: #000;
}

.filter-sections-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    margin-top: 1rem;
}

.filter-sections-scroll::-webkit-scrollbar {
    width: 4px;
}

.filter-sections-scroll::-webkit-scrollbar-thumb {
    background: #e5e5e7;
    border-radius: 4px;
}

.filter-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #f2f2f2;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: #1d1d1f;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

/* Checkboxes */
.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-list li {
    margin-bottom: 4px;
}

.filter-check {
    position: relative;
    padding: 6px 10px 6px 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 500;
    color: #1d1d1f;
    margin-bottom: 2px;
    user-select: none;
    transition: background 0.2s ease;
    min-height: 32px;
    border-radius: 8px;
}

.filter-check:hover {
    background: #f5f5f7;
}

.filter-check input[type="checkbox"],
.filter-check input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: #fff;
    border: 1.5px solid #d1d1d6;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.filter-check:hover input ~ .checkmark {
    border-color: #1d1d1f;
}

.filter-check input:checked ~ .checkmark {
    background-color: #1d1d1f;
    border-color: #1d1d1f;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.filter-check input:checked ~ .checkmark:after {
    display: block;
}

.filter-check input[type="checkbox"] ~ .checkmark:after {
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-check input[type="radio"] ~ .checkmark {
    border-radius: 50%;
}

.filter-check input[type="radio"]:checked ~ .checkmark:after {
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    border: none;
    border-radius: 50%;
    background: white;
    transform: translate(-50%, -50%);
}

/* Price Slider */
.price-slider-wrap {
    padding: 4px 0;
}

.price-slider-container {
    position: relative;
    height: 6px;
    margin: 16px 0 20px 0;
}

.price-slider-container .price-slider {
    position: absolute;
    width: 100%;
    height: 4px;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    top: 50%;
    transform: translateY(-50%);
    outline: none;
}

.price-slider-container .price-slider::-webkit-slider-thumb {
    pointer-events: auto;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1d1d1f;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
    z-index: 10;
}

.price-slider-container .price-slider::-moz-range-thumb {
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1d1d1f;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
    z-index: 10;
}

.price-slider-container .price-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.price-slider-container .price-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.slider-track {
    position: absolute;
    height: 4px;
    background: #e5e5e7;
    width: 100%;
    border-radius: 4px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.price-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1d1d1f;
}

/* Color Swatches */
.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
    padding: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1d1d1f !important;
    transform: scale(1.05);
}

.color-swatch.swatch-white {
    border-color: #e5e5e7 !important;
}

/* Size Pills */
.size-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.size-pill {
    min-width: 44px;
    height: 38px;
    border-radius: 50px;
    border: 1.5px solid #e5e5e7;
    background: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.size-pill:hover {
    border-color: #1d1d1f;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.size-pill.active {
    background: #1d1d1f;
    color: #fff;
    border-color: #1d1d1f;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Sticky Footer inside Sidebar (Mostly for Mobile Drawer) */
.filter-sidebar-footer {
    display: none;
    gap: 12px;
    padding-top: 1rem;
    border-top: 1px solid #f2f2f2;
    background: #fff;
    flex-shrink: 0;
}

.btn-clear-sidebar {
    flex: 1;
    height: 44px;
    border-radius: 14px;
    border: 1px solid #1d1d1f;
    background: #fff;
    color: #1d1d1f;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-clear-sidebar:hover {
    background: #f5f5f7;
    transform: translateY(-1px);
}

.btn-apply-sidebar {
    flex: 1;
    height: 44px;
    border-radius: 14px;
    background: #1d1d1f;
    border: none;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-apply-sidebar:hover {
    background: #000;
    transform: translateY(-1px);
}
.product-grid-wrap {
    flex: 1;
    min-width: 0;
}

/* Mobile filter button — replaced by .ctrl-filter-btn in .controls-toolbar */
/* Kept as no-op to avoid any cached-HTML references breaking */
.mobile-filter-btn { display: none !important; }


/* ============================================
   SKELETON LOADING
   ============================================ */

/* Shimmer keyframe — GPU-accelerated via transform only */
@keyframes p-shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Base skeleton block */
.p-skel-block {
    position: relative;
    overflow: hidden;
    background: #ebebeb;
    border-radius: 8px;
    flex-shrink: 0;
}

.p-skel-block::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0)    0%,
        rgba(255,255,255,0.55) 50%,
        rgba(255,255,255,0)   100%
    );
    animation: p-shimmer 1.5s ease-in-out infinite;
    will-change: transform;
}

/* Skeleton product card — mirrors .p-card exactly */
.p-skeleton-card {
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    border: 1.5px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.03);
    /* Reserve exact height so layout is stable when real cards arrive */
}

/* Image area — same aspect-ratio as real .p-card-img */
.p-skel-img {
    aspect-ratio: 3 / 4;
    width: 100%;
    border-radius: 0;
    background: #ebebeb;
    position: relative;
    overflow: hidden;
}

.p-skel-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0)    0%,
        rgba(255,255,255,0.55) 50%,
        rgba(255,255,255,0)   100%
    );
    animation: p-shimmer 1.5s ease-in-out infinite;
    will-change: transform;
}

/* Text-line placeholders — mirrors .p-card-body padding */
.p-skel-body {
    padding: 0.85rem 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.p-skel-cat   { height: 10px; width: 50%; }
.p-skel-name  { height: 14px; width: 80%; }
.p-skel-stars { height: 10px; width: 65%; }
.p-skel-price { height: 16px; width: 40%; margin-top: 4px; }

/* Real cards: fade in smoothly when injected */
.p-card-anchor-wrap {
    opacity: 0;
    animation: p-fade-in 0.35s ease forwards;
}

@keyframes p-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Stagger delay per card — applied via JS inline style */
.p-card-anchor-wrap { animation-delay: var(--p-card-delay, 0ms); }

/* ============================================
   EMPTY STATE
   ============================================ */
.p-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 1rem;
    text-align: center;
    color: #86868b;
    gap: 1rem;
    width: 100%;
}

.p-empty-icon {
    font-size: 3rem;
    opacity: 0.35;
    line-height: 1;
}

.p-empty-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
}

.p-empty-desc {
    font-size: 0.875rem;
    margin: 0;
    max-width: 260px;
    line-height: 1.6;
}

/* ============================================
   ERROR STATE
   ============================================ */
.p-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 1rem;
    text-align: center;
    gap: 1rem;
    width: 100%;
}

.p-error-icon {
    font-size: 2.5rem;
    color: #ff3b30;
    opacity: 0.7;
    line-height: 1;
}

.p-error-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0;
}

.p-error-desc {
    font-size: 0.875rem;
    color: #86868b;
    margin: 0;
    max-width: 280px;
    line-height: 1.6;
}

.p-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #1d1d1f;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    margin-top: 0.25rem;
}

.p-retry-btn:hover {
    background: #000;
    transform: translateY(-1px);
}

/* ============================================
   PRODUCT CARD
   ============================================ */
.p-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(0, 0, 0, 0.07);
    border-radius: 22px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.03);
}

.p-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.07);
    border-color: rgba(0, 0, 0, 0.15);
}

/* Image Area */
.p-card-img {
    position: relative;
    aspect-ratio: 3 / 4;
    background: #f5f5f7;
    overflow: hidden;
}

.p-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.p-card:hover .p-card-img img {
    transform: scale(1.04);
}

/* Badge */
.p-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.p-badge-dark {
    background: #1d1d1f;
    color: #fff;
}

.p-badge-white {
    background: rgba(255, 255, 255, 0.95);
    color: #1d1d1f;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Action Buttons — always visible top-right */
.p-card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.p-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1d1d1f;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    backdrop-filter: blur(4px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.p-action-btn:hover {
    background: #1d1d1f;
    color: #fff;
    transform: scale(1.1);
}

/* Card Body */
.p-card-body {
    padding: 0.85rem 0.9rem 1rem;
}

.p-cat {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #86868b;
    margin-bottom: 3px;
}

.p-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 0 5px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.p-name a {
    color: inherit;
    text-decoration: none;
}

.p-name a:hover {
    color: #000;
}

.p-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1d1d1f;
}

.p-rating i {
    color: #f4a200;
    font-size: 0.72rem;
}

.p-reviews {
    color: #86868b !important;
    font-weight: 400 !important;
}

.p-price {
    font-size: 1rem;
    font-weight: 800;
    color: #1d1d1f;
    letter-spacing: -0.02em;
}

/* ============================================
   PAGINATION
   ============================================ */
.p-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 2.5rem;
}

.p-page {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1.5px solid #e5e5e7;
    background: #fff;
    color: #1d1d1f;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: inherit;
}

.p-page:hover {
    border-color: #1d1d1f;
    background: #f5f5f7;
}

.p-page.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.p-page-next {
    width: auto;
    padding: 0 12px;
}

/* ============================================
   FILTER OVERLAY (Mobile)
   ============================================ */
.filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.filter-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */
@media (max-width: 767.98px) {
    .filter-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 320px !important;
        max-width: 85vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
        background: #fff !important;
        z-index: 1050 !important;
        padding: 24px !important;
        transform: translateX(-100%) !important;
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
        border-radius: 0 24px 24px 0 !important;
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.08) !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .filter-sidebar.open {
        transform: translateX(0) !important;
    }

    .filter-sidebar-footer {
        display: flex !important;
    }

    .shop-content-row {
        flex-direction: column;
        gap: 0;
    }
}

@media (max-width: 576px) {
    .shop-title-row {
        /* No longer stack sort below title on small screens —
           the toolbar handles that separately */
        align-items: flex-start;
    }

    .p-card-body {
        padding: 0.7rem 0.75rem 0.85rem;
    }

    .p-name {
        font-size: 0.82rem;
    }

    .p-price {
        font-size: 0.9rem;
    }
}

/* ============================================
   CONTROLS TOOLBAR — RESPONSIVE
   ============================================ */

/* Mobile: unified toolbar bar, controls are halves divided by vertical line */
@media (max-width: 767.98px) {
    .controls-toolbar {
        display: flex;
        align-items: stretch;
        gap: 0;
        padding: 0;
        margin-bottom: 1.25rem;
        background: #ffffff;
        border: 1.5px solid #e5e5e7;
        border-radius: 14px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04), 0 2px 10px rgba(0, 0, 0, 0.03);
    }

    /* Filter button — left half of unified bar */
    .ctrl-filter-btn {
        width: 50%;
        max-width: 50%;
        height: 48px;
        padding: 0 16px;
        border: none;
        border-right: 1.5px solid #e5e5e7;
        border-radius: 12px 0 0 12px;
        background: transparent;
        box-shadow: none;
        justify-content: center;
        transform: none !important;
    }

    .ctrl-filter-btn:hover, .ctrl-filter-btn:active {
        background: #f5f5f7;
        box-shadow: none !important;
        transform: none !important;
    }

    /* Sort wrapper — right half of unified bar */
    .ctrl-sort-wrap {
        width: 50%;
        max-width: 50%;
        margin-left: 0;
        display: flex;
        align-items: stretch;
    }

    /* Sort dropdown itself fills its container height and width */
    .ctrl-sort-wrap .custom-sort-dropdown {
        width: 100%;
        height: 100%;
    }

    /* Trigger fills the dropdown width and height */
    .ctrl-sort-wrap .custom-sort-selected {
        width: 100%;
        height: 100%;
        border: none;
        border-radius: 0 12px 12px 0;
        background: transparent;
        box-shadow: none;
        justify-content: center;
        gap: 8px;
        padding: 0 16px;
        align-items: center;
        transform: none !important;
    }

    .ctrl-sort-wrap .custom-sort-selected:hover,
    .ctrl-sort-wrap .custom-sort-selected:active,
    .ctrl-sort-wrap .custom-sort-dropdown.open .custom-sort-selected {
        background: #f5f5f7;
        box-shadow: none !important;
        transform: none !important;
    }

    /* Options panel: drop down from the unified bar */
    .ctrl-sort-wrap .custom-sort-options {
        right: 0;
        left: auto;
        min-width: 100%;
        top: calc(100% + 4px);
    }
}

/* Tablet (768–991px): give controls a bit more breathing room */
@media (min-width: 768px) and (max-width: 991.98px) {
    .ctrl-filter-btn {
        padding: 0 24px;
    }

    .ctrl-sort-wrap .custom-sort-dropdown {
        width: 220px;
    }
}

/* Desktop (≥768px): remove borders from both controls — clean, borderless look */
@media (min-width: 768px) {
    .ctrl-filter-btn {
        border-color: transparent;
        box-shadow: none;
    }

    .ctrl-filter-btn:hover {
        border-color: transparent;
        box-shadow: none;
        background: #f5f5f7;
    }

    .controls-toolbar .custom-sort-selected {
        border-color: transparent;
        box-shadow: none;
    }

    .controls-toolbar .custom-sort-selected:hover {
        border-color: transparent;
        box-shadow: none;
        background: #f5f5f7;
    }

    .controls-toolbar .custom-sort-dropdown.open .custom-sort-selected {
        border-color: transparent;
        box-shadow: none;
        background: #f5f5f7;
    }
}
