/* Shop / products listing — ported from Blazor scoped CSS (Products*, ProductsProduct*) */
.shop-page {
    max-width: 1400px;
    margin: 0 auto;
    --shop-page-inline-padding: 24px;
    padding: 24px;
}

.shop-main {
    min-width: 0;
}

.shop-main--loading {
    position: relative;
}

.shop-main--loading .product-grid,
.shop-main--loading .shop-load-more-region {
    pointer-events: none;
    opacity: 0.55;
}

.shop-main--loading::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 5;
    cursor: wait;
}

.shop-loading {
    position: relative;
    min-height: 240px;
    background: #ffffff;
    border-radius: 20px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 24px 16px;
}

.shop-loading p {
    max-width: 100%;
    text-align: center;
    line-height: 1.45;
    overflow-wrap: break-word;
}

.reload-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(43, 184, 200, 0.25);
    border-top-color: var(--teal, #2BB8C8);
    border-radius: 50%;
    animation: reload-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes reload-spin {
    to { transform: rotate(360deg); }
}

.shop-spinner {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.spinner-dot {
    width: 12px;
    height: 12px;
    background: var(--teal, #2BB8C8);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.spinner-dot:nth-child(1) { animation-delay: -0.32s; }
.spinner-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.shop-breadcrumb {
    margin-bottom: 24px;
}

.shop-breadcrumb ol {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    font-size: 14px;
}

.shop-breadcrumb a {
    color: var(--text-mid, #2C3E50);
    text-decoration: none;
}

.shop-breadcrumb a:hover {
    color: var(--teal, #2BB8C8);
}

.shop-breadcrumb .current {
    color: var(--navy, #0F2A44);
    font-weight: 600;
}

.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
}

/* Mobile filter toggle button */
.mobile-filter-btn {
    display: none;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--navy, #0F2A44);
    margin-bottom: 16px;
    position: relative;
}
.filter-badge {
    width: 8px; height: 8px;
    background: var(--teal, #2BB8C8);
    border-radius: 50%;
    display: inline-block;
}

/* Mobile filter drawer — portaled to body (ProductsFilterDrawer.tsx) */
.filter-drawer-overlay {
    position: fixed;
    inset: 0;
    top: var(--site-header-offset, 0);
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    cursor: default;
    -webkit-tap-highlight-color: transparent;
    animation: filter-drawer-overlay-in 0.22s ease forwards;
}

@keyframes filter-drawer-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.filter-drawer {
    position: fixed;
    top: var(--site-header-offset, 0);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100vw;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    background: #fff;
    transform: translate3d(-100%, 0, 0);
    transition: none;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
    box-shadow: none;
}

.filter-drawer--animating {
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.28s;
}

.filter-drawer--open {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    pointer-events: auto;
}

.filter-drawer--open.filter-drawer--animating {
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
}

[dir="rtl"] .filter-drawer {
    transform: translate3d(100%, 0, 0);
}

[dir="rtl"] .filter-drawer--open {
    transform: translate3d(0, 0, 0);
}

.filter-drawer-head {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: max(14px, env(safe-area-inset-top)) 16px 14px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}

.filter-drawer-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--navy, #0F2A44);
    line-height: 1.2;
}

.filter-drawer-close {
    display: flex;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--navy, #0F2A44);
}

.filter-drawer-close:hover {
    background: #ebebeb;
}

.filter-drawer-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px;
    overscroll-behavior: contain;
}

.filter-drawer-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #e8e8e8;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.filter-drawer-apply-btn {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding: 14px 16px;
    background: var(--navy, #0F2A44);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.2s;
}

.filter-drawer-apply-btn:hover {
    background: var(--teal, #2BB8C8);
}

.filter-drawer-clear-btn {
    flex-shrink: 0;
    min-height: 48px;
    padding: 14px 16px;
    background: transparent;
    color: var(--text-mid, #2C3E50);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: border-color 0.2s, color 0.2s, opacity 0.2s;
}

.filter-drawer-clear-btn:hover:not(:disabled) {
    border-color: var(--teal, #2BB8C8);
    color: var(--teal, #2BB8C8);
}

.filter-drawer-clear-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

body.filter-drawer-open {
    overflow: hidden;
}

body.filter-drawer-open .shop-back-to-top {
    display: none !important;
}

body.filter-drawer-open .filter-drawer .custom-select__backdrop {
    z-index: 10059;
}

body.filter-drawer-open .filter-drawer .custom-select__panel--portaled {
    z-index: 10060;
}

@media (max-width: 968px) {
    .shop-layout {
        display: block;
    }

    .mobile-filter-btn {
        display: flex;
    }

    .shop-sidebar--desktop {
        display: none;
    }

    .filter-panel--drawer .filter-head-row {
        display: none;
    }

    .filter-panel--drawer .btn-apply {
        display: none;
    }

    .filter-drawer .category-tree-children {
        padding-inline-start: 8px;
    }

    .filter-drawer .category-expand-btn,
    .filter-drawer .category-spacer {
        width: 18px;
    }

    .filter-drawer .category-tree-children .category-tree-children {
        padding-inline-start: 6px;
    }

    .shop-page--filter-drawer-open .shop-main > .shop-header,
    .shop-page--filter-drawer-open .mobile-filter-btn,
    .shop-page--filter-drawer-open .shop-breadcrumb {
        visibility: hidden;
        pointer-events: none;
    }
}

@media (min-width: 969px) {
    .shop-layout {
        --shop-sidebar-width: 280px;
    }

    .shop-sidebar--desktop {
        align-self: start;
        width: var(--shop-sidebar-width);
    }

    /* Fixed (not sticky) so the card stays visible while the product grid scrolls.
       Tall filter lists scroll inside the card with no visible scrollbar. */
    .shop-sidebar--desktop .filter-panel {
        position: fixed;
        z-index: 5;
        top: calc(var(--site-header-offset, 98px) + 16px);
        width: var(--shop-sidebar-width);
        max-height: calc(100dvh - var(--site-header-offset, 98px) - 32px);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .shop-sidebar--desktop .filter-panel::-webkit-scrollbar {
        display: none;
    }

    [dir="ltr"] .shop-sidebar--desktop .filter-panel {
        left: calc((100vw - min(100vw, 1400px)) / 2 + var(--shop-page-inline-padding, 24px));
        right: auto;
    }

    [dir="rtl"] .shop-sidebar--desktop .filter-panel {
        right: calc((100vw - min(100vw, 1400px)) / 2 + var(--shop-page-inline-padding, 24px));
        left: auto;
    }
}













































.shop-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow, 0 20px 35px -12px rgba(0,0,0,0.12));
    gap: 12px;
}

.shop-header--results-only {
    padding: 10px 16px;
}

.shop-header--results-only .results-count {
    margin: 0;
}

.shop-sidebar-controls {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow, 0 20px 35px -12px rgba(0,0,0,0.12));
}

.shop-sidebar-controls-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.shop-sidebar-controls .sort-control {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    position: relative;
}

.shop-sidebar-controls .sort-control select,
.shop-sidebar-controls .sort-control .custom-select--sort {
    width: 100%;
    max-width: none;
    flex: none;
}

.shop-sidebar-controls .sort-control .custom-select--inline {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 6px;
}

.shop-sidebar-controls .sort-control .custom-select--inline .custom-select__label {
    align-self: flex-start;
}

.shop-sidebar-controls .sort-control .custom-select--inline .custom-select__control {
    flex: none;
    width: 100%;
}

.shop-sidebar-controls .view-toggle {
    align-self: flex-start;
}

.shop-sidebar-controls .scroll-peek-wrap {
    --section-inline-padding: 0;
    margin-inline: 0;
}

.shop-sidebar-controls-row--compact {
    flex-direction: row;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 0;
}

.shop-sidebar-controls-row--sort {
    margin-bottom: 8px;
}

.shop-sidebar-controls-row--view {
    margin-bottom: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.shop-sidebar-controls-row--view .view-toggle {
    width: 100%;
    justify-content: flex-start;
}

.shop-sidebar-controls--drawer {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: transparent;
    border-radius: 0;
    padding: 12px 0 16px;
    margin-bottom: 0;
    box-shadow: none;
    border-bottom: 1px solid #f0f0f0;
}

.shop-sidebar-controls--drawer .shop-sidebar-controls-row {
    margin-bottom: 0;
}

.shop-sidebar-controls--drawer .shop-sidebar-controls-row--view {
    padding-bottom: 0;
    border-bottom: none;
}

.shop-sidebar-controls--drawer .shop-sidebar-controls-row--sort .sort-control {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

.shop-sidebar-controls--drawer .shop-sidebar-controls-row--sort .sort-control .custom-select--inline {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 6px;
}

.shop-sidebar-controls--drawer .shop-sidebar-controls-row--sort .sort-control .custom-select--inline .custom-select__label {
    align-self: flex-start;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-mid, #2C3E50);
}

.shop-sidebar-controls--drawer .shop-sidebar-controls-row--sort .sort-control .custom-select--inline .custom-select__control {
    width: 100%;
}

.shop-sidebar-controls--drawer .shop-sidebar-controls-row--view .view-toggle {
    flex-shrink: 0;
    align-self: center;
}

.shop-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}

.results-count {
    color: var(--text-mid, #2C3E50);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
}

.sort-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-mid, #2C3E50);
    white-space: nowrap;
}

.sort-control select,
.sort-control .custom-select--sort {
    flex: 1;
    max-width: 200px;
    min-width: 0;
}

.view-toggle {
    display: flex;
    direction: ltr;
    gap: 3px;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 3px;
    background: #e8e8e8;
    flex-shrink: 0;
}

.view-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: all 0.15s;
}

.view-btn:hover { color: var(--navy, #0F2A44); background: #ffffff; }
.view-btn.active { background: white; color: var(--navy, #0F2A44); box-shadow: 0 1px 4px rgba(0,0,0,0.15); }




.product-card.skeleton {
    position: relative;
    background: white;
    border-radius: var(--product-btn-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow, 0 20px 35px -12px rgba(0,0,0,0.12));
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.skeleton-image {
    aspect-ratio: 1;
    background: #e5e5e5;
    border-radius: var(--product-card-radius) var(--product-card-radius) 0 0;
}

.skeleton-text {
    height: 16px;
    background: #e5e5e5;
    margin: 12px;
    border-radius: 4px;
}

.skeleton-text.short {
    width: 60%;
}

.shop-main > .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.shop-main > .product-grid.grid2-view {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.shop-main > .product-grid.grid4-view {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.shop-main > .product-grid.list-view {
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (max-width: 820px) {
    .shop-main > .product-grid.grid4-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .shop-main > .product-grid.grid2-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .shop-main > .product-grid.grid4-view .product-info .name {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }

    .shop-main > .product-grid.grid4-view .btn-add {
        font-size: 12px;
        padding: 8px;
        margin: auto 8px 8px;
        width: calc(100% - 16px);
        white-space: nowrap;
    }
}

.error-state,
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.error-state p {
    color: #e74c3c;
    margin-bottom: 16px;
}

.empty-state p {
    color: var(--text-mid, #2C3E50);
    font-size: 16px;
    margin-bottom: 16px;
}

.btn-retry,
.btn-clear {
    padding: 10px 24px;
    background: var(--teal, #2BB8C8);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px;
}

.btn-page {
    padding: 10px 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-page:hover:not(:disabled) {
    border-color: var(--teal, #2BB8C8);
    color: var(--teal, #2BB8C8);
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 4px;
}

.page-num {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.page-num:hover:not(.active) {
    border-color: var(--teal, #2BB8C8);
}

.page-num.active {
    background: var(--navy, #0F2A44);
    color: white;
    border-color: var(--navy, #0F2A44);
}

.ellipsis {
    padding: 0 8px;
    color: #999;
}

/* Infinite scroll load-more region — fixed height avoids scroll jump */
.shop-load-more-region {
    position: relative;
    min-height: 88px;
    margin-top: 28px;
    padding: 0 8px 56px;
}

.shop-load-more-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 16px;
    color: #667085;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.shop-load-more-hint {
    opacity: 0.72;
}

.shop-load-more-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(15, 42, 68, 0.12);
    border-top-color: var(--teal, #2BB8C8);
    border-radius: 50%;
    animation: reload-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.shop-end-of-results {
    margin: 0;
    padding: 16px 8px 8px;
    text-align: center;
    color: #98a2b3;
    font-size: 13px;
}

.shop-load-more-sentinel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 24px;
    height: 1px;
    pointer-events: none;
}

.shop-back-to-top {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(20px, calc(16px + env(safe-area-inset-bottom)));
    z-index: 45;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 999px;
    background: var(--navy, #0F2A44);
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 42, 68, 0.24);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.shop-back-to-top:hover {
    transform: translateY(-2px);
    background: #163552;
}

.shop-back-to-top:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .shop-load-more-region {
        margin-top: 20px;
        padding-bottom: 72px;
    }

    .shop-back-to-top {
        width: 44px;
        height: 44px;
        bottom: max(24px, calc(20px + env(safe-area-inset-bottom)));
    }
}

@media (max-width: 768px) {
    .shop-page {
        padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px));
    }

    .shop-page .shop-main > .shop-header {
        margin-inline: calc(-1 * var(--shop-page-inline-padding));
        border-radius: 0;
    }

    .shop-page .shop-header .scroll-peek-wrap {
        --section-inline-padding: 12px;
    }

    .shop-page .pagination {
        margin-bottom: 8px;
    }
}

@media (max-width: 640px) {
    .shop-page {
        --shop-page-inline-padding: 12px;
        padding: 12px;
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }

    .shop-loading {
        min-height: 200px;
        border-radius: 16px;
        padding: 20px 12px;
    }

    .shop-breadcrumb {
        margin-bottom: 12px;
    }

    .shop-header-row {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
        gap: 8px 12px;
    }

    .results-count {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
    }

    .view-toggle {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        align-self: center;
    }

    .sort-control {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: stretch;
        align-self: stretch;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        width: 100%;
        max-width: none;
        position: relative;
    }

    .sort-control .reload-spinner {
        position: absolute;
        top: 2px;
        inset-inline-end: 0;
    }

    .sort-control select,
    .sort-control .custom-select--sort {
        width: 100%;
        max-width: none;
        flex: none;
    }

    .sort-control .custom-select--inline {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 6px;
    }

    .sort-control .custom-select--inline .custom-select__label {
        align-self: flex-start;
    }

    .sort-control .custom-select--inline .custom-select__control {
        flex: none;
        width: 100%;
    }

    [dir="rtl"] .shop-header-row .sort-control,
    [dir="rtl"] .products-section .shop-header-row .sort-control {
        flex-direction: column;
        align-items: stretch;
    }

    [dir="rtl"] .sort-control .custom-select--inline {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-filter-btn {
        min-height: 44px;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 6px;
        padding: 16px 8px;
    }

    .page-num {
        min-width: 40px;
        min-height: 40px;
    }

    .btn-page {
        min-height: 40px;
    }
}


.product-card {
    position: relative;
    background: white;
    border-radius: var(--product-btn-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    box-shadow: var(--shadow, 0 20px 35px -12px rgba(0,0,0,0.12));
    transition: transform 0.2s, box-shadow 0.2s;
}

.added-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #ffffff;
    border-radius: var(--product-btn-radius);
    color: var(--navy, #0F2A44);
    font-weight: 700;
    font-size: 15px;
    animation: added-pop 0.2s ease-out;
}

.added-check {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--teal, #2BB8C8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes added-pop {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 40px -12px rgba(0,0,0,0.15);
}

.product-card.skeleton {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.skeleton-image {
    aspect-ratio: 1;
    background: #e5e5e5;
    border-radius: var(--product-card-radius) var(--product-card-radius) 0 0;
}

.skeleton-text {
    height: 16px;
    background: #e5e5e5;
    margin: 12px;
    border-radius: 4px;
}

.skeleton-text.short {
    width: 60%;
}

.product-link {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    text-decoration: none;
    color: inherit;
}

.product-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
    isolation: isolate;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.badge {
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    left: 10px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    pointer-events: none;
}

.badge.discount {
    background: #FF6B6B;
    color: white;
}

.stock-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
}

.stock-badge.out {
    background: rgba(0,0,0,0.7);
    color: white;
}

.stock-badge.low {
    background: #FFA500;
    color: white;
}

.product-info {
    padding: 16px;
    flex: 0 0 auto;
    min-width: 0;
}

.product-info .brand {
    font-size: 12px;
    color: var(--text-mid, #2C3E50);
    margin-bottom: 4px;
}

.product-info .name {
    font-size: 15px;
    font-weight: 600;
    color: var(--navy, #0F2A44);
    margin-bottom: 8px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.product-info .price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price .current {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy, #0F2A44);
}

.price .original {
    font-size: 14px;
    color: #767676;
    text-decoration: line-through;
}

.btn-add {
    width: calc(100% - 32px);
    margin: auto 16px 16px;
    padding: 12px;
    background: var(--navy, #0F2A44);
    color: white;
    border: none;
    border-radius: var(--product-btn-radius);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.btn-add--oos {
    background: #e8e8e8;
    color: #767676;
    cursor: not-allowed;
}

.btn-add:hover:not(:disabled) {
    background: var(--teal, #2BB8C8);
}

.btn-add:disabled,
.btn-add.adding {
    background: #ccc;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .product-info .name {
        font-size: 14px;
    }

    .product-info .price .current {
        font-size: 15px;
    }

    .btn-add {
        font-size: 13px;
        padding: 10px;
        min-height: 40px;
    }
}



.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.product-grid.grid2-view {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.product-grid.grid4-view {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.product-grid.list-view {
    grid-template-columns: 1fr;
    gap: 12px;
}

.product-grid.list-view .product-card {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    align-items: center;
    border-radius: var(--product-btn-radius);
    flex-direction: unset;
}

.product-grid.list-view .product-link {
    display: grid;
    grid-template-columns: 140px 1fr;
    grid-column: 1 / 3;
    align-items: center;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.product-grid.list-view .product-image {
    aspect-ratio: 1;
    width: 140px;
    height: 140px;
    border-radius: var(--product-card-radius) 0 0 var(--product-card-radius);
    flex-shrink: 0;
    align-self: start;
}

.product-grid.list-view .product-info {
    padding: 16px 20px;
}

.product-grid.list-view .product-info .name {
    font-size: 16px;
    -webkit-line-clamp: unset;
    overflow: visible;
    display: block;
}

.product-grid.list-view .product-info .price {
    margin-top: 8px;
}

.product-grid.list-view .btn-add {
    width: auto;
    min-width: 110px;
    margin: 0 14px 0 0;
    padding: 10px 14px;
    white-space: nowrap;
    align-self: center;
    font-size: 13px;
    border-radius: 10px;
}

.product-grid.virtualized > div {
    display: contents;
}

@media (max-width: 820px) {
    .product-grid.grid4-view,
    .shop-main > .product-grid.grid4-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

@media (max-width: 640px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .product-grid.grid4-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .product-grid.grid2-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .product-grid.grid2-view .product-info {
        padding: 10px;
    }

    .product-grid.grid2-view .product-info .name {
        font-size: 13px;
    }

    .product-grid.grid2-view .product-info .price .current {
        font-size: 13px;
    }

    .product-grid.grid2-view .product-info .name,
    .product-grid.grid4-view .product-info .name {
        font-size: 13px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .product-grid.grid2-view .btn-add,
    .product-grid.grid4-view .btn-add {
        font-size: 12px;
        padding: 8px;
        margin: auto 8px 8px;
        width: calc(100% - 16px);
        min-height: 36px;
    }

    .product-grid.list-view .product-card {
        grid-template-columns: 90px 1fr auto;
    }

    .product-grid.list-view .product-link {
        grid-template-columns: 90px 1fr;
    }

    .product-grid.list-view .product-image {
        width: 90px;
        height: 90px;
    }

    .product-grid.list-view .product-info {
        padding: 10px 12px;
    }

    .product-grid.list-view .product-info .name {
        font-size: 13px;
    }

    .product-grid.list-view .btn-add {
        min-width: unset;
        width: 38px;
        height: 38px;
        padding: 0;
        margin: 0 10px 0 0;
        border-radius: 50%;
        font-size: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .product-grid.list-view .btn-add::after {
        content: "";
        display: block;
        width: 18px;
        height: 18px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-size: contain;
    }
}


.shop-sidebar-controls .shop-category-strip {
    flex-wrap: wrap;
}

@media (max-width: 968px) {
    .filter-panel,
    .filter-panel--drawer {
        box-shadow: none;
        padding: 12px 0 0;
        border-radius: 0;
        background: transparent;
    }

    .filter-drawer .filter-panel--drawer {
        padding-top: 16px;
    }

    .filter-drawer .filter-section {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .filter-drawer .filter-section h3 {
        margin-bottom: 8px;
    }

    .filter-drawer .filter-head {
        margin-bottom: 0;
        padding: 4px 0;
    }
}
.filter-panel {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow, 0 20px 35px -12px rgba(0,0,0,0.12));
}
.filter-panel h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--navy, #0F2A44);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--teal, #2BB8C8);
}
.filter-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--teal, #2BB8C8);
}
.filter-head-row h2 {
    margin: 0;
    padding: 0;
    border: none;
}
.clear-all-btn {
    background: none;
    border: none;
    color: var(--teal, #2BB8C8);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 4px;
    white-space: nowrap;
}
.clear-all-btn:hover {
    text-decoration: underline;
}
.filter-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.filter-section h3 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--navy, #0F2A44);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    margin-bottom: 12px;
}
.filter-head h3 {
    margin-bottom: 0;
}
.filter-chevron {
    color: var(--navy, #0F2A44);
    flex-shrink: 0;
    transition: transform 0.25s ease;
}
.filter-body {
    display: grid;
    grid-template-rows: 1fr;
    opacity: 1;
    transition: grid-template-rows 0.28s ease, opacity 0.2s ease;
}
.filter-body > * {
    min-height: 0;
    overflow: hidden;
}
.filter-section.collapsed .filter-head {
    margin-bottom: 0;
}
.filter-section.collapsed .filter-chevron {
    transform: rotate(-90deg);
}
.filter-section.collapsed .filter-body {
    grid-template-rows: 0fr;
    opacity: 0;
}
.category-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}
.brand-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.filter-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.brand-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}
.brand-item:hover {
    background: #f5f5f5;
}
.brand-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--teal, #2BB8C8);
    cursor: pointer;
}
.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.price-inputs input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    min-width: 0;
}
.price-inputs input:focus {
    outline: none;
    border-color: var(--teal, #2BB8C8);
}
.btn-apply {
    width: 100%;
    padding: 12px;
    background: var(--navy, #0F2A44);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}
.btn-apply:hover {
    background: var(--teal, #2BB8C8);
    transform: translateY(-1px);
}
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag-btn {
    padding: 6px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.tag-btn:hover {
    border-color: var(--teal, #2BB8C8);
    color: var(--teal, #2BB8C8);
}
.tag-btn.active {
    background: var(--teal, #2BB8C8);
    color: white;
    border-color: var(--teal, #2BB8C8);
}
.color-list,
.size-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.color-btn,
.size-btn {
    padding: 6px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.color-btn:hover,
.size-btn:hover {
    border-color: var(--teal, #2BB8C8);
    color: var(--teal, #2BB8C8);
}
.color-btn.active,
.size-btn.active {
    background: var(--teal, #2BB8C8);
    color: white;
    border-color: var(--teal, #2BB8C8);
}

/* Category filter tree — ported from CategoryFilterTreeNode.razor.css */
.category-tree-item {
    margin-bottom: 2px;
}

.category-tree-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.category-expand-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--navy, #0F2A44);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    padding: 0;
    line-height: 0;
}

.category-expand-btn:hover {
    background: #f0f0f0;
}

.category-expand-icon {
    display: block;
    transition: transform 0.2s ease;
    transform: rotate(-90deg);
}

.category-expand-btn.expanded .category-expand-icon {
    transform: rotate(0deg);
}

.category-spacer {
    width: 24px;
    flex-shrink: 0;
    display: inline-block;
}

.category-link {
    flex: 1;
    min-width: 0;
    display: block;
    padding: 8px 12px;
    color: var(--text-mid, #2C3E50);
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    overflow-wrap: anywhere;
    text-align: start;
}

.category-link:hover {
    background: #f5f5f5;
    color: var(--teal, #2BB8C8);
    text-decoration: none;
}

.category-link.active {
    background: var(--teal, #2BB8C8);
    color: white;
    font-weight: 500;
}

.category-tree-children {
    list-style: none;
    margin: 2px 0 0;
    padding: 0;
    padding-inline-start: 20px;
}

.shop-sidebar--desktop {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
