/* ==========================================================================
   Category page — modern redesign
   Scoped under .cp-category-page (classes prefixed cp-) so shared theme
   classes (.btn_full, .rating, .box_style_*) keep their old look elsewhere.
   Palette: coral #FF6B4A / teal #1F7A6C / cream #FFF6EE on warm neutrals.
   Type: Fredoka (headings) + Nunito Sans (body) — loaded from the master page.
   ========================================================================== */

.cp-category-page {
    --cp-coral: #FF6B4A;
    --cp-coral-dark: #E24E2F;
    --cp-coral-soft: rgba(255, 107, 74, 0.08);
    --cp-teal: #1F7A6C;
    --cp-teal-dark: #145E53;
    --cp-gold: #FFB238;
    --cp-green: #2FA36B;
    --cp-danger: #E14D67;
    --cp-cream: #FFF6EE;
    --cp-ink: #241F1B;
    --cp-body: #6B6058;
    --cp-muted: #A49A91;
    --cp-border: #F0E2D6;
    --cp-surface: #FFFFFF;
    --cp-radius: 16px;
    --cp-radius-sm: 10px;
    --cp-shadow: 0 10px 30px rgba(36, 31, 27, 0.07);
    --cp-shadow-hover: 0 14px 34px rgba(36, 31, 27, 0.13);

    color: var(--cp-body);
    font-family: "Nunito Sans", Arial, sans-serif;
}

/* ---------- Page head + banner ---------- */

.cp-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
    margin: 4px 0 14px;
}

.cp-page-title {
    margin: 0;
    font-size: 32px;
    font-weight: 600;
    color: var(--cp-ink);
}

.cp-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--cp-muted);
}

.cp-banner {
    margin: 0 0 22px;
}

.cp-banner:empty {
    display: none;
}

.cp-banner img {
    width: 100%;
    border-radius: var(--cp-radius);
}

/* ---------- Product grid ---------- */

.cp-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

@media (min-width: 768px) {
    .cp-grid {
        gap: 20px;
    }
}

@media (min-width: 992px) {
    .cp-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

/* ---------- Product card ---------- */

.cp-card {
    display: flex;
    flex-direction: column;
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(36, 31, 27, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cp-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--cp-shadow-hover);
}

.cp-card-media {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: linear-gradient(135deg, var(--cp-cream), #FFE9D6);
}

.cp-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.cp-card:hover .cp-card-media img {
    transform: scale(1.05);
}

.cp-discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--cp-green);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    padding: 5px 10px;
    border-radius: 999px;
}

.cp-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    padding: 16px;
}

.cp-card-title {
    margin: 0;
    font-family: "Nunito Sans", Arial, sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cp-card-title a {
    color: var(--cp-ink);
    text-decoration: none;
    transition: color 0.2s ease;
}

.cp-card-title a:hover {
    color: var(--cp-coral);
}

.cp-card-meta {
    margin: 0;
    font-size: 13px;
    color: var(--cp-muted);
}

.cp-card-rating {
    display: flex;
    align-items: center;
    gap: 1px;
    font-size: 14px;
}

.cp-category-page .rating .icon-star.voted {
    color: var(--cp-gold);
}

.cp-category-page .rating .icon-star-empty {
    color: #E8DCD2;
}

.cp-card-rating small {
    margin-left: 5px;
    color: var(--cp-muted);
}

.cp-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 2px;
}

.cp-price {
    font-family: "Fredoka", "Nunito Sans", Arial, sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--cp-ink);
}

.cp-price sup {
    font-size: 12px;
    margin-right: 1px;
}

.cp-mrp {
    font-size: 13px;
    color: var(--cp-muted);
    text-decoration: line-through;
}

/* Variant swatches — markup emitted by code-behind (.lnkImage, .img-circle, .cp-more) */

.cp-variants {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.cp-variants .lnkImage img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--cp-border);
    transition: border-color 0.2s ease;
}

.cp-variants .lnkImage:hover img {
    border-color: var(--cp-coral);
}

.cp-variants .cp-more {
    font-size: 12px;
    font-weight: 700;
    color: var(--cp-muted);
}

.cp-category-page .img-circle {
    background-image: linear-gradient(135deg, var(--cp-cream), #FFE0D0);
}

/* Buy button — shared theme class, restyled inside this scope only */

.cp-category-page .btn_full {
    display: block;
    margin-top: auto;
    background: var(--cp-coral);
    color: #fff;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
    padding: 11px 18px;
    border: none;
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.cp-category-page .btn_full:hover,
.cp-category-page .btn_full:focus {
    background: var(--cp-coral-dark);
    color: #fff;
}

/* ---------- Empty category ---------- */

.cp-empty {
    background: var(--cp-cream);
    border: 1px dashed var(--cp-border);
    border-radius: var(--cp-radius);
    text-align: center;
    padding: 48px 20px;
}

.cp-empty h3 {
    margin: 0 0 6px;
    font-size: 20px;
    color: var(--cp-ink);
}

.cp-empty p {
    margin: 0;
    color: var(--cp-muted);
}

/* ---------- Category description (CMS HTML from code-behind) ---------- */

.cp-desc {
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow);
    padding: 26px 28px;
    margin-top: 28px;
    font-size: 14.5px;
    line-height: 1.7;
    overflow-x: auto;
}

.cp-desc:empty {
    display: none;
}

.cp-desc h1,
.cp-desc h2,
.cp-desc h3,
.cp-desc h4 {
    color: var(--cp-ink);
    margin: 18px 0 10px;
}

.cp-desc h1:first-child,
.cp-desc h2:first-child,
.cp-desc h3:first-child,
.cp-desc p:first-child {
    margin-top: 0;
}

.cp-desc h1 { font-size: 24px; }
.cp-desc h2 { font-size: 22px; }
.cp-desc h3 { font-size: 18px; }

.cp-desc p {
    margin: 0 0 12px;
}

.cp-desc ul,
.cp-desc ol {
    margin: 0 0 14px;
    padding-left: 22px;
}

.cp-desc li {
    margin-bottom: 6px;
}

.cp-desc a {
    color: var(--cp-teal);
}

.cp-desc img {
    max-width: 100%;
    height: auto;
    border-radius: var(--cp-radius-sm);
}

/* ---------- Sidebar: categories ---------- */

.cp-side-card {
    background: var(--cp-surface);
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius);
    box-shadow: var(--cp-shadow);
    padding: 20px;
    margin-bottom: 24px;
}

.cp-side-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--cp-ink);
}

.cp-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cp-cat-list li + li {
    border-top: 1px dashed var(--cp-border);
}

.cp-cat-list a {
    position: relative;
    display: block;
    padding: 9px 2px;
    font-size: 14px;
    font-weight: 600;
    color: var(--cp-body);
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.cp-cat-list a:hover {
    color: var(--cp-coral);
    padding-left: 6px;
}

.cp-cat-list a.cp-active {
    color: var(--cp-coral);
    font-weight: 800;
}

.cp-cat-list a.cp-active::before {
    content: "";
    position: absolute;
    left: -20px; /* reaches the card edge (matches .cp-side-card padding) */
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--cp-coral);
}

/* ---------- Mobile ---------- */

@media (max-width: 767.98px) {
    .cp-page-title {
        font-size: 24px;
    }

    /* Category list becomes wrapping chips below the products */
    .cp-cat-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .cp-cat-list li + li {
        border-top: 0;
    }

    .cp-cat-list a,
    .cp-cat-list a:hover {
        padding: 7px 14px;
    }

    .cp-cat-list a {
        background: var(--cp-cream);
        border: 1px solid var(--cp-border);
        border-radius: 999px;
        font-size: 13px;
    }

    .cp-cat-list a.cp-active {
        background: var(--cp-coral);
        border-color: var(--cp-coral);
        color: #fff;
    }

    .cp-cat-list a.cp-active::before {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .cp-card-body {
        padding: 12px;
        gap: 6px;
    }

    .cp-card-title {
        font-size: 13.5px;
    }

    .cp-price {
        font-size: 17px;
    }

    .cp-category-page .btn_full {
        font-size: 13px;
        padding: 9px 14px;
    }

    .cp-variants .lnkImage img {
        width: 28px;
        height: 28px;
    }

    .cp-desc {
        padding: 20px 18px;
    }
}
