/* ==========================================
   KOMISJONIKAUBAMAJA KATALOOGI CSS BY PCPARTDEALS.EU
========================================== */

:root {
    --yellow: #f5c518;
    --yellow-dark: #dba700;
    --yellow-light: #fff4c8;

    --bg: #ececec;
    --section: #e4e4e4;

    --white: #ffffff;

    --text: #111111;
    --muted: #666666;

    --border: #d8d8d8;

    --shadow:
        0 10px 30px rgba(0, 0, 0, .08);

    --shadow-hover:
        0 15px 40px rgba(0, 0, 0, .12);

    --radius: 24px;
}

/* ==========================================
   RESET
========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select {
    font-family: inherit;
}

.container {
    width: min(1300px, calc(100% - 40px));
    margin: auto;
}

/* ==========================================
   HEADER
========================================== */

.header {
    position: sticky;
    top: 0;
    z-index: 1000;

    background: rgba(255, 255, 255, .95);

    backdrop-filter: blur(12px);

    border-bottom: 1px solid var(--border);
}

.header-inner {
    min-height: 85px;

    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 14px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
}

.logo span {
    color: var(--yellow-dark);
}

.back-btn {
    background: white;

    padding: 12px 18px;

    border-radius: 14px;

    border: 1px solid var(--border);

    font-weight: 600;

    transition: .25s;

    justify-self: end;
    white-space: nowrap;
}

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

/* ==========================================
   HERO / SEARCH AREA
========================================== */

.catalog-header {
    padding: 60px 0;

    background:
        linear-gradient(180deg,
            #fff8de,
            #ececec);
}

.catalog-header h1 {
    font-size: clamp(2.5rem, 4vw, 4rem);

    letter-spacing: -2px;

    margin-bottom: 10px;
}

.catalog-header p {
    color: var(--muted);

    margin-bottom: 35px;
}

/* ==========================================
   FILTER BAR
========================================== */

.search-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;

    background: white;

    padding: 18px;

    border-radius: 22px;

    box-shadow: var(--shadow);
}

.catalog-layout {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.filter-sidebar {
    position: sticky;
    top: 105px;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.filter-close {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 12px;
    background: #f5f5f5;
    cursor: pointer;
}

.filter-draft-status {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.45;
}

.filter-draft-status.is-dirty {
    color: #8a5a00;
    font-weight: 700;
}

.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: white;
    font-weight: 700;
}

.catalog-layout.filters-collapsed {
    grid-template-columns: minmax(0, 1fr);
}

.catalog-layout.filters-collapsed .filter-sidebar {
    display: none;
}

.category-shortcuts {
    display: grid;
    gap: 8px;
}

.category-shortcut {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fafafa;
    cursor: pointer;
    font-weight: 650;
    text-align: left;
}

.category-shortcut i {
    font-size: 20px;
    color: var(--yellow-dark);
}

.price-filter {
    display: grid;
    gap: 10px;
}

.price-filter label {
    font-weight: 800;
}

.price-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.filter-error {
    min-height: 18px;
    color: #b42318;
    font-size: .85rem;
    font-weight: 700;
}

.mobile-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
}

.mobile-filter-reset,
.mobile-filter-apply {
    width: 100%;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
}

.mobile-filter-reset {
    border-color: var(--border);
    background: white;
    color: #222;
}

.mobile-filter-reset:hover {
    background: #f3f3f3;
}

.mobile-filter-apply {
    background: var(--yellow);
    color: #111;
}

.mobile-filter-apply:disabled {
    cursor: not-allowed;
    opacity: .62;
}

.filter-cooldown-timer {
    grid-column: 1 / -1;
    min-height: 18px;
    color: #8a3c00;
    font-size: .86rem;
    font-weight: 700;
}

.filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9997;
    background: rgba(0, 0, 0, .36);
    opacity: 0;
    transition: .2s;
}

.filter-backdrop.open {
    opacity: 1;
}

.filter-menu-open {
    overflow: hidden;
}

.campaign-banner-stack {
    display: grid;
    overflow: hidden;
    border-radius: 14px;
    margin-bottom: 18px;
}

.campaign-banner-stack.hidden {
    display: none;
}

.campaign-banner {
    grid-area: 1 / 1;
    min-width: 0;
    height: clamp(96px, 10vw, 128px);
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 18px 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--campaign-banner-background, #111);
    color: var(--campaign-banner-text, white);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-102%);
    transition: transform .6s ease, opacity .35s ease, visibility .6s;
}

.campaign-banner span {
    color: inherit;
    opacity: .82;
}

.campaign-banner.is-active {
    z-index: 2;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.campaign-banner.is-exiting {
    z-index: 1;
    visibility: visible;
    transform: translateX(102%);
}

.campaign-banner-image {
    padding: 0;
    overflow: hidden;
    background: transparent;
}

.campaign-banner-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-path {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 600;
    padding: 0 4px;
}

.search-row input,
.search-row select {
    width: 100%;
    min-width: 0;
    height: 58px;

    border: 1px solid var(--border);

    border-radius: 14px;

    padding: 0 18px;

    font-size: 15px;

    background: #fafafa;

    transition: .2s;
}

.search-row select:disabled {
    color: var(--muted);
    cursor: not-allowed;
    background: #eeeeee;
}

.search-row input:focus,
.search-row select:focus {
    outline: none;

    border-color: var(--yellow);

    background: white;
}

/* ==========================================
   PRODUCTS SECTION
========================================== */

.catalog {
    padding: 50px 0 100px;
}

.products-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(280px, 1fr));

    gap: 24px;
}

/* ==========================================
   PRODUCT CARD
========================================== */

.product-card {
    background: white;

    border-radius: 24px;

    overflow: hidden;

    box-shadow: var(--shadow);

    transition: .3s;

    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-6px);

    box-shadow: var(--shadow-hover);
}

.product-card img {
    width: 100%;
    height: 240px;

    object-fit: cover;

    background: #f3f3f3;
}

.product-info {
    padding: 22px;

    display: flex;
    flex-direction: column;

    flex: 1;
}

.category {
    display: inline-flex;

    width: fit-content;

    background: var(--yellow-light);

    color: #111;

    padding: 8px 12px;

    border-radius: 999px;

    font-size: .85rem;
    font-weight: 700;

    margin-bottom: 15px;
}

.product-info h3 {
    font-size: 1.2rem;

    margin-bottom: 10px;

    line-height: 1.3;
    min-height: 3.1em;
}

.product-info p {
    color: var(--muted);

    line-height: 1.6;

    margin-bottom: 20px;

    flex: 1;
}

.bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 16px;
}

.price {
    font-size: 1.6rem;

    font-weight: 800;

    color: var(--yellow-dark);
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.sale-price {
    color: #c3272b;
}

.original-price {
    color: var(--muted);
    font-size: .95rem;
    text-decoration: line-through;
}

.campaign-badge {
    display: grid;
    gap: 4px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--yellow-light);
    color: #3b2b00;
    font-size: .84rem;
}

.campaign-badge span {
    color: #6b5a22;
}

.new-product-price-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: fit-content;
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #f3f4f6;
    color: #333;
    font-size: .84rem;
    font-weight: 700;
}

.new-product-price-badge span {
    color: var(--muted);
    font-weight: 650;
}

.new-product-price-badge del {
    color: #777;
}

.new-product-price-badge strong {
    color: #c3272b;
}

.condition,
.stock {
    background: #f1f1f1;

    padding: 8px 12px;

    border-radius: 12px;

    font-size: .85rem;
    font-weight: 600;
}

.stock {
    background: #fff8df;
    border: 1px solid #f0d46c;
}

/* ==========================================
   LOADING STATES
========================================== */

.loading,
.loading-more,
.empty {
    text-align: center;

    padding: 40px;

    color: var(--muted);

    font-weight: 600;
}

/* ==========================================
   FOOTER
========================================== */

.footer {
    background: #111;
    color: white;
    padding: 56px 0;
}

.footer-content {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(220px, .9fr) minmax(220px, .9fr);
    gap: 28px;
    align-items: start;
}

.footer-logo {
    font-size: 1.7rem;
    font-weight: 800;
}

.footer-logo span {
    color: var(--yellow);
}

.footer p {
    color: #bbb;
    margin-top: 10px;
    line-height: 1.6;
}

.footer-contact,
.footer-links {
    display: grid;
    gap: 10px;
}

.footer-contact h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.footer-contact a,
.footer-contact span,
.footer-links a {
    color: #ddd;
    line-height: 1.5;
}

.loading-more {
    display: none;
}

/* ==========================================
   SKELETON CARDS
========================================== */

.skeleton {
    background: white;

    border-radius: 24px;

    overflow: hidden;

    box-shadow: var(--shadow);
}

.skeleton-image {
    height: 240px;

    background:
        linear-gradient(90deg,
            #ececec,
            #f5f5f5,
            #ececec);

    background-size: 200% 100%;

    animation: skeleton 1.4s infinite;
}

.skeleton-content {
    padding: 20px;
}

.skeleton-line {
    height: 14px;

    border-radius: 10px;

    margin-bottom: 12px;

    background:
        linear-gradient(90deg,
            #ececec,
            #f5f5f5,
            #ececec);

    background-size: 200% 100%;

    animation: skeleton 1.4s infinite;
}

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

@keyframes skeleton {

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

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

}

/* ==========================================
   EMPTY STATE
========================================== */

.empty {
    grid-column: 1/-1;

    background: white;

    border-radius: 24px;

    padding: 60px 30px;

    box-shadow: var(--shadow);
}

/* ==========================================
   SCROLLBAR
========================================== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #ddd;
}

::-webkit-scrollbar-thumb {
    background: var(--yellow-dark);
    border-radius: 999px;
}

/* ==========================================
   TABLET
========================================== */

@media (max-width:900px) {

    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 9998;
        width: min(88vw, 360px);
        padding: 18px;
        background: white;
        box-shadow: 10px 0 30px rgba(0, 0, 0, .18);
        overflow-y: auto;
        transform: translateX(-105%);
        transition: .25s;
    }

    .mobile-filter-actions {
        position: sticky;
        bottom: 0;
        margin: 12px -18px -18px;
        padding: 12px 18px 18px;
        background: white;
        border-top: 1px solid var(--border);
    }

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

    .catalog-layout.filters-collapsed .filter-sidebar {
        display: block;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-links {
        grid-template-columns: 1fr 1fr;
    }

}

/* ==========================================
   MOBILE
========================================== */

@media (max-width:700px) {

    .container {
        width: calc(100% - 24px);
    }

    .header-inner {
        min-height: auto;
        padding: 14px 0;
        grid-template-columns: minmax(0, 1fr) auto auto;
    }

    .logo {
        grid-column: 1 / -1;
        font-size: 1.45rem;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

    .back-btn {
        justify-self: start;
        padding: 10px 13px;
        font-size: .9rem;
    }

    .wishlist-toggle {
        justify-self: end;
        padding: 10px 12px;
    }

    .header-inner .cart-toggle {
        justify-self: end;
    }

    .catalog-header {
        padding: 30px 0 24px;
    }

    .catalog-header h1 {
        font-size: 2rem;
        letter-spacing: 0;
        line-height: 1.1;
    }

    .catalog-header p {
        margin-bottom: 22px;
    }

    .search-row {
        grid-template-columns: 1fr;
        padding: 14px;
        gap: 10px;
        border-radius: 18px;
    }

    .search-row input,
    .search-row select {
        height: 52px;
        font-size: 14px;
        padding: 0 14px;
    }

    .category-path {
        font-size: .82rem;
        line-height: 1.4;
    }

    .catalog {
        padding: 30px 0 70px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .product-card img {
        height: 210px;
    }

    .product-info {
        padding: 18px;
    }

    .product-info h3 {
        font-size: 1.05rem;
        line-height: 1.35;
    }

    .bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .price {
        font-size: 1.4rem;
    }

}

.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-link:hover {
    color: inherit;
}

.product-card {
    cursor: pointer;
}

/* Wishlist button on card */
.wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;

    width: 40px;
    height: 40px;

    border: none;
    border-radius: 50%;

    background: white;

    cursor: pointer;

    box-shadow: 0 6px 18px rgba(0, 0, 0, .1);

    transition: .2s;
}

.wishlist-btn img,
.wishlist-toggle img,
.wishlist-close img {
    width: 18px;
    height: 18px;
    display: block;
}

.wishlist-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wishlist-btn.active {
    background: #f5c518;
}

.wishlist-btn:hover {
    transform: scale(1.1);
}

.card-cart-btn {
    position: absolute;
    top: 58px;
    right: 12px;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
    transition: transform .2s, background .2s;
}

.card-cart-btn:hover {
    transform: scale(1.08);
}

.card-cart-btn.is-added {
    background: var(--yellow);
    color: #111;
}

/* Header wishlist */
.wishlist-toggle {
    background: white;
    border: 1px solid #ddd;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Panel */
.wishlist-panel {
    position: fixed;
    top: 0;
    right: -380px;

    width: 360px;
    height: 100vh;

    background: white;

    box-shadow: -10px 0 30px rgba(0, 0, 0, .15);

    transition: .3s;

    z-index: 9999;

    display: flex;
    flex-direction: column;
}

@media (max-width:700px) {

    .wishlist-panel {
        right: -100vw;
        width: min(100vw, 360px);
    }

    .wishlist-header {
        padding: 16px;
    }

    .wishlist-item {
        align-items: center;
    }

}

.wishlist-panel.open {
    right: 0;
}

.wishlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 20px;

    border-bottom: 1px solid #eee;
}

.wishlist-close {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 12px;
    background: #f5f5f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .2s;
}

.wishlist-close:hover {
    background: #f5c518;
}

.wishlist-items {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

.wishlist-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.wishlist-summary strong {
    font-size: 1.15rem;
}

.wishlist-item {
    display: flex;
    gap: 10px;

    padding: 10px;

    border-radius: 12px;

    text-decoration: none;

    color: #111;

    transition: .2s;
}

.wishlist-item:hover {
    background: #f5f5f5;
}

.wishlist-item img {
    width: 50px;
    height: 50px;

    border-radius: 10px;

    object-fit: cover;
}

.empty {
    color: #777;
    text-align: center;
    margin-top: 20px;
}
