/* ─── Shop header ─── */
.shop-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-sm) 0 var(--space-lg);
}

.shop-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.shop-header__title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    margin: 0;
    letter-spacing: -0.02em;
}

/* ─── Sidebar + Content layout ─── */
.shop-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--space-xl);
    align-items: start;
}

/* ─── Sidebar filters ─── */
.shop-sidebar {
    position: sticky;
    top: calc(var(--header-height) + var(--space-lg));
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* ─── Search bar ─── */
.shop-search__wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.shop-search__icon {
    position: absolute;
    left: 0.625rem;
    color: var(--color-text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.shop-search__input {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 2.25rem;
    font-size: var(--font-size-sm);
    font-family: inherit;
    color: var(--color-text);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.shop-search__input::placeholder {
    color: var(--color-text-muted);
}

.shop-search__input:focus {
    border-color: var(--color-brand);
}

.shop-search__input:focus ~ .shop-search__icon,
.shop-search__wrapper:has(.shop-search__input:focus) .shop-search__icon {
    color: var(--color-brand);
}

.shop-search__clear {
    position: absolute;
    right: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: none;
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition:
        color var(--transition-fast),
        background var(--transition-fast);
}

.shop-search__clear:hover {
    color: var(--color-text);
    background: #f5f5f5;
}

/* Hide native search clear button (Webkit/Blink) */
.shop-search__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    display: none;
}

/* ─── Product content area ─── */
.shop-content {
    overflow: visible;
}

/* AJAX loading state */
.shop-content.is-loading {
    pointer-events: none;
}

.shop-content.is-loading .product-card {
    opacity: 0;
    transform: scale(0.97) translateY(6px);
    transition: opacity 0.12s cubic-bezier(0.4, 0, 1, 1),
                transform 0.12s cubic-bezier(0.4, 0, 1, 1);
}

/* Entrance animation for new cards */
.product-card {
    animation: cardIn 0.3s cubic-bezier(0, 0, 0.2, 1) both;
}

.product-card:nth-child(1) { animation-delay: 0s; }
.product-card:nth-child(2) { animation-delay: 0.04s; }
.product-card:nth-child(3) { animation-delay: 0.08s; }
.product-card:nth-child(4) { animation-delay: 0.12s; }
.product-card:nth-child(5) { animation-delay: 0.16s; }
.product-card:nth-child(6) { animation-delay: 0.2s; }

@keyframes cardIn {
    from {
        opacity: 0;
        transform: scale(0.97) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.shop-filter__reset {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    padding: 0.4rem 0.875rem;
    border-radius: 6px;
    transition:
        color var(--transition-fast),
        background var(--transition-fast);
}

.shop-filter__reset:hover {
    color: var(--color-text);
    background: #f5f5f5;
}

.shop-filter__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin: 0;
    padding: 0.5rem 0.625rem;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition:
        color var(--transition-fast),
        background var(--transition-fast);
}

.shop-filter__title:hover {
    color: var(--color-text);
    background: #f5f5f5;
}

.shop-filter__title::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.shop-filter.is-open > .shop-filter__title::after {
    transform: rotate(-135deg) translateY(-2px);
}

/* Filter body collapse/expand */
.shop-filter__body {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition:
        grid-template-rows 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.25s cubic-bezier(0.4, 0, 1, 1);
}

.shop-filter.is-open > .shop-filter__body {
    grid-template-rows: 1fr;
    opacity: 1;
    transition:
        grid-template-rows 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.3s 0.05s cubic-bezier(0, 0, 0.2, 1);
}

.shop-filter__body > * {
    overflow: hidden;
}

.shop-filter__body .shop-filter__list,
.shop-filter__body .price-slider {
    margin-top: var(--space-sm);
}

.shop-filter__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shop-filter__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xs);
    padding: 0.5rem 0.625rem;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-decoration: none;
    border-radius: 6px;
    transition:
        color var(--transition-fast),
        background var(--transition-fast);
}

.shop-filter__link:hover {
    color: var(--color-text);
    background: #f5f5f5;
}

.shop-filter__link.is-active {
    color: var(--color-text);
    background: rgba(255, 203, 5, 0.12);
    font-weight: 500;
}

.shop-filter__count {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    background: #f5f5f5;
    padding: 0.1rem 0.45rem;
    border-radius: 100px;
    min-width: 1.5rem;
    text-align: center;
    line-height: 1.4;
}

.shop-filter__link.is-active .shop-filter__count {
    background: rgba(255, 203, 5, 0.2);
}

/* ─── Pre-release filter ("Očekáváme") ─── */
.shop-filter__link--prerelease {
    font-weight: 500;
    color: var(--color-fire);
    margin-bottom: var(--space-xs);
}

.shop-filter__link--prerelease:hover {
    background: var(--color-fire-bg);
}

.shop-filter__link--prerelease.is-active {
    background: var(--color-fire-bg-active);
    font-weight: 600;
}

/* ─── Price range slider ─── */
.price-slider {
    padding: 0.25rem 0.625rem;
}

.price-slider__track {
    position: relative;
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    margin: 1rem 0 0.75rem;
}

.price-slider__range {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--color-brand);
    border-radius: 2px;
    pointer-events: none;
}

.price-slider__input {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 0;
    margin: 0;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    outline: none;
    transform: translateY(-50%);
}

.price-slider__input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--color-brand);
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.price-slider__input::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 4px rgba(255, 203, 5, 0.2);
    transform: scale(1.1);
}

.price-slider__input::-webkit-slider-thumb:active {
    box-shadow: 0 0 0 6px rgba(255, 203, 5, 0.25);
    transform: scale(1.15);
}

.price-slider__input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--color-brand);
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.price-slider__input::-moz-range-thumb:hover {
    box-shadow: 0 0 0 4px rgba(255, 203, 5, 0.2);
}

.price-slider__values {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-slider__value {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* ─── Product grid — 4 columns (sidebar present) ─── */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ─── Pagination ─── */
.shop-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    padding: var(--space-xl) 0 var(--space-lg);
}

.shop-pagination a,
.shop-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    border-radius: 6px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    transition:
        background var(--transition-fast),
        color var(--transition-fast);
}

.shop-pagination a {
    color: var(--color-text-muted);
}

.shop-pagination a:hover {
    background: #f5f5f5;
    color: var(--color-text);
}

.shop-pagination .current {
    background: var(--color-brand);
    color: var(--color-text);
}

/* ─── Empty state ─── */
.shop-empty {
    text-align: center;
    padding: var(--space-xl) 0;
}

.shop-empty__text {
    font-size: var(--font-size-lg);
    color: var(--color-text-muted);
    margin: 0 0 var(--space-lg);
}

/* ─── View toggle ─── */
.shop-view-toggle {
    display: flex;
    gap: 2px;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 2px;
}

.shop-view-toggle__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition:
        color var(--transition-fast),
        background var(--transition-fast),
        box-shadow var(--transition-fast);
}

.shop-view-toggle__btn:hover {
    color: var(--color-text);
}

.shop-view-toggle__btn.is-active {
    background: #fff;
    color: var(--color-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ─── Table view ─── */
.shop-content[data-view="table"] .shop-grid {
    grid-template-columns: 1fr;
    gap: 0;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
}

.shop-content[data-view="table"] .product-card {
    flex-direction: row;
    align-items: center;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--color-border);
    box-shadow: none;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    transition: background var(--transition-fast);
}

.shop-content[data-view="table"] .product-card:last-child {
    border-bottom: none;
}

.shop-content[data-view="table"] .product-card:hover {
    background: #fafafa;
}

.shop-content[data-view="table"] .product-card__image-link {
    flex-shrink: 0;
    width: 64px;
}

.shop-content[data-view="table"] .product-card__image {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
}

.shop-content[data-view="table"] .product-card__body {
    flex: 1;
    min-width: 0;
    padding: 0;
    gap: 0.25rem;
}

.shop-content[data-view="table"] .product-card__name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-content[data-view="table"] .product-card__meta {
    gap: var(--space-sm);
}

.shop-content[data-view="table"] .product-card__stock {
    display: none;
}

.shop-content[data-view="table"] .product-card__footer {
    flex-shrink: 0;
    padding: 0;
    width: auto;
}

.shop-content[data-view="table"] .product-card__btn {
    white-space: nowrap;
}

/* Table view pagination — match novinky style */
.shop-content[data-view="table"] ~ .shop-pagination .current {
    background: var(--color-text);
    color: var(--color-bg);
    font-weight: var(--font-weight-bold);
}

/* ─── Mobile filter toggle button ─── */
.shop-filter-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    font-family: inherit;
    color: var(--color-text);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    transition:
        border-color var(--transition-fast),
        background var(--transition-fast);
}

.shop-filter-toggle:hover {
    border-color: var(--color-text-muted);
    background: #f5f5f5;
}

.shop-filter-toggle__icon {
    width: 16px;
    height: 16px;
}

/* ─── Mobile drawer overlay ─── */
.shop-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 998;
    background: rgba(0, 0, 0, 0);
    transition: background 0.4s cubic-bezier(0, 0, 0.2, 1);
}

.shop-sidebar-overlay.is-visible {
    display: block;
}

.shop-sidebar-overlay.is-active {
    background: rgba(0, 0, 0, 0.4);
}

/* ─── Mobile drawer close button ─── */
.shop-sidebar__close {
    display: none;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .shop-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }

    .shop-filter-toggle {
        display: flex;
    }

    /* Drawer sidebar — close: snappy ease-in, open: expressive ease-out */
    .shop-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 999;
        width: min(320px, 85vw);
        height: 100dvh;
        background: #fff;
        padding: var(--space-lg);
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 1, 1);
        gap: var(--space-md);
        box-shadow: none;
    }

    .shop-sidebar.is-drawer-open {
        transform: translateX(0);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
    }

    .shop-sidebar__close {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0 0 var(--space-md);
        margin: 0;
        border: none;
        border-bottom: 1px solid var(--color-border);
        background: none;
        cursor: pointer;
        font-size: var(--font-size-base);
        font-weight: 600;
        font-family: inherit;
        color: var(--color-text);
    }

    .shop-sidebar__close-icon {
        width: 20px;
        height: 20px;
        color: var(--color-text-muted);
    }

    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .shop-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin: 0 auto;
    }

    .shop-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .shop-content[data-view="table"] .shop-grid {
        max-width: none;
        border-radius: 8px;
    }

    .shop-content[data-view="table"] .product-card {
        gap: var(--space-sm);
        padding: var(--space-sm);
    }

    .shop-content[data-view="table"] .product-card__image-link {
        width: 48px;
    }

    .shop-content[data-view="table"] .product-card__footer {
        display: none;
    }
}