/* Category PLP — Milla-style listing */

:root {
    --cat-accent: #24b4c8;
    --cat-accent-dark: #1195ad;
    --cat-ink: #111;
    --cat-muted: #666;
    --cat-line: #ececec;
    --cat-bg: #fff;
    --cat-chip-yellow: #eef9fb;
    --cat-chip-gray: #f3f4f6;
    --cat-chip-green: #ecfdf3;
    --cat-chip-turquoise: #e8f8fb;
    --cat-chip-accent: #ddf3f8;
    --cat-bestseller: #24b4c8;
    --cat-bestseller-dark: #1195ad;
}

.cat-plp {
    background: var(--cat-bg);
    padding: 20px 0 56px;
}

.cat-plp__inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
}

.cat-plp__breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--cat-muted);
}

.cat-plp__breadcrumb a {
    color: var(--cat-muted);
    text-decoration: none;
}

.cat-plp__breadcrumb a:hover {
    color: var(--cat-accent);
}

.cat-plp__layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

/* Sidebar — Milla filter panel */
.cat-plp__sidebar {
    position: sticky;
    top: 96px;
    background: #fff;
}

.cat-filter-form {
    display: flex;
    flex-direction: column;
}

.cat-filter-block {
    border-bottom: 1px solid #e5e5e5;
    padding: 0;
    margin: 0;
}

.cat-filter-block:last-of-type {
    border-bottom: none;
}

.cat-filter-block__title {
    list-style: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    color: #111;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 14px;
    line-height: 1.2;
    user-select: none;
}

.cat-filter-block__title::-webkit-details-marker {
    display: none;
}

.cat-filter-block__title::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid #111;
    border-bottom: 2px solid #111;
    transform: rotate(45deg);
    transition: transform .2s ease;
    flex-shrink: 0;
    margin-top: -2px;
}

.cat-filter-block[open] .cat-filter-block__title::after {
    transform: rotate(-135deg);
    margin-top: 2px;
}

.cat-filter-block__body {
    padding: 0 0 16px;
}

.cat-filter-search-input {
    width: 100%;
    height: 36px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 0 12px;
    font-size: 13px;
    color: #333;
    background: #fff;
    margin-bottom: 10px;
}

.cat-filter-search-input::placeholder {
    color: #999;
}

.cat-filter-search-input:focus {
    outline: none;
    border-color: var(--cat-accent);
}

.cat-filter-checks {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.cat-filter-checks li + li {
    margin-top: 0;
}

.cat-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 32px;
    padding: 2px 0;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    line-height: 1.35;
}

.cat-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cat-check__box {
    width: 18px;
    height: 18px;
    border: 1px solid #d1d1d1;
    border-radius: 3px;
    flex-shrink: 0;
    position: relative;
    background: #fff;
    transition: background .15s ease, border-color .15s ease;
}

.cat-check input:checked + .cat-check__box {
    background: var(--cat-accent);
    border-color: var(--cat-accent);
}

.cat-check input:checked + .cat-check__box::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.cat-check input:disabled + .cat-check__box {
    opacity: .55;
}

.cat-check input:disabled:checked + .cat-check__box {
    opacity: 1;
}

.cat-check__label {
    flex: 1;
    min-width: 0;
}

.cat-check input:checked ~ .cat-check__label {
    color: #333;
    font-weight: 400;
}

.cat-filter-price {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.cat-filter-price input {
    width: 100%;
    height: 36px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 0 10px;
    font-size: 13px;
    background: #fff;
}

.cat-filter-price span {
    color: #999;
    font-size: 13px;
}

.cat-filter-submit,
.cat-filter-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.cat-filter-submit {
    background: var(--cat-accent);
    color: #fff;
    border-radius: 4px;
    min-height: 36px;
}

.cat-filter-submit:hover {
    background: var(--cat-accent-dark);
    color: #fff;
}

.cat-filter-clear {
    margin-top: 0;
    background: #fff;
    color: #444;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    min-height: 36px;
}

.cat-filter-clear-wrap {
    min-height: 50px;
    margin-top: 14px;
}

.cat-filter-clear--placeholder {
    visibility: hidden;
    pointer-events: none;
}

.cat-size-grid {
    display: none;
}

/* Main toolbar */
.cat-plp__toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.cat-plp__heading h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--cat-ink);
    line-height: 1.2;
}

.cat-plp__heading span {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    color: var(--cat-muted);
}

.cat-plp__filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--cat-line);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
}

.cat-plp__chips-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.cat-plp__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.cat-chip i {
    font-size: 15px;
}

.cat-chip--yellow { background: var(--cat-chip-yellow); color: #0b7a94; }
.cat-chip--gray { background: var(--cat-chip-gray); }
.cat-chip--green { background: var(--cat-chip-green); }
.cat-chip--turquoise { background: var(--cat-chip-turquoise); color: #1195ad; }
.cat-chip--accent { background: var(--cat-chip-accent); color: #1195ad; }

.cat-chip.is-active {
    box-shadow: inset 0 0 0 2px var(--cat-accent);
    color: var(--cat-accent-dark);
    font-weight: 700;
}

.cat-chip--yellow.is-active {
    background: #dff4f8;
    color: #0b7a94;
}

.cat-chip--accent.is-active {
    background: var(--cat-accent);
    color: #fff;
    box-shadow: inset 0 0 0 2px var(--cat-accent-dark);
}

.cat-chip.is-active i {
    color: inherit;
}

.cat-plp__sort {
    flex-shrink: 0;
    margin-left: 0;
}

.cat-sort-select {
    min-width: 190px;
    height: 38px;
    border: 1px solid var(--cat-line);
    border-radius: 8px;
    padding: 0 12px;
    font-size: 13px;
    color: #333;
    background: #fff;
}

/* Product grid */
.cat-plp__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px 14px;
}

.cat-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cat-card__media {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f7f7f7;
    aspect-ratio: 3 / 4.05;
}

.cat-card__image-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.cat-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity .25s ease, transform .35s ease;
}

.cat-card__image--hover {
    position: absolute;
    inset: 0;
    opacity: 0;
}

.cat-card--has-hover:hover .cat-card__image--hover {
    opacity: 1;
}

.cat-card--has-hover:hover .cat-card__image:not(.cat-card__image--hover) {
    opacity: 0;
}

.cat-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #fff;
    background: var(--cat-bestseller);
}

.cat-card__badge--new { background: var(--cat-accent-dark); }
.cat-card__badge--sale { background: var(--cat-accent); }

.cat-card__fav {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #333;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.cat-card__fav.is-favorite {
    color: var(--cat-accent-dark);
}

.cat-card__rank {
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    background: linear-gradient(90deg, #5ecfe0, #24b4c8 55%, #1195ad);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.cat-card__body {
    padding: 10px 2px 0;
}

.cat-card__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.45;
    color: #222;
    text-decoration: none;
    min-height: 38px;
}

.cat-card__title strong {
    font-weight: 700;
    margin-right: 4px;
}

.cat-card__delivery {
    margin: 8px 0 0;
    font-size: 11px;
    color: var(--cat-accent-dark);
    display: flex;
    align-items: center;
    gap: 4px;
}

.cat-card__meta {
    margin-top: 6px;
}

.cat-card__rating {
    font-size: 12px;
    color: #333;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.cat-card__rating i {
    color: var(--cat-accent);
}

.cat-card__rating small {
    color: #888;
}

.product-variant-chip {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 3px 8px 3px 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(6px);
    pointer-events: none;
}

.product-variant-chip__dots {
    display: inline-flex;
    align-items: center;
    padding-left: 2px;
}

.product-variant-chip__dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 0.5px rgba(15, 23, 42, 0.08);
    margin-left: -5px;
    flex-shrink: 0;
}

.product-variant-chip__dot:first-child {
    margin-left: 0;
}

.product-variant-chip__count {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: #111827;
    letter-spacing: -0.01em;
}

.product-variant-chip--size {
    gap: 5px;
    padding: 3px 8px 3px 5px;
}

.product-variant-chip__sizes {
    display: inline-flex;
    align-items: center;
    padding-left: 2px;
}

.product-variant-chip__size {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    min-width: 16px;
    padding: 0;
    margin-left: -6px;
    border-radius: 50%;
    background: #eef2f7;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 0.5px rgba(15, 23, 42, 0.08);
    color: #374151;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    flex-shrink: 0;
}

.product-variant-chip__size:first-child {
    margin-left: 0;
}

.product-variant-chip--color.product-variant-chip--stacked {
    right: 8px;
    bottom: 34px;
}

.cat-card__price-row {
    margin-top: 8px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.cat-card__price {
    font-size: 16px;
    font-weight: 800;
    color: #111;
}

.cat-card__price-old {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

.cat-plp__pagination {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

.cat-plp__pagination .pagination {
    margin: 0;
    gap: 6px;
}

.cat-plp__pagination .page-link {
    border-radius: 8px;
    color: #333;
    border-color: var(--cat-line);
}

.cat-plp__pagination .page-item.active .page-link {
    background: var(--cat-accent);
    border-color: var(--cat-accent);
}

.cat-plp__empty {
    text-align: center;
    padding: 64px 24px;
    border: 1px dashed var(--cat-line);
    border-radius: 12px;
}

.cat-plp__empty i {
    font-size: 48px;
    color: #ccc;
}

.cat-plp__empty h2 {
    margin: 12px 0 6px;
    font-size: 22px;
}

.cat-plp__empty p {
    color: var(--cat-muted);
    margin-bottom: 18px;
}

/* Mobile */
@media (max-width: 1199px) {
    .cat-plp__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .cat-plp__layout {
        grid-template-columns: 1fr;
    }

    .cat-plp__sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: min(320px, 88vw);
        height: 100vh;
        z-index: 1200;
        background: #fff;
        padding: 16px;
        overflow-y: auto;
        transition: left .28s ease;
        box-shadow: 8px 0 24px rgba(0, 0, 0, .12);
    }

    .cat-plp__sidebar.is-open {
        left: 0;
    }

    .cat-plp__sidebar-head {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--cat-line);
    }

    .cat-plp__sidebar-close {
        width: 36px;
        height: 36px;
        border: none;
        background: #f5f5f5;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 22px;
    }

    .cat-plp__overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .45);
        z-index: 1190;
        opacity: 0;
        visibility: hidden;
        transition: opacity .28s ease;
    }

    .cat-plp__overlay.is-open {
        opacity: 1;
        visibility: visible;
    }

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

    .cat-plp__chips-row {
        flex-direction: column;
        align-items: stretch;
    }

    .cat-plp__sort {
        width: 100%;
        margin-left: 0;
        margin-top: 4px;
    }

    .cat-sort-select {
        width: 100%;
    }

    .cat-plp__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 10px;
    }

    .cat-plp__heading h1 {
        font-size: 22px;
    }
}

@media (max-width: 575px) {
    .cat-plp__inner {
        padding: 0 12px;
    }

    .cat-plp__chips {
        gap: 6px;
    }

    .cat-chip {
        font-size: 11px;
        height: 32px;
        padding: 0 10px;
    }
}
