/* =============================================
   Codlion Product Grid — Frontend Styles
   ============================================= */

/* ---- Shop container ---- */
.cl-shop-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px 32px;
}

/* ---- Breadcrumb ---- */
.cl-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 12px;
    color: var(--light-text-color, #777);
}

.cl-breadcrumb a {
    color: var(--light-text-color, #777);
    text-decoration: none;
    transition: color 0.2s ease;
}

.cl-breadcrumb a:hover {
    color: var(--primary-color, #a67c52);
}

.cl-breadcrumb-sep {
    color: #d1d5db;
}

.cl-breadcrumb-current {
    color: var(--secondary-color, #2c2c2c);
    font-weight: 500;
}

/* Visually hidden but SEO accessible */
.cl-shop-title-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Shop header ---- */
.cl-shop-header {
    margin-bottom: 12px;
}

.cl-shop-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--secondary-color, #2c2c2c);
}

.cl-shop-count {
    color: var(--light-text-color, #777);
    font-size: 14px;
    margin: 0;
}

/* ---- Filters bar ---- */
.cl-shop-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;
    margin-bottom: 24px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.cl-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    background: #fff;
    color: var(--secondary-color, #2c2c2c);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cl-filter-btn:hover {
    border-color: var(--primary-color, #a67c52);
    color: var(--primary-color, #a67c52);
}

.cl-filter-btn svg {
    flex-shrink: 0;
}

/* Push view switch to the right */
.cl-view-switch {
    margin-left: auto;
}

.cl-filter-select {
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease;
    width: 100%;
}

.cl-filter-select:hover,
.cl-filter-select:focus {
    border-color: var(--primary-color, #a67c52);
    outline: none;
}

.cl-search-form {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: auto;
}

.cl-search-input {
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px 0 0 6px;
    font-size: 14px;
    min-width: 180px;
    border-right: none;
}

.cl-search-input:focus {
    border-color: var(--primary-color, #a67c52);
    outline: none;
}

.cl-search-btn {
    padding: 8px 16px;
    border: 1px solid var(--primary-color, #a67c52);
    background: var(--primary-color, #a67c52);
    color: var(--cl-btn-text, #fff);
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cl-search-btn:hover {
    background: var(--link-hover-color, #8a6642);
}

/* ---- Filter drawer ---- */
.cl-filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cl-filter-overlay.open {
    opacity: 1;
    visibility: visible;
}

.cl-filter-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 340px;
    max-width: 85vw;
    height: 100%;
    background: #fff;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
}

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

.cl-filter-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.cl-filter-drawer-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--secondary-color, #2c2c2c);
    text-transform: uppercase;
}

.cl-filter-drawer-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--light-text-color, #777);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cl-filter-drawer-close:hover {
    color: var(--secondary-color, #2c2c2c);
}

.cl-filter-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

/* ---- Filter widgets (accordion) ---- */
.cl-filter-widget {
    border-bottom: 1px solid #f0f0f0;
    padding: 8px 0;
}

.cl-filter-widget summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--secondary-color, #2c2c2c);
    list-style: none;
    user-select: none;
}

.cl-filter-widget summary::-webkit-details-marker {
    display: none;
}

.cl-filter-widget summary svg {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.cl-filter-widget[open] summary svg {
    transform: rotate(180deg);
}

.cl-filter-widget-content {
    padding: 4px 0 16px;
}

/* ---- Category list in drawer ---- */
.cl-filter-cats-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cl-filter-cat-item a {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--light-text-color, #555);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.cl-filter-cat-item a:hover {
    background: #f9fafb;
    color: var(--primary-color, #a67c52);
}

.cl-filter-cat-item.active a {
    background: var(--primary-color, #a67c52);
    color: var(--cl-btn-text, #fff);
    font-weight: 500;
}

/* ---- Checkbox list in drawer ---- */
.cl-filter-check-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cl-filter-check-item {
    margin-bottom: 4px;
}

.cl-filter-check-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cl-filter-check-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    color: var(--light-text-color, #555);
    transition: all 0.2s ease;
}

.cl-filter-check-item label:hover {
    background: #f9fafb;
}

.cl-filter-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.cl-filter-checkbox svg {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cl-filter-check-item input[type="checkbox"]:checked + label .cl-filter-checkbox {
    background: var(--primary-color, #a67c52);
    border-color: var(--primary-color, #a67c52);
    color: var(--cl-btn-text, #fff);
}

.cl-filter-check-item input[type="checkbox"]:checked + label .cl-filter-checkbox svg {
    opacity: 1;
}

.cl-filter-check-item input[type="checkbox"]:checked + label {
    color: var(--secondary-color, #2c2c2c);
    font-weight: 500;
}

/* ---- Price range in drawer ---- */
.cl-filter-price-range {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cl-filter-price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cl-filter-price-field {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px 8px;
}

.cl-filter-price-field span {
    font-size: 13px;
    color: var(--light-text-color, #777);
    flex-shrink: 0;
}

.cl-filter-price-field input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    padding: 4px 0;
    background: transparent;
}

.cl-filter-price-field input:focus {
    color: var(--primary-color, #a67c52);
}

.cl-filter-price-sep {
    color: var(--light-text-color, #777);
    flex-shrink: 0;
}

.cl-filter-apply-btn {
    padding: 8px 16px;
    background: var(--primary-color, #a67c52);
    color: var(--cl-btn-text, #fff);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    align-self: flex-start;
}

.cl-filter-apply-btn:hover {
    background: var(--link-hover-color, #8a6642);
}

/* ---- Product grid ---- */
.codlion-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.codlion-cols-1 { grid-template-columns: 1fr; }
.codlion-cols-3 { grid-template-columns: repeat(3, 1fr); }
.codlion-cols-4 { grid-template-columns: repeat(4, 1fr); }
.codlion-cols-5 { grid-template-columns: repeat(5, 1fr); }
.codlion-cols-2 { grid-template-columns: repeat(2, 1fr); }

/* ---- View switch ---- */
.cl-view-switch {
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 2px;
}

.cl-view-switch button {
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #9aa0a6;
    transition: all 0.2s ease;
}

.cl-view-switch button:hover {
    color: var(--primary-color, #a67c52);
    background: #f9fafb;
}

.cl-view-switch button.active {
    background: var(--primary-color, #a67c52);
    color: var(--cl-btn-text, #fff);
}

.cl-view-switch .desktop-only { display: inline-flex; }
.cl-view-switch .mobile-only { display: none; }

/* ---- List view ---- */
.codlion-product-grid.list-view {
    grid-template-columns: 1fr;
    gap: 10px;
}

.codlion-product-grid.list-view .cl-product-card {
    flex-direction: row;
    align-items: stretch;
}

.codlion-product-grid.list-view .cl-card-image-wrap {
    width: 200px;
    flex-shrink: 0;
    aspect-ratio: auto;
    align-self: stretch;
}

.codlion-product-grid.list-view .cl-card-image {
    object-fit: cover;
    height: 100%;
}

.codlion-product-grid.list-view .cl-card-body {
    flex: 1;
    padding: 16px;
    overflow: hidden;
}

.codlion-product-grid.list-view .cl-card-desc {
    display: none;
}

/* ---- Product card — Shopify premium style ---- */
.cl-product-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: var(--products-card-radius, 8px);
    overflow: hidden;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cl-product-card:hover {
    border-color: #e0e0e0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.cl-card-image-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: var(--cl-card-image-ratio, 3/4);
    background: #f9fafb;
}

.cl-card-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.cl-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.4s ease;
}

/* Second image — hidden by default, fades in on hover (Shella-style) */
.cl-card-image-secondary {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    z-index: 1;
}

/* Only swap images when a secondary image exists — otherwise just zoom the primary */
.cl-product-card:has(.cl-card-image-secondary):hover .cl-card-image-secondary {
    opacity: 1;
}

.cl-product-card:has(.cl-card-image-secondary):hover .cl-card-image-primary {
    opacity: 0;
}

.cl-product-card:hover .cl-card-image {
    transform: scale(1.03);
}

.cl-card-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 13px;
    background: #f3f4f6;
}

/* ---- Badges ---- */
.cl-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--cl-btn-text, #fff);
    z-index: 2;
}

.cl-badge-sale { background: #D72E2E; }
.cl-badge-out { background: #6b7280; }
.cl-badge-variable { background: var(--primary-color, #a67c52); }
.cl-badge-limited { background: #D72E2E; }
.cl-badge-new { background: var(--primary-color, #a67c52); }
.cl-badge-hot { background: var(--primary-color, #a67c52); }

/* ---- Card body ---- */
.cl-card-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.cl-card-title {
    font-size: 13px;
    font-weight: 500;
    margin: 0 0 4px;
    line-height: 1.4;
}

.cl-card-title a {
    color: var(--secondary-color, #2c2c2c);
    text-decoration: none;
    transition: color 0.2s ease;
}

.cl-card-title a:hover {
    color: var(--primary-color, #a67c52);
}

/* Card rating stars — golden (universal convention, independent of theme color) */
.cl-card-rating {
    display: flex;
    align-items: center;
    gap: 1px;
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1;
}
.cl-card-rating .cl-review-star-filled {
    color: #f5a623;
}
.cl-card-rating .cl-review-star-empty {
    color: #e0e0e0;
}

.cl-card-desc {
    font-size: 12px;
    color: var(--light-text-color, #999);
    margin: 0 0 6px;
    line-height: 1.45;
    flex: 1;
}

/* ---- Card variants (variable products) ---- */
.cl-card-variants {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
    min-width: 0;
    width: 100%;
}

.cl-card-variant-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

/* (Mobile variant rules moved below desktop rules for correct cascade order) */

.cl-card-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    overflow: visible;
    padding: 2px 0;
}

.cl-card-color-swatches.cl-card-variant-expanded {
    flex-wrap: wrap;
}

.cl-card-color-swatch {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    border-radius: 50%;
    border: 1px solid #c9c9c9;
    display: block;
    box-sizing: border-box;
    flex-shrink: 0;
    cursor: pointer;
    padding: 0;
    margin: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cl-card-color-swatch:hover {
    border-color: var(--primary-color, #a67c52);
}

.cl-card-color-swatch.active {
    border-color: var(--primary-color, #a67c52);
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px var(--primary-color, #a67c52);
}

.cl-card-color-swatch-img {
    border-radius: 50%;
    border: none;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    display: block;
    box-sizing: border-box;
    flex-shrink: 0;
    cursor: pointer;
    padding: 0;
    margin: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.cl-card-color-swatch-img.active {
    border: none;
}

.cl-card-variant-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    overflow: visible;
    padding: 2px 0;
}

.cl-card-variant-pills.cl-card-variant-expanded {
    flex-wrap: wrap;
}

.cl-card-variant-pill {
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 4px;
    background: #ffffff;
    color: #3a3a3a;
    border: 1px solid #c9c9c9;
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.cl-card-variant-pill:hover {
    border-color: var(--primary-color, #a67c52);
    color: var(--primary-color, #a67c52);
}

.cl-card-variant-pill.active {
    border-color: var(--primary-color, #a67c52);
    color: var(--primary-color, #a67c52);
    background: #ffffff;
    font-weight: 600;
}

.cl-card-variant-hidden {
    display: none;
}

.cl-card-variant-overflow {
    color: var(--light-text-color, #6b7280);
    font-weight: 500;
    font-size: 8px;
    padding: 1px 2px;
    background: transparent;
    border: none;
    flex-shrink: 0;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1.2;
    transition: color 0.2s ease;
    align-self: center;
}

.cl-card-variant-overflow:hover {
    color: var(--primary-color, #a67c52);
}

/* Mobile: 5 variants per line, +X badge inline at end */
@media (max-width: 991px) {
    .cl-card-variant-group {
        width: 100%;
    }

    /* Color swatches: nowrap so +X stays on same line; expanded wraps */
    .cl-card-color-swatches {
        gap: 4px;
        flex-wrap: nowrap;
        width: 100%;
        overflow: visible;
        padding: 2px 0;
    }

    .cl-card-color-swatches.cl-card-variant-expanded {
        flex-wrap: wrap;
    }

    .cl-card-color-swatch,
    .cl-card-color-swatch-img {
        width: 19px;
        height: 19px;
        min-width: 19px;
        min-height: 19px;
    }

    /* Pills: nowrap so +X stays on same line; expanded wraps */
    .cl-card-variant-pills {
        gap: 3px;
        flex-wrap: nowrap;
        width: 100%;
        overflow: visible;
        padding: 2px 0;
    }

    .cl-card-variant-pills.cl-card-variant-expanded {
        flex-wrap: wrap;
        overflow: visible;
    }

    .cl-card-variant-pill {
        font-size: 10px;
        padding: 2px 5px;
        border-radius: 3px;
        line-height: 1.2;
        border-width: 1px;
        letter-spacing: 0;
        flex-shrink: 0;
    }

    /* +X badge: same size as variants, inline */
    .cl-card-variant-overflow {
        font-size: 10px;
        padding: 2px 5px;
        flex-shrink: 0;
    }
}

/* ---- Price ---- */
.cl-card-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: nowrap;
}

.cl-card-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.cl-price-current {
    font-size: 15px;
    font-weight: 600;
    color: var(--secondary-color, #2c2c2c);
    white-space: nowrap;
}

.cl-price-regular {
    font-size: 12px;
    color: var(--light-text-color, #999);
    text-decoration: line-through;
    white-space: nowrap;
}

/* ---- Card actions ---- */
.cl-card-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
}

.cl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    line-height: 1.4;
    font-family: inherit;
    white-space: nowrap;
    min-width: 0;
    box-sizing: border-box;
}

.cl-btn-cart {
    flex: 1;
    width: 100%;
    background: var(--btn-cart-bg, var(--primary-color, #a67c52));
    color: var(--cl-btn-text, #fff);
    border: 1px solid var(--btn-cart-bg, var(--primary-color, #a67c52));
}

.cl-btn-cart:hover {
    background: var(--btn-cart-hover, var(--link-hover-color, #8a6642));
    border-color: var(--btn-cart-hover, var(--link-hover-color, #8a6642));
}

.cl-btn-order {
    flex: 1;
    width: 100%;
    background: var(--btn-order-bg, #ffffff);
    color: var(--btn-order-text, var(--secondary-color, #2c2c2c));
    border: 1px solid var(--btn-order-border, #d1d5db);
}

.cl-btn-order:hover {
    background: var(--btn-order-hover, var(--primary-color, #a67c52));
    border-color: var(--btn-order-hover, var(--primary-color, #a67c52));
    color: var(--cl-btn-text, #fff);
}

/* When Order Now is the only button (Add to Cart hidden), style it as primary filled */
body.desktop-btn-order_now .cl-btn-order,
body.mobile-btn-order_now .cl-btn-order,
.cl-card-actions-no-cart .cl-btn-order {
    background: var(--btn-cart-bg, var(--primary-color, #a67c52));
    color: var(--cl-btn-text, #fff);
    border: 1px solid var(--btn-cart-bg, var(--primary-color, #a67c52));
}

body.desktop-btn-order_now .cl-btn-order:hover,
body.mobile-btn-order_now .cl-btn-order:hover,
.cl-card-actions-no-cart .cl-btn-order:hover {
    background: var(--btn-cart-hover, var(--link-hover-color, #8a6642));
    border-color: var(--btn-cart-hover, var(--link-hover-color, #8a6642));
}

.cl-card-unavailable {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    padding: 8px 14px;
    color: var(--light-text-color, #6b7280);
    font-size: 12px;
    font-weight: 500;
    background: var(--cl-surface-muted, #f3f4f6);
    border: 1px solid var(--cl-border, #e5e7eb);
    border-radius: 6px;
    line-height: 1.4;
    font-family: inherit;
    white-space: nowrap;
    box-sizing: border-box;
}

/* ---- Empty state ---- */
.cl-shop-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--light-text-color, #777);
}

.cl-shop-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #d1d5db;
}

.cl-shop-empty h1 {
    font-size: 1.5rem;
    margin: 0 0 8px;
    color: var(--secondary-color, #2c2c2c);
}

.cl-shop-empty p {
    margin: 0 0 20px;
}

/* ---- Pagination ---- */
.codlion-pagination {
    margin-top: 40px;
    text-align: center;
}

.codlion-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-decoration: none;
    color: var(--secondary-color, #2c2c2c);
    font-size: 14px;
    transition: all 0.2s ease;
}

.codlion-pagination .page-numbers:hover {
    border-color: var(--primary-color, #a67c52);
    color: var(--primary-color, #a67c52);
}

.codlion-pagination .page-numbers.current {
    background: var(--primary-color, #a67c52);
    color: var(--cl-btn-text, #fff);
    border-color: var(--primary-color, #a67c52);
}

/* Standard WordPress pagination (archive.php — the_posts_pagination) */
.navigation.pagination {
    margin-top: 40px;
    text-align: center;
}
.navigation.pagination .nav-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}
.navigation.pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--cl-border, #d1d5db);
    border-radius: 6px;
    text-decoration: none;
    color: var(--secondary-color, #2c2c2c);
    font-size: 14px;
    transition: all 0.2s ease;
}
.navigation.pagination .page-numbers:hover {
    border-color: var(--primary-color, #a67c52);
    color: var(--primary-color, #a67c52);
}
.navigation.pagination .page-numbers.current {
    background: var(--primary-color, #a67c52);
    color: var(--cl-btn-text, #fff);
    border-color: var(--primary-color, #a67c52);
}

/* ---- Responsive ---- */

/* 2-column desktop: buttons side by side */
.codlion-cols-2 .cl-card-actions {
    flex-direction: row;
}

.codlion-cols-2 .cl-card-price-row {
    gap: 4px;
}

.codlion-cols-2 .cl-price-current {
    font-size: 14px;
}

.codlion-cols-2 .cl-price-regular {
    font-size: 11px;
}

.codlion-cols-2 .cl-btn {
    display: flex;
    flex: 1;
    padding: 10px 12px;
    font-size: 12px;
    gap: 4px;
    box-sizing: border-box;
}

.codlion-cols-2 .cl-card-price-row {
    flex-wrap: nowrap;
    overflow: hidden;
}

@media screen and (max-width: 1200px) {
    .codlion-product-grid,
    .codlion-cols-4,
    .codlion-cols-5 { grid-template-columns: repeat(3, 1fr); }
}

@media screen and (max-width: 991px) {
    .codlion-product-grid,
    .codlion-cols-4,
    .codlion-cols-5,
    .codlion-cols-3 { grid-template-columns: repeat(2, 1fr); }

    .codlion-product-grid,
    .codlion-cols-2,
    .codlion-cols-3,
    .codlion-cols-4,
    .codlion-cols-5 { gap: 10px; }

    body:not(.home) .cl-shop-container {
        padding: 0 14px 14px;
    }

    body.home .cl-shop-container {
        padding: 12px 14px 32px;
    }

    .cl-shop-page .cl-breadcrumb,
    .cl-collections-page .cl-breadcrumb {
        flex-wrap: nowrap;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .codlion-cols-3 .cl-card-actions,
    .codlion-cols-4 .cl-card-actions,
    .codlion-cols-5 .cl-card-actions {
        flex-direction: column;
    }

    /* Mobile: stack buttons vertically by default */
    .codlion-cols-2 .cl-card-actions,
    .codlion-cols-3 .cl-card-actions,
    .codlion-cols-4 .cl-card-actions,
    .codlion-cols-5 .cl-card-actions {
        flex-direction: column;
    }

    /* Mobile button visibility based on customizer body class */
    /* Default: add_to_cart only — hide Order Now (unless Add to Cart is disabled) */
    body.mobile-btn-add_to_cart .codlion-cols-2 .cl-btn-order,
    body.mobile-btn-add_to_cart .codlion-cols-3 .cl-btn-order,
    body.mobile-btn-add_to_cart .codlion-cols-4 .cl-btn-order,
    body.mobile-btn-add_to_cart .codlion-cols-5 .cl-btn-order {
        display: none;
    }
    /* But show Order Now if Add to Cart is disabled */
    body.mobile-btn-add_to_cart .cl-card-actions-no-cart .cl-btn-order {
        display: inline-flex;
    }

    /* order_now only — hide Add to Cart */
    body.mobile-btn-order_now .codlion-cols-2 .cl-btn-cart,
    body.mobile-btn-order_now .codlion-cols-3 .cl-btn-cart,
    body.mobile-btn-order_now .codlion-cols-4 .cl-btn-cart,
    body.mobile-btn-order_now .codlion-cols-5 .cl-btn-cart {
        display: none;
    }

    /* none — hide both */
    body.mobile-btn-none .codlion-cols-2 .cl-btn-cart,
    body.mobile-btn-none .codlion-cols-3 .cl-btn-cart,
    body.mobile-btn-none .codlion-cols-4 .cl-btn-cart,
    body.mobile-btn-none .codlion-cols-5 .cl-btn-cart,
    body.mobile-btn-none .codlion-cols-2 .cl-btn-order,
    body.mobile-btn-none .codlion-cols-3 .cl-btn-order,
    body.mobile-btn-none .codlion-cols-4 .cl-btn-order,
    body.mobile-btn-none .codlion-cols-5 .cl-btn-order {
        display: none;
    }

    /* 2-column mobile: compact sizing matching list view */
    .codlion-cols-2 .cl-card-title { font-size: 14px; margin-bottom: 4px; }
    .codlion-cols-2 .cl-card-body { padding: 8px; }
    .codlion-cols-2 .cl-card-price-row { margin-bottom: 6px; }
    .codlion-cols-2 .cl-btn { font-size: 11px; padding: 7px 10px; gap: 4px; }

    .codlion-cols-3 .cl-card-title,
    .codlion-cols-4 .cl-card-title,
    .codlion-cols-5 .cl-card-title { font-size: 14px; margin-bottom: 4px; }

    .codlion-cols-3 .cl-card-body,
    .codlion-cols-4 .cl-card-body,
    .codlion-cols-5 .cl-card-body { padding: 8px; }

    .codlion-cols-3 .cl-card-price-row,
    .codlion-cols-4 .cl-card-price-row,
    .codlion-cols-5 .cl-card-price-row { margin-bottom: 6px; }

    .codlion-cols-3 .cl-btn,
    .codlion-cols-4 .cl-btn,
    .codlion-cols-5 .cl-btn {
        display: flex;
        width: 100%;
        padding: 10px 12px;
        font-size: 12px;
        gap: 4px;
        box-sizing: border-box;
    }

    .codlion-cols-3 .cl-card-price-row,
    .codlion-cols-4 .cl-card-price-row,
    .codlion-cols-5 .cl-card-price-row {
        flex-wrap: nowrap;
        overflow: hidden;
        gap: 4px;
    }

    .codlion-cols-3 .cl-price-current,
    .codlion-cols-4 .cl-price-current,
    .codlion-cols-5 .cl-price-current {
        font-size: 14px;
    }

    .codlion-cols-3 .cl-price-regular,
    .codlion-cols-4 .cl-price-regular,
    .codlion-cols-5 .cl-price-regular {
        font-size: 11px;
    }

    .cl-shop-filters {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: space-between;
        padding: 0;
        border-radius: 0;
    }

    .cl-filter-btn {
        flex: 1 1 auto;
        justify-content: center;
        padding: 8px 14px;
        font-size: 13px;
        border-radius: 8px;
        background: var(--primary-color, #a67c52);
        color: var(--cl-btn-text, #fff);
        border-color: var(--primary-color, #a67c52);
    }

    .cl-filter-btn:hover {
        background: var(--link-hover-color, #8a6642);
        border-color: var(--link-hover-color, #8a6642);
        color: var(--cl-btn-text, #fff);
    }

    .cl-view-switch {
        margin: 0;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .cl-view-switch button {
        padding: 8px 12px;
        font-size: 15px;
    }

    .cl-search-form { margin-left: 0; flex: 1 1 100%; min-width: 0; order: 3; }
    .cl-search-input { min-width: 0; flex: 1; }

    .cl-view-switch .desktop-only { display: none; }
    .cl-view-switch .mobile-only { display: inline-flex; }

    .codlion-product-grid.list-view .cl-card-image-wrap { width: 130px; height: 130px; }
    .codlion-product-grid.list-view .cl-card-body { padding: 10px; }
    .codlion-product-grid.list-view .cl-card-title { font-size: 14px; margin-bottom: 4px; }
    .codlion-product-grid.list-view .cl-card-price-row { margin-bottom: 6px; }
    .codlion-product-grid.list-view .cl-btn { font-size: 11px; padding: 7px 10px; gap: 4px; }
    .codlion-product-grid.list-view .cl-card-actions { gap: 6px; }
}

@media screen and (max-width: 600px) {
    .codlion-product-grid,
    .codlion-cols-4,
    .codlion-cols-5,
    .codlion-cols-3 { grid-template-columns: repeat(2, 1fr); }

    .codlion-product-grid,
    .codlion-cols-2,
    .codlion-cols-3,
    .codlion-cols-4,
    .codlion-cols-5 { gap: 8px; }

    .codlion-cols-1 { grid-template-columns: 1fr; }

    .codlion-product-grid.list-view .cl-card-image-wrap { width: 110px; height: 110px; }
    .codlion-product-grid.list-view .cl-card-body { padding: 8px; }
    .codlion-product-grid.list-view .cl-card-title { font-size: 13px; margin-bottom: 3px; }
    .codlion-product-grid.list-view .cl-card-price-row { margin-bottom: 4px; }
    .codlion-product-grid.list-view .cl-card-actions { gap: 4px; }
    .codlion-product-grid.list-view .cl-btn { font-size: 10px; padding: 6px 8px; gap: 3px; }

    body:not(.home) .cl-shop-container { padding: 0 14px 14px; }
    body.home .cl-shop-container { padding: 12px 14px 32px; }
    .cl-shop-title { font-size: 1.5rem; }
}

/* ---- RTL Support ---- */
html[dir="rtl"] .cl-filter-drawer {
    left: auto;
    right: 0;
    transform: translateX(100%);
}

html[dir="rtl"] .cl-filter-drawer.open {
    transform: translateX(0);
}

html[dir="rtl"] .cl-filter-drawer-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .cl-filter-widget summary {
    flex-direction: row-reverse;
}

html[dir="rtl"] .cl-filter-price-inputs {
    flex-direction: row-reverse;
}

/* ---- Collections page ---- */
.cl-collections-grid {
    display: grid;
    grid-template-columns: var(--collections-desktop-cols, repeat(3, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.cl-collection-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--collections-card-radius, 12px);
    overflow: hidden;
    text-decoration: none;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.cl-collection-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.cl-collection-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f9fafb;
}

.cl-collection-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.cl-collection-card:hover .cl-collection-card-image img {
    transform: scale(1.05);
}

.cl-collection-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #d1d5db;
}

.cl-collection-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.cl-collection-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    text-align: center;
    color: var(--secondary-color, #2c2c2c);
    transition: color 0.2s ease;
}

.cl-collection-card:hover .cl-collection-card-title {
    color: var(--primary-color, #a67c52);
}

.cl-collection-card-desc {
    font-size: 13px;
    color: var(--light-text-color, #777);
    margin: 0;
    line-height: 1.5;
    flex: 1;
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

/* ---- Collections responsive ---- */
@media (max-width: 991px) {
    .cl-collections-grid {
        grid-template-columns: var(--collections-mobile-cols, repeat(2, 1fr));
        gap: 16px;
    }

    .cl-collection-card-body {
        padding: 16px;
    }

    .cl-collection-card-title {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .cl-collections-grid {
        gap: 12px;
    }

    .cl-collection-card-body {
        padding: 12px;
    }
}

/* ---- Collections: Overlay style ---- */
.cl-collections-style-overlay .cl-collection-card {
    position: relative;
}

.cl-collections-style-overlay .cl-collection-card-image {
    aspect-ratio: 3 / 4;
}

.cl-collections-style-overlay .cl-collection-card-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    z-index: 1;
}

.cl-collections-style-overlay .cl-collection-card-title {
    color: var(--cl-btn-text, #fff);
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.cl-collections-style-overlay .cl-collection-card:hover .cl-collection-card-title {
    color: var(--cl-btn-text, #fff);
}

.cl-collections-style-overlay .cl-collection-card-desc {
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
}

.cl-collections-style-overlay .cl-collection-card-placeholder {
    color: #d1d5db;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

/* ---- Collections: Minimal style ---- */
.cl-collections-style-minimal .cl-collection-card {
    position: relative;
}

.cl-collections-style-minimal .cl-collection-card-image {
    aspect-ratio: 1;
}

.cl-collections-style-minimal .cl-collection-card-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1;
}

.cl-collections-style-minimal .cl-collection-card:hover .cl-collection-card-body {
    opacity: 1;
    transform: translateY(0);
}

.cl-collections-style-minimal .cl-collection-card-title {
    color: var(--cl-btn-text, #fff);
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.cl-collections-style-minimal .cl-collection-card:hover .cl-collection-card-title {
    color: var(--cl-btn-text, #fff);
}

.cl-collections-style-minimal .cl-collection-card-desc {
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
}

.cl-collections-style-minimal .cl-collection-card-placeholder {
    color: #d1d5db;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

/* ---- Homepage Product Sections ---- */
.cl-home-product-section {
    padding: 8px 0;
    margin: 0;
}

.cl-home-section-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
    gap: 4px;
}

.cl-home-section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
    width: 100%;
}

.cl-home-section-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.cl-home-section-title {
    font-size: var(--h3-font-size, 1.75rem);
    font-weight: var(--heading-font-weight, 600);
    color: var(--secondary-color, #2c2c2c);
    margin: 0;
    font-family: var(--main-font, 'Poppins', sans-serif);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

/* Accent bar before section titles — premium vertical bar in primary color */
.cl-home-section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 0.9em;
    background: var(--primary-color, #a67c52);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Ensure icons inside titles render properly with inline-flex parent */
.cl-home-section-title > i {
    display: inline-block;
    flex-shrink: 0;
}

/* When title contains an icon (e.g. Limited Offers), hide accent bar — icon provides visual accent */
.cl-home-section-title:has(> i)::before {
    display: none;
}
.cl-home-section-subtitle {
    font-size: 0.95rem;
    color: var(--cl-text-muted, #6b7280);
    margin: 4px 0 0;
    font-weight: 400;
    line-height: 1.5;
}

/* Subtitle alignment — controlled via Customizer (home_subtitle_alignment) */
body.cl-subtitle-left .cl-home-section-subtitle { text-align: left; }
body.cl-subtitle-center .cl-home-section-subtitle { text-align: center; }
body.cl-subtitle-right .cl-home-section-subtitle { text-align: right; }

/* RTL: flip the arrow icon so it points left in RTL mode */
body.rtl-mode .cl-home-section-link i.fa-arrow-right {
    transform: scaleX(-1);
}

.cl-home-section-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--primary-color, #a67c52);
    text-decoration: none;
    font-family: var(--main-font, 'Poppins', sans-serif);
    transition: color 0.2s ease;
}

.cl-home-section-link:hover {
    color: var(--link-hover-color, #8a6642);
}

.cl-home-section-link i {
    font-size: 12px;
}

@media (max-width: 991px) {
    .cl-home-product-section {
        padding: 6px 0;
        margin: 0;
    }

    .cl-home-section-header {
        margin-bottom: 12px;
    }

    .cl-home-section-title-row {
        gap: 8px;
    }

    .cl-home-section-title {
        font-size: 1.25rem;
        line-height: 1.3;
    }

    .cl-home-section-link {
        font-size: 13px;
        gap: 5px;
        white-space: nowrap;
    }
}

