.categories-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 16px;
}

.cat-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 24px 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.cat-card:hover {
    border-color: var(--accent-blue);
    background: #f0f7ff;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 102, 204, 0.08);
}

.cat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.03);
    transition: background var(--transition-base);
}

.cat-card:hover .cat-icon {
    background: rgba(0, 102, 204, 0.1);
}

.cat-icon svg {
    width: 26px;
    height: 26px;
    stroke: var(--text-primary);
    stroke-width: 1.5;
    fill: none;
    transition: stroke var(--transition-base);
}

.cat-card:hover .cat-icon svg {
    stroke: var(--accent-blue);
}

.cat-card span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cat-card .cat-count {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.carousel-wrapper {
    position: relative;
    /* Miejsce na hover shadow poza clipping overflow-x */
    padding-top: 8px;
    margin-top: -8px;
}

.carousel {
    --carousel-cols: 6;
    --carousel-gap: 16px;
    /* ~1px na kafelek (6×1) → równy oddech L/P, bez ucinania ramki */
    --carousel-side: 6px;
    display: flex;
    gap: var(--carousel-gap);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding-top: 10px;
    padding-bottom: 16px;
    padding-left: var(--carousel-side);
    padding-right: var(--carousel-side);
    scroll-padding-inline: var(--carousel-side);
    margin-bottom: -8px;
    scroll-behavior: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    box-sizing: border-box;
}

.carousel.is-looping {
    /* Bez snap + bez CSS smooth - inaczej „cichy” skok pętli animuje się w złą stronę */
    scroll-snap-type: none;
    scroll-behavior: auto;
}

.carousel::-webkit-scrollbar {
    display: none;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-primary);
    /* wspólny inset - L/P zawsze symetrycznie względem kafelków */
    --carousel-btn-inset: -22px;
}

.carousel-btn:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.carousel-btn:disabled {
    opacity: 0.35;
    pointer-events: none;
}

.carousel-btn.left {
    left: var(--carousel-btn-inset);
    right: auto;
}
.carousel-btn.right {
    right: var(--carousel-btn-inset);
    left: auto;
}

/* Mobile: przyciski WEWNĄTRZ - ujemny inset (-22px) rozciągał dokument w poziomie */
html.is-phone .carousel-wrapper,
html.is-touch .carousel-wrapper {
    overflow: hidden;
}
html.is-phone .carousel-btn,
html.is-touch .carousel-btn {
    --carousel-btn-inset: 6px;
}
html.is-phone .carousel-btn.left,
html.is-touch .carousel-btn.left {
    left: 6px !important;
    right: auto !important;
}
html.is-phone .carousel-btn.right,
html.is-touch .carousel-btn.right {
    right: 6px !important;
    left: auto !important;
}

@media (max-width: 992px) {
    .carousel-wrapper {
        overflow: hidden;
    }
    .carousel-btn {
        --carousel-btn-inset: 6px;
    }
    .carousel-btn.left {
        left: 6px !important;
        right: auto !important;
    }
    .carousel-btn.right {
        right: 6px !important;
        left: auto !important;
    }
}

.carousel-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: box-shadow var(--transition-base), z-index 0s;
    display: flex;
    flex-direction: column;
    text-align: left;
    box-sizing: border-box;
    min-width: 0;
    position: relative;
    z-index: 0;
}

/* Szerokość kafelka TYLKO w karuzeli - nie psuje ulubionych / gridów.
   100% = content-box (wewnątrz --carousel-side), więc rząd jest wyśrodkowany. */
.carousel > .product-card,
.carousel > .skeleton-card {
    --carousel-card-w: calc(
        (100% - (var(--carousel-cols, 6) - 1) * var(--carousel-gap, 16px)) /
            var(--carousel-cols, 6)
    );
    flex: 0 0 var(--carousel-card-w);
    width: var(--carousel-card-w);
    max-width: var(--carousel-card-w);
    scroll-snap-align: start;
    scroll-margin-inline: 0;
    box-sizing: border-box;
}

.product-card:hover {
    /* Tylko cień — −50% vs poprzedni hover */
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.02),
        0 4px 11px rgba(0, 0, 0, 0.04);
    z-index: 3;
}

.product-card:hover .product-name {
    color: var(--accent-blue, #0066cc);
}

.product-card:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
}

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

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    background: var(--text-primary);
    color: #fff;
    z-index: 2;
}

.product-badge.new { background: var(--accent-blue); }

.product-card__float {
    position: absolute;
    top: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0;
    pointer-events: none;
}

/* Sam koszyk → dół zdjęcia (ten sam odstęp 10px) */
.product-card__float:not(:has(.product-card__heart)) {
    justify-content: flex-end;
}

.product-card__float[hidden] {
    display: none !important;
}

.product-card__heart,
.product-card__cart {
    position: relative;
    top: auto;
    right: auto;
    z-index: 3;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    pointer-events: auto;
    color: #1a1a1a;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    transition: background 0.15s ease, color 0.15s ease;
}

.product-card__heart:hover {
    background: #fff;
}

.product-card__heart:focus-visible,
.product-card__cart:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.product-card__heart svg,
.product-card__cart svg {
    width: 22px;
    height: 22px;
    display: block;
}

.product-card__heart svg path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linejoin: round;
    transition: fill 0.15s ease;
}

.product-card__heart.is-active {
    color: #e11d48;
}

.product-card__heart.is-active svg path {
    fill: currentColor;
    stroke: currentColor;
}

.product-card__cart {
    color: #fff;
    background: var(--accent-blue, #0066cc);
    box-shadow: 0 2px 12px rgba(0, 102, 204, 0.35);
}

.product-card__cart:hover {
    background: var(--accent-blue-hover, #0055b3);
    color: #fff;
}

.product-card__cart svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.product-card__cart svg circle {
    fill: currentColor;
    stroke: none;
}

.product-card__heart:disabled,
.product-card__cart:disabled {
    opacity: 0.65;
    cursor: wait;
}

.toast-stack {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 220px;
    max-width: 360px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #111;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.toast.is-success {
    background: #0f766e;
}

.toast.is-error {
    background: #b91c1c;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    color: var(--text-primary, #1d1d1f);
    transition: color 0.15s ease;
}

.product-seller {
    display: none;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}

.product-stars {
    display: flex;
    gap: 1px;
    color: var(--star-color);
}

.product-stars svg {
    width: 14px;
    height: 14px;
}

.product-rating-value {
    font-weight: 600;
    color: var(--text-primary);
}

.product-reviews {
    color: var(--text-secondary);
}

.product-price {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
}

.product-price .current {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

.product-price .old {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: line-through;
    flex-shrink: 0;
}

.product-price__sale {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    background: var(--danger, #ff3b30);
    color: #fff;
    white-space: nowrap;
}

.product-shipping {
    margin: 6px 0 0;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-shipping.is-free {
    color: #1b6e34;
}

.product-shipping.is-from {
    color: var(--text-secondary);
}

.product-shipping.is-paid {
    color: var(--text-secondary);
    font-weight: 550;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
    /* Cień hover nie wychodzi poza gap — lekki oddech wokół siatki */
    padding: 10px 6px 18px;
    margin: -10px -6px -18px;
    overflow: visible;
}

.products-grid .product-card {
    flex: none;
    min-width: 0;
    width: 100%;
    max-width: none;
}

/* Inspiracja pomysłów - 5 kolumn × 6 produktów */
.inspiration-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
    padding: 10px 6px 18px;
    margin: -10px -6px -18px;
    overflow: visible;
}

.inspiration-grid .product-card,
.inspiration-grid .skeleton-card {
    flex: none;
    min-width: 0;
    width: 100%;
    max-width: none;
}

.state-message {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
    font-size: 15px;
    width: 100%;
}

.state-message strong {
    display: block;
    color: var(--text-primary);
    font-size: 17px;
    margin-bottom: 8px;
}

.skeleton-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    min-width: 0;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.skeleton-card .skeleton-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    flex-shrink: 0;
}

/* Wysokości jak .product-name / .product-rating / .product-price / .product-shipping */
.skeleton-card .skeleton-line {
    width: 92%;
    height: 20px;
    margin-bottom: 6px;
}

.skeleton-card .skeleton-line.rating {
    width: 55%;
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-card .skeleton-line.short { width: 60%; }

.skeleton-card .skeleton-line.price {
    width: 42%;
    height: 21px;
    margin-top: auto;
    margin-bottom: 0;
}

.skeleton-card .skeleton-line.shipping {
    width: 62%;
    height: 16px;
    margin-top: 6px;
    margin-bottom: 0;
}


.inspiration-carousels {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.inspiration-carousel { margin: 0; }
