:root {
    --pg-gap: 20px;
    --pg-radius: 16px;
    --pg-shadow: 0 10px 30px rgba(0, 0, 0, .15);
    --pg-hover: 0 14px 40px rgba(0, 0, 0, .25);
    /* 4:3 Aspect */
    --aspect-w: 4;
    --aspect-h: 3;
}

/* =============== HERO / SEARCH =============== */
.pg-hero {
    display: grid;
    grid-auto-flow: row;
    justify-items: center;
    align-content: center;
    gap: 14px;
    max-width: 960px;
    margin: 0 auto 28px;
    padding: 12px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .05);
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .25)
}

.pg-hero h1 {
    margin: 0;
    font-size: clamp(20px, 2.6vw, 28px);
    font-weight: 700;
    letter-spacing: .4px
}

.pg-actions {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    min-width: 0;
}

.pg-actions .search-wrap {
    position: relative;
    flex: 1 1 auto;
    width: auto;
    max-width: min(520px, 100%);
    min-width: 0;
    margin: 0;
}

.pg-actions .search-wrap input[type="search"] {
    width: 100%;
    min-width: 0;
}

.pg-actions button,
.pg-actions .btn,
.pg-actions .home-search-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.pg-actions select {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .15);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    appearance: none;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg fill='white' viewBox='0 0 24 24' width='18' height='18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px
}

.pg-actions select:hover,
.pg-actions select:focus {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, .12)
}

.pg-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    justify-content: center
}

/* =============== CATEGORY =============== */
.pg-category {
    margin-bottom: 40px
}

.pg-category h2 {
    text-align: center;
    margin: 10px 0 18px;
    font-size: clamp(20px, 3vw, 26px);
    font-weight: 700;
    color: #f5b94d
}

.pg-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--pg-gap);
    justify-content: center;
    justify-items: center
}

/* =============== TILES (4:3) =============== */
.pg-tile {
    position: relative;
    width: 100%;
    max-width: 560px;
    border-radius: var(--pg-radius);
    overflow: hidden;
    box-shadow: var(--pg-shadow);
    background: #1115;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease
}

.pg-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--pg-hover)
}

.pg-imgwrap {
    position: relative;
    width: 100%;
    aspect-ratio: var(--aspect-w) / var(--aspect-h);
    /* 4:3 */
    background: #0f0f0f;
    border-radius: var(--pg-radius);
    overflow: hidden
}

.pg-imgwrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(1.05)
}

.pg-imgwrap::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 34%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .35) 100%);
    pointer-events: none
}

/* Titel */
.pg-title {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    margin: 0;
    padding: 4px 10px;
    font-weight: 700;
    font-size: clamp(15px, 2.5vw, 20px);
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .7);
    background: rgba(0, 0, 0, .35);
    border-radius: 8px;
    max-width: 85%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

/* Badges IM Bild */
.pg-info {
    position: absolute;
    inset: 0;
    pointer-events: none
}

/* Badge-Base: Zeit + Gewicht (Preis wird nicht mehr gestylt) */
.pg-time,
.pg-weight {
    position: absolute;
    bottom: 10px;
    padding: 6px 10px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(2px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
    pointer-events: auto
}

.pg-time {
    left: 10px;
    opacity: .95
}

/* Gewicht rechts unten */
.pg-weight {
    right: 10px;
    background: var(--accent-color, #e9a624);
    color: #111
}

/* =============== SKELETONS / PAGER / CHIPS (unverändert) =============== */
.is-skeleton {
    pointer-events: none
}

.pg-skel-img,
.pg-skel-line {
    background: linear-gradient(90deg, #333, #444, #333);
    animation: sk 1.2s linear infinite
}

.pg-skel-img {
    width: 100%;
    height: 100%
}

.pg-skel-line {
    height: 10px;
    border-radius: 6px
}

.pg-skel-line.w60 {
    width: 60%
}

.pg-skel-line.w30 {
    width: 30%
}

@keyframes sk {
    0% {
        background-position: 0 0
    }

    100% {
        background-position: 200% 0
    }
}

.pg-pager {
    display: flex;
    justify-content: center;
    margin: 16px 0 8px
}

.pg-pager-inner {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap
}

.pg-page {
    padding: 6px 10px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, .08);
    color: var(--text-color, #fff)
}

.pg-page:hover {
    background: rgba(255, 255, 255, .14)
}

.pg-page.active {
    background: var(--accent-color, #e9a624);
    color: #111;
    font-weight: 700
}

.pg-ellipsis {
    opacity: .7;
    padding: 0 2px
}

.pg-categories .chip {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid var(--border-color, #444);
    background: var(--chip-bg, #2a2d33);
    color: var(--chip-color, #ddd);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .2s
}

.pg-categories .chip:not(.active):hover {
    background: var(--chip-bg-hover, #3a3e45);
    border-color: var(--border-color-hover, #666);
    transform: translateY(-1px)
}

.pg-categories .chip.active,
.pg-categories .chip.active:hover,
.pg-categories .chip.active:focus {
    background: var(--accent-color, #e9a624) !important;
    border-color: var(--accent-color, #e9a624) !important;
    color: #111 !important;
    transform: none
}

body.dark-mode .pg-categories .chip.active,
body.dark-mode .pg-categories .chip.active:hover {
    background: var(--accent-color, #e9a624);
    color: #000;
    border-color: var(--accent-color, #e9a624);
    font-weight: 600
}

/* --- Chips: weiße Schrift auf Akzent-Hintergrund --- */

/* Gewicht-Badge im Bild (weiß statt schwarz) */
.pg-weight {
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

/* Aktive Kategorie-Chips */
.pg-categories .chip.active,
.pg-categories .chip.active:hover,
.pg-categories .chip.active:focus {
    color: #eee !important;
    background: #111 !important;
}

/* ===== Light-Mode: Kategorienüberschriften in Schwarz statt Akzentfarbe ===== */
body.light-mode .pg-category h2 {
    color: #111 !important;
}

/* ===== Dark-Mode: Gewicht-Badge wie Druckzeit (schwarz mit weißer Schrift) ===== */
body.dark-mode .pg-weight {
    background: rgba(0, 0, 0, 0.55) !important;
    color: #fff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

/* ===========================
   LEGACY: Preis-Badge NIE anzeigen
   =========================== */
.pg-price {
    display: none !important;
}

/* Falls irgendwo per Pseudo-Element Text generiert wird: ebenfalls killen */
.pg-price::before,
.pg-price::after {
    content: "" !important;
}

.pg-category {
    width: 100%;
    min-width: 0;
}

.pg-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.pg-cat-title {
    margin: 0;
}

.pg-cat-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pg-cat-button {
    width: 38px;
    height: 38px;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;

    background: rgba(255, 255, 255, 0.04);
    color: var(--text-color);

    font-size: 1.25rem;
    line-height: 1;

    cursor: pointer;
}

.pg-cat-button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.pg-cat-button:disabled {
    opacity: 0.4;
    cursor: default;
}

.pg-cat-viewport {
    overflow: hidden;
    width: 100%;
    touch-action: pan-y;
}

.pg-cat-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;

    transition: transform 0.45s ease;
    will-change: transform;

    user-select: none;
    -webkit-user-select: none;
}

.pg-cat-grid .pg-tile {
    flex: 0 0 calc((100% - 32px) / 3);
    min-width: calc((100% - 32px) / 3);
    max-width: calc((100% - 32px) / 3);
}

.pg-cat-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;

    min-height: 18px;
    margin-top: 12px;
}

.pg-cat-dot {
    width: 10px;
    height: 10px;

    padding: 0;
    border: 0;
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.18);
    cursor: pointer;
}

.pg-cat-dot.is-active {
    background: var(--accent-color);
    transform: scale(1.12);
}

.pg-cat-head {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 12px;
}

.pg-cat-title {
    grid-column: 2;
    margin: 0;
    text-align: center;
}

.pg-cat-controls {
    grid-column: 3;
    justify-self: end;
}

.pg-cat-viewport {
    overflow: hidden;
    width: 100%;
    touch-action: pan-y;
}

.pg-cat-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    transition: transform 0.45s ease;
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
}

.pg-cat-grid .pg-tile {
    flex: 0 0 calc((100% - 32px) / 3);
    min-width: calc((100% - 32px) / 3);
    max-width: calc((100% - 32px) / 3);
}

@media (max-width: 1440px) {
    .pg-cat-grid .pg-tile {
        flex: 0 0 calc((100% - 16px) / 2);
        min-width: calc((100% - 16px) / 2);
        max-width: calc((100% - 16px) / 2);
    }
}

@media (max-width: 720px) {
    .pg-cat-grid {
        gap: 12px;
    }

    .pg-cat-grid .pg-tile {
        flex: 0 0 100%;
        min-width: 100%;
        max-width: 100%;
    }
}

/* =========================================================
   PRODUCTS PAGE - final slider override
   Slider behaviour matches the startseite slider:
   full track, transform-based movement, smooth auto-scroll.
   ========================================================= */

.pg-category {
    width: 100%;
    min-width: 0;
    margin-bottom: 40px;
}

.pg-cat-head {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.pg-cat-title,
.pg-category h2.pg-cat-title {
    grid-column: 2;
    margin: 0;
    text-align: center;
}

.pg-cat-controls {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pg-cat-button {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-color);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.pg-cat-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.pg-cat-button:disabled {
    opacity: 0.4;
    cursor: default;
}

.pg-cat-viewport {
    overflow: hidden;
    width: 100%;
    touch-action: pan-y;
}

.pg-cat-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    justify-items: stretch !important;
    gap: 16px;
    width: 100%;
    transition: transform 0.45s ease;
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
}

.pg-cat-grid .pg-tile {
    flex: 0 0 calc((100% - 32px) / 3) !important;
    min-width: calc((100% - 32px) / 3) !important;
    max-width: calc((100% - 32px) / 3) !important;
    width: auto !important;
}

.pg-cat-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 18px;
    margin-top: 12px;
}

.pg-cat-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease;
}

.pg-cat-dot.is-active {
    background: var(--accent-color);
    transform: scale(1.12);
}

body.light-mode .pg-cat-dot {
    background: rgba(0, 0, 0, 0.16);
}

@media (max-width: 1440px) {
    .pg-cat-grid .pg-tile {
        flex: 0 0 calc((100% - 16px) / 2) !important;
        min-width: calc((100% - 16px) / 2) !important;
        max-width: calc((100% - 16px) / 2) !important;
    }
}

@media (max-width: 720px) {
    .pg-cat-head {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .pg-cat-title,
    .pg-category h2.pg-cat-title {
        grid-column: 1;
        text-align: center;
    }

    .pg-cat-controls {
        grid-column: 1;
        justify-self: center;
    }

    .pg-cat-grid {
        gap: 12px;
    }

    .pg-cat-grid .pg-tile {
        flex: 0 0 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }
}

@media (prefers-reduced-motion: reduce) {

    .pg-cat-grid,
    .pg-cat-button,
    .pg-cat-dot {
        transition: none !important;
        animation: none !important;
    }
}

.home-search {
    width: 100%;
    max-width: 720px;

    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;

    align-items: center;
    justify-content: center;
    gap: 12px;

    margin: 0 auto;
}

.home-search input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
}

.home-search button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.pg-category-list-mode .pg-cat-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    transform: none !important;
}

.pg-category-list-mode .pg-cat-grid .pg-tile {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: none !important;
}

.pg-category-list-mode .pg-cat-controls,
.pg-category-list-mode .pg-cat-dots {
    display: none !important;
}

@media (max-width: 720px) {
    .pg-category-list-mode .pg-cat-grid {
        grid-template-columns: 1fr;
    }
}

.pg-cat-button {
    width: 38px;
    height: 38px;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;

    background: rgba(255, 255, 255, 0.04);
    color: var(--text-color);

    font-size: 1.25rem;
    line-height: 1;

    cursor: pointer;

    transition:
        background 160ms ease,
        border-color 160ms ease,
        color 160ms ease,
        transform 160ms ease;

    -webkit-tap-highlight-color: transparent;
}

.pg-cat-button:focus,
.pg-cat-button:focus-visible,
.pg-cat-button:active {
    outline: none;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-color);
    border-color: rgba(255, 255, 255, 0.12);
    transform: none;
}

@media (hover: hover) and (pointer: fine) {
    .pg-cat-button:hover:not(:disabled) {
        background: var(--accent-color);
        color: #111;
        border-color: var(--accent-color);
        transform: translateY(-1px);
    }
}

@media (hover: none),
(pointer: coarse) {

    .pg-cat-button,
    .pg-cat-button:hover,
    .pg-cat-button:focus,
    .pg-cat-button:focus-visible,
    .pg-cat-button:active {
        background: rgba(255, 255, 255, 0.04) !important;
        color: var(--text-color) !important;
        border-color: rgba(255, 255, 255, 0.12) !important;
        transform: none !important;
        outline: none !important;
        -webkit-tap-highlight-color: transparent;
    }
}

@media (hover: none),
(pointer: coarse) {
    .pg-cat-controls {
        display: none !important;
    }
}

/* =========================================================
   PRODUCTS PAGE - slider side buttons + sane card size
   Final override: desktop buttons sit left/right of slider row.
   ========================================================= */

.pg-cat-head {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    grid-template-columns: none !important;
    margin-bottom: 12px;
}

.pg-cat-title,
.pg-category h2.pg-cat-title {
    grid-column: auto !important;
    text-align: center !important;
}

.pg-cat-controls {
    display: none !important;
}

.pg-cat-slider-row {
    width: min(100%, 1280px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 54px;
    align-items: center;
    gap: 16px;
}

.pg-cat-viewport {
    overflow: hidden;
    width: 100%;
    min-width: 0;
    touch-action: pan-y;
}

.pg-cat-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    justify-items: stretch !important;
    align-items: stretch;
    gap: 16px;
    width: 100%;
    transition: transform 0.45s ease;
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
}

.pg-cat-grid .pg-tile {
    flex: 0 0 360px !important;
    width: 360px !important;
    min-width: 360px !important;
    max-width: 360px !important;
}

.pg-cat-side-button {
    width: 48px !important;
    height: 48px !important;
    justify-self: center;
    align-self: center;
    border-radius: 14px;
}

.pg-cat-side-button:disabled {
    visibility: hidden;
}

.pg-cat-dots {
    margin-top: 14px;
}

@media (max-width: 1500px) {
    .pg-cat-slider-row {
        width: min(100%, 1120px);
        grid-template-columns: 48px minmax(0, 1fr) 48px;
        gap: 14px;
    }

    .pg-cat-grid .pg-tile {
        flex-basis: 320px !important;
        width: 320px !important;
        min-width: 320px !important;
        max-width: 320px !important;
    }

    .pg-cat-side-button {
        width: 44px !important;
        height: 44px !important;
    }
}

@media (max-width: 900px) {
    .pg-cat-slider-row {
        width: min(100%, 760px);
    }

    .pg-cat-grid .pg-tile {
        flex-basis: 300px !important;
        width: 300px !important;
        min-width: 300px !important;
        max-width: 300px !important;
    }
}

@media (max-width: 720px) {
    .pg-cat-slider-row {
        width: 100%;
        display: block;
    }

    .pg-cat-side-button {
        display: none !important;
    }

    .pg-cat-grid {
        gap: 12px;
    }

    .pg-cat-grid .pg-tile {
        flex: 0 0 100% !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }
}

/* List mode stays a real wrapping grid */
.pg-category-list-mode .pg-cat-slider-row {
    width: min(100%, 1280px);
    display: block;
}

.pg-category-list-mode .pg-cat-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
    gap: 16px;
    transform: none !important;
}

.pg-category-list-mode .pg-cat-grid .pg-tile {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: none !important;
}

.pg-category-list-mode .pg-cat-side-button,
.pg-category-list-mode .pg-cat-dots {
    display: none !important;
}