/* =========================================================
   Custom Home Page - Gearbox Auto Parts
   Scoped CSS for template-home-custom.php
   ========================================================= */

/* Woodmart layout fix only for this custom template */
body.page-template-template-home-custom .wd-content-layout,
body.page-template-template-home-custom .site-content,
body.page-template-template-home-custom .content-layout-wrapper {
    --wd-col-lg: 1 !important;
    --wd-col-md: 1 !important;
    --wd-col-sm: 1 !important;
}

body.page-template-template-home-custom .main-page-wrapper,
body.page-template-template-home-custom .site-content,
body.page-template-template-home-custom .custom-home {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* =========================================================
   Base
   ========================================================= */

.custom-home {
    --cfh-primary: #ff653f;
    --cfh-primary-light: #ffc85c;
    --cfh-dark: #1e104e;
    --cfh-secondary: #452e5a;
    --cfh-bg: #f7f7f8;
    --cfh-white: #ffffff;
    --cfh-text: #222222;
    --cfh-muted: #666666;
    --cfh-border: #eeeeee;
    --cfh-soft-orange: #fff3ee;
    --cfh-shadow: 0 10px 30px rgba(30, 16, 78, 0.08);
    --cfh-shadow-strong: 0 18px 50px rgba(30, 16, 78, 0.16);
    --cfh-radius: 22px;

    background: var(--cfh-bg);
    color: var(--cfh-text);
}

.custom-home *,
.custom-home *::before,
.custom-home *::after {
    box-sizing: border-box;
}

.custom-home a {
    text-decoration: none;
}

.custom-home button,
.custom-home input,
.custom-home select,
.custom-home textarea {
    font-family: inherit;
}

.custom-home img {
    max-width: 100%;
    height: auto;
}

.custom-home .cfh-container {
    width: min(1320px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0;
    direction: rtl;
}

.custom-home .cfh-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================================================
   Hero Layer: Category + Slider
   ========================================================= */

.custom-home .cfh-hero-layer {
    position: relative;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    overflow: visible;
}

/* Wrapper for shortcode category */
.custom-home .cfh-category-shortcode {
    position: relative;
    z-index: 50;
    width: 100%;
}

/* Compatibility for old category markup */
.custom-home .cfh-category-card {
    position: relative;
    height: 500px;
    max-height: 500px;
    overflow: hidden;
    background: var(--cfh-white);
    border-radius: var(--cfh-radius);
    padding: 16px;
    box-shadow: var(--cfh-shadow);
    z-index: 30;
}

.custom-home .cfh-category-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 800;
    color: var(--cfh-dark);
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--cfh-border);
}

.custom-home .cfh-category-heading i {
    color: var(--cfh-primary);
}

.custom-home .cfh-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.custom-home .cfh-category-item + .cfh-category-item {
    border-top: 1px solid #f1f1f1;
}

.custom-home .cfh-category-link {
    width: 100%;
    min-height: 50px;
    padding: 0 6px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #333333;
    font-size: 14px;
    transition: 0.2s ease;
}

.custom-home .cfh-category-link:hover,
.custom-home .cfh-category-link:focus,
.custom-home .cfh-category-item.is-active .cfh-category-link {
    color: var(--cfh-primary);
    background: var(--cfh-soft-orange);
    padding-right: 12px;
    padding-left: 12px;
    outline: none;
}

.custom-home .cfh-category-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-home .cfh-category-info i {
    color: var(--cfh-secondary);
}

.custom-home .cfh-category-link:hover .cfh-category-info i,
.custom-home .cfh-category-item.is-active .cfh-category-info i {
    color: var(--cfh-primary);
}

/* Static mega menu shortcode compatibility */
.custom-home .cfh-category-shortcode .gpc-category-widget-static,
.custom-home .cfh-category-shortcode .gpc-category-widget-static .gpc-dropdown {
    width: 100%;
    max-width: none;
}

.custom-home .cfh-category-shortcode .gpc-category-widget-static .gpc-dropdown {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    display: flex !important;
    gap: 20px;
}

.custom-home .cfh-category-shortcode .gpc-category-widget-static .gpc-category-card {
    height: 500px;
    max-height: 500px;
    overflow: hidden;
}

/* =========================================================
   Mega Menu Desktop
   ========================================================= */

.custom-home .cfh-mega-panel {
    position: absolute;
    top: 0;
    right: 310px;
    width: min(760px, calc(100% - 330px));
    height: 500px;
    max-height: 500px;
    overflow: hidden;
    background: var(--cfh-white);
    border-radius: var(--cfh-radius);
    padding: 24px;
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    box-shadow: var(--cfh-shadow-strong);
    border: 1px solid rgba(255, 101, 63, 0.12);
    z-index: 90;
}

.custom-home .cfh-mega-panel.is-open {
    display: grid;
}

.custom-home .cfh-mega-col h3 {
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--cfh-border);
    color: var(--cfh-dark);
    font-size: 15px;
    line-height: 1.8;
}

.custom-home .cfh-mega-col a {
    display: block;
    padding: 8px 0;
    color: var(--cfh-muted);
    font-size: 14px;
    line-height: 1.8;
    transition: 0.2s ease;
}

.custom-home .cfh-mega-col a:hover {
    color: var(--cfh-primary);
    transform: translateX(-4px);
}

.custom-home .cfh-mega-banner {
    grid-column: span 3;
    margin-top: 6px;
    border-radius: 18px;
    padding: 18px;
    background: radial-gradient(circle at left, rgba(255, 200, 92, 0.6), transparent 35%),
    linear-gradient(135deg, var(--cfh-soft-orange), #fff9e9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid rgba(255, 101, 63, 0.12);
}

.custom-home .cfh-mega-banner strong {
    display: block;
    color: var(--cfh-dark);
    margin-bottom: 6px;
    font-size: 15px;
}

.custom-home .cfh-mega-banner span {
    color: var(--cfh-muted);
    font-size: 13px;
    line-height: 1.9;
}

.custom-home .cfh-mega-banner a {
    background: var(--cfh-primary);
    color: var(--cfh-white);
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    white-space: nowrap;
    transition: 0.2s ease;
}

.custom-home .cfh-mega-banner a:hover {
    background: var(--cfh-dark);
}

.custom-home .cfh-mobile-mega {
    display: none;
}

/* =========================================================
   Hero Slider - Safe 880x500 Ratio
   ========================================================= */

.custom-home .cfh-slider-widget {
    width: 100%;
    min-width: 0;
}

.custom-home .cfh-hero-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 880 / 500;
    height: auto !important;
    max-height: none !important;
    overflow: hidden;
    border-radius: 26px;
    box-shadow: var(--cfh-shadow);
    background: radial-gradient(circle at 15% 20%, rgba(255, 200, 92, 0.28), transparent 26%),
    linear-gradient(135deg, var(--cfh-dark), var(--cfh-secondary) 45%, var(--cfh-primary));
}

.custom-home .cfh-main-swiper,
.custom-home .cfh-hero-slider .swiper {
    width: 100%;
    height: 100%;
    aspect-ratio: 880 / 500;
    overflow: hidden;
    border-radius: inherit;
}

.custom-home .cfh-main-swiper .swiper-wrapper {
    width: 100%;
    height: 100%;
}

.custom-home .cfh-main-swiper .swiper-slide {
    width: 100%;
    height: 100% !important;
}

.custom-home .cfh-hero-slide {
    position: relative;
    width: 100%;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden;
    color: var(--cfh-white);
    border-radius: inherit;
    background: #120d2e;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
    padding: 44px;
}

/* Decorative circle only for text/visual slides */
.custom-home .cfh-hero-slide:not(.cfh-hero-slide-has-bg)::after {
    content: "";
    position: absolute;
    left: -80px;
    bottom: -100px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 200, 92, 0.24);
}

/* Image background slide */
.custom-home .cfh-hero-slide.cfh-hero-slide-has-bg {
    display: block !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden;
    background: #120d2e;
}

.custom-home .cfh-slide-bg-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover;
    object-position: center center;
    border-radius: inherit;
}

.custom-home .cfh-slide-bg-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(
            90deg,
            rgba(10, 8, 30, 0.08) 0%,
            rgba(10, 8, 30, 0.34) 48%,
            rgba(10, 8, 30, 0.70) 100%
    );
}

.custom-home .cfh-slide-content {
    max-width: 540px;
    position: relative;
    z-index: 2;
}

.custom-home .cfh-hero-slide-has-bg .cfh-slide-content {
    position: relative;
    z-index: 2;
    padding: 44px;
    max-width: 540px;
}

.custom-home .cfh-hero-slide-has-bg .cfh-slide-visual {
    display: none !important;
}

.custom-home .cfh-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 13px;
    margin-bottom: 15px;
    color: var(--cfh-white);
}

.custom-home .cfh-badge i {
    width: 17px;
    height: 17px;
}

.custom-home .cfh-hero-slide h1,
.custom-home .cfh-hero-slide h2,
.custom-home .cfh-hero-slide h3,
.custom-home .cfh-hero-slide h4,
.custom-home .cfh-hero-slide h5,
.custom-home .cfh-hero-slide h6 {
    margin: 0 0 14px;
    font-size: 34px;
    line-height: 1.55;
    font-weight: 900;
    color: var(--cfh-white);
}

.custom-home .cfh-hero-slide p {
    margin: 0 0 26px;
    font-size: 16px;
    line-height: 2.1;
    opacity: 0.94;
    color: var(--cfh-white);
}

.custom-home .cfh-slide-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.custom-home .cfh-cta-btn,
.custom-home .cfh-primary-btn {
    min-height: 46px;
    padding: 0 24px;
    border-radius: 14px;
    background: var(--cfh-primary-light);
    color: var(--cfh-dark);
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s ease;
}

.custom-home .cfh-cta-btn:hover,
.custom-home .cfh-primary-btn:hover {
    transform: translateY(-2px);
    background: var(--cfh-white);
    color: var(--cfh-dark);
}

.custom-home .cfh-outline-btn {
    min-height: 46px;
    padding: 0 20px;
    border-radius: 14px;
    color: var(--cfh-white);
    border: 1px solid rgba(255, 255, 255, 0.32);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s ease;
    font-size: 14px;
}

.custom-home .cfh-outline-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--cfh-white);
}

.custom-home .cfh-slide-visual {
    position: relative;
    z-index: 2;
    width: 320px;
    height: 250px;
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.custom-home .cfh-gear-visual {
    width: 176px;
    height: 176px;
    border-radius: 50%;
    border: 26px solid var(--cfh-primary-light);
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    animation: cfhRotateGear 14s linear infinite;
}

.custom-home .cfh-gear-visual::before {
    content: "";
    position: absolute;
    inset: 34px;
    border-radius: 50%;
    background: var(--cfh-dark);
    border: 17px solid var(--cfh-white);
}

.custom-home .cfh-gear-visual::after {
    content: "";
    position: absolute;
    inset: -42px;
    background: linear-gradient(var(--cfh-primary-light), var(--cfh-primary-light)) center top / 34px 44px no-repeat,
    linear-gradient(var(--cfh-primary-light), var(--cfh-primary-light)) center bottom / 34px 44px no-repeat,
    linear-gradient(var(--cfh-primary-light), var(--cfh-primary-light)) left center / 44px 34px no-repeat,
    linear-gradient(var(--cfh-primary-light), var(--cfh-primary-light)) right center / 44px 34px no-repeat;
    border-radius: 50%;
}

@keyframes cfhRotateGear {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Swiper controls */
.custom-home .cfh-hero-slider .swiper-pagination {
    bottom: 22px;
    left: auto;
    right: 44px;
    width: auto;
    display: flex;
    gap: 8px;
}

.custom-home .cfh-hero-slider .swiper-pagination-bullet {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    opacity: 1;
    transition: 0.2s ease;
}

.custom-home .cfh-hero-slider .swiper-pagination-bullet-active {
    width: 26px;
    background: var(--cfh-primary-light);
}

.custom-home .cfh-hero-slider .swiper-button-prev,
.custom-home .cfh-hero-slider .swiper-button-next {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    color: var(--cfh-white);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.custom-home .cfh-hero-slider .swiper-button-prev::after,
.custom-home .cfh-hero-slider .swiper-button-next::after {
    font-size: 16px;
    font-weight: 900;
}

/* =========================================================
   Features
   ========================================================= */

.custom-home .cfh-features {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.custom-home .cfh-feature-card {
    background: var(--cfh-white);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--cfh-shadow);
    display: flex;
    align-items: center;
    gap: 12px;
}

.custom-home .cfh-feature-icon {
    padding: 7px;
    border-radius: 14px;
    background: var(--cfh-soft-orange);
    color: var(--cfh-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.cfh-feature-card svg[data-lucide] {
    width: 32px;
    height: 32px;
}
.custom-home .cfh-feature-card h6 {
    display: block;
    color: var(--cfh-dark);
    font-size: 14px;
    margin: 0 0 4px;
    line-height: 1.7;
    font-family: "body-font" !important;
}

.custom-home .cfh-feature-card p {
    color: var(--cfh-muted);
    font-size: 12px;
    margin: 0;
    line-height: 1.8;
}

/* =========================================================
   Advanced Filter
   ========================================================= */

.custom-home .cfh-advanced-filter {
    background: var(--cfh-white);
    border-radius: 20px;
    padding: 16px;
    margin-top: 20px;
    box-shadow: var(--cfh-shadow);
    border: 1px solid rgba(255, 101, 63, 0.08);
}

.custom-home .cfh-filter-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--cfh-dark);
    font-weight: 800;
    margin-bottom: 14px;
}

.custom-home .cfh-filter-title i {
    color: var(--cfh-primary);
}

.custom-home .cfh-filter-form {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr 1.4fr auto;
    gap: 12px;
    align-items: center;
}

.custom-home .cfh-filter-form input {
    max-width: stretch;
    max-width: -moz-available;
    max-width: -webkit-fill-available;
}

.custom-home .cfh-filter-field {
    position: relative;
}

.custom-home .cfh-filter-field i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cfh-secondary);
    pointer-events: none;
}

.custom-home .cfh-filter-field svg {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cfh-secondary);
    pointer-events: none;
}

.custom-home .cfh-filter-field select,
.custom-home .cfh-filter-field input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--cfh-border);
    border-radius: 14px;
    background: #fafafa;
    color: var(--cfh-text);
    outline: none;
    font-size: 14px;
    padding: 0 44px 0 12px;
    transition: 0.2s ease;
}

.custom-home .cfh-filter-field select {
    appearance: none;
    cursor: pointer;
}

.custom-home .cfh-filter-field select:focus,
.custom-home .cfh-filter-field input:focus {
    border-color: var(--cfh-primary);
    background: var(--cfh-white);
    box-shadow: 0 0 0 4px rgba(255, 101, 63, 0.1);
}

.custom-home .cfh-filter-submit {
    height: 48px;
    border: none;
    border-radius: 14px;
    padding: 0 24px;
    background: var(--cfh-primary);
    color: var(--cfh-white);
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    transition: 0.2s ease;
}

.custom-home .cfh-filter-submit:hover {
    background: var(--cfh-dark);
    transform: translateY(-2px);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1100px) {
    .custom-home .cfh-hero-layer {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .custom-home .cfh-layer-category-title {
        width: 260px;
    }

    .custom-home .cfh-mega-panel {
        right: 280px;
        width: min(620px, calc(100% - 300px));
    }

    .custom-home .cfh-hero-slide h1,
    .custom-home .cfh-hero-slide h2,
    .custom-home .cfh-hero-slide h3 {
        font-size: 29px;
    }

    .custom-home .cfh-slide-visual {
        width: 250px;
    }

    .custom-home .cfh-filter-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .custom-home .cfh-filter-submit {
        grid-column: span 2;
    }
}

@media (max-width: 992px) {
    .custom-home .cfh-layer-category-title {
        display: none;
    }

    .custom-home .cfh-hero-layer {
        display: flex;
        flex-direction: column-reverse; /* معکوس کردن ترتیب عمودی */
        gap: 20px;
    }

    .custom-home .cfh-category-card,
    .custom-home .cfh-category-shortcode .gpc-category-widget-static .gpc-category-card {
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .custom-home .cfh-category-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .custom-home .cfh-category-item + .cfh-category-item {
        border-top: none;
    }

    .custom-home .cfh-mega-panel {
        display: none !important;
    }

    .custom-home .cfh-mobile-mega {
        display: none;
        margin: 8px 0 12px;
        padding: 14px;
        border-radius: 16px;
        background: #fafafa;
        border: 1px solid var(--cfh-border);
    }

    .custom-home .cfh-category-item.is-open .cfh-mobile-mega {
        display: block;
    }

    .custom-home .cfh-mobile-mega h3 {
        margin: 0 0 8px;
        color: var(--cfh-dark);
        font-size: 14px;
    }

    .custom-home .cfh-mobile-mega a {
        display: block;
        color: var(--cfh-muted);
        font-size: 13px;
        padding: 7px 0;
    }

    .custom-home .cfh-hero-slider {
        aspect-ratio: 880 / 500;
        height: auto !important;
        max-height: none !important;
    }

    .custom-home .cfh-hero-slide {
        height: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    .custom-home .cfh-hero-slide:not(.cfh-hero-slide-has-bg) {
        padding: 34px;
    }

    .custom-home .cfh-hero-slide-has-bg {
        padding: 0 !important;
    }

    .custom-home .cfh-hero-slide-has-bg .cfh-slide-content {
        padding: 28px;
    }

    .custom-home .cfh-features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .custom-home .cfh-container {
        width: calc(100% - 24px);
        padding: 14px 0;
    }

    .custom-home .cfh-category-card {
        border-radius: 18px;
        padding: 14px;
    }

    .custom-home .cfh-category-list {
        display: block;
    }

    .custom-home .cfh-category-item + .cfh-category-item {
        border-top: 1px solid #f1f1f1;
    }

    .custom-home .cfh-category-link:hover,
    .custom-home .cfh-category-link:focus,
    .custom-home .cfh-category-item.is-active .cfh-category-link {
        padding-right: 6px;
        padding-left: 6px;
    }

    .custom-home .cfh-hero-slider {
        aspect-ratio: 880 / 500;
        min-height: 210px;
        border-radius: 18px;
    }

    .custom-home .cfh-main-swiper,
    .custom-home .cfh-hero-slider .swiper {
        min-height: 210px;
    }

    .custom-home .cfh-hero-slide {
        height: 100% !important;
        min-height: 210px !important;
        max-height: none !important;
    }

    .custom-home .cfh-hero-slide.cfh-hero-slide-has-bg {
        display: block !important;
        padding: 0 !important;
        flex-direction: initial !important;
        text-align: initial !important;
    }

    .custom-home .cfh-hero-slide:not(.cfh-hero-slide-has-bg) {
        padding: 28px 18px 78px;
        flex-direction: column;
        text-align: center;
    }

    .custom-home .cfh-hero-slide-has-bg .cfh-slide-content {
        padding: 18px;
        max-width: 85%;
    }

    .custom-home .cfh-slide-bg-image {
        object-fit: cover;
        object-position: center center;
    }

    .custom-home .cfh-slide-bg-overlay {
        background: linear-gradient(
                90deg,
                rgba(10, 8, 30, 0.08) 0%,
                rgba(10, 8, 30, 0.25) 45%,
                rgba(10, 8, 30, 0.62) 100%
        );
    }

    .custom-home .cfh-hero-slide h1,
    .custom-home .cfh-hero-slide h2,
    .custom-home .cfh-hero-slide h3,
    .custom-home .cfh-hero-slide h4,
    .custom-home .cfh-hero-slide h5,
    .custom-home .cfh-hero-slide h6 {
        font-size: 23px;
    }

    .custom-home .cfh-hero-slide p {
        font-size: 14px;
        line-height: 2;
    }

    .custom-home .cfh-slide-actions {
        justify-content: center;
    }

    .custom-home .cfh-slide-visual {
        width: 210px;
        height: 170px;
    }

    .custom-home .cfh-gear-visual {
        width: 118px;
        height: 118px;
        border-width: 18px;
    }

    .custom-home .cfh-gear-visual::before {
        inset: 22px;
        border-width: 12px;
    }

    .custom-home .cfh-gear-visual::after {
        inset: -32px;
        background: linear-gradient(var(--cfh-primary-light), var(--cfh-primary-light)) center top / 24px 34px no-repeat,
        linear-gradient(var(--cfh-primary-light), var(--cfh-primary-light)) center bottom / 24px 34px no-repeat,
        linear-gradient(var(--cfh-primary-light), var(--cfh-primary-light)) left center / 34px 24px no-repeat,
        linear-gradient(var(--cfh-primary-light), var(--cfh-primary-light)) right center / 34px 24px no-repeat;
    }

    .custom-home .cfh-hero-slider .swiper-button-prev,
    .custom-home .cfh-hero-slider .swiper-button-next {
        display: none;
    }

    .custom-home .cfh-hero-slider .swiper-pagination {
        right: 50%;
        transform: translateX(50%);
        bottom: 14px;
    }

    .custom-home .cfh-features {
        grid-template-columns: 1fr;
    }

    .custom-home .cfh-advanced-filter {
        border-radius: 16px;
        padding: 14px;
    }

    .custom-home .cfh-filter-form {
        grid-template-columns: 1fr;
    }

    .custom-home .cfh-filter-submit {
        grid-column: auto;
        width: 100%;
    }
}

/* =========================================================
   Slider Dynamic Colors + Animations
   ========================================================= */

.custom-home .cfh-hero-slide .cfh-badge {
    color: var(--slide-badge-color, #ffc85c);
    border-color: color-mix(in srgb, var(--slide-badge-color, #ffc85c) 45%, transparent);
}

.custom-home .cfh-hero-slide .cfh-badge i {
    color: var(--slide-badge-color, #ffc85c);
}

.custom-home .cfh-hero-slide h1,
.custom-home .cfh-hero-slide h2,
.custom-home .cfh-hero-slide h3,
.custom-home .cfh-hero-slide h4,
.custom-home .cfh-hero-slide h5,
.custom-home .cfh-hero-slide h6 {
    color: var(--slide-title-color, #ffffff);
}

.custom-home .cfh-hero-slide p {
    color: var(--slide-description-color, #ffffff);
}

.custom-home .cfh-cta-btn,
.custom-home .cfh-primary-btn,
.custom-home .cfh-outline-btn {
    animation: cfhButtonFadeUp 0.75s ease both;
    animation-delay: 0.42s;
}

.custom-home .cfh-cta-btn,
.custom-home .cfh-primary-btn {
    background: var(--button-bg-color, var(--cfh-primary-light));
    color: var(--button-text-color, var(--cfh-dark));
}

.custom-home .cfh-outline-btn {
    color: var(--button-text-color, #ffffff);
    border-color: var(--button-bg-color, rgba(255, 255, 255, 0.32));
}

.custom-home .cfh-outline-btn:hover,
.custom-home .cfh-cta-btn:hover,
.custom-home .cfh-primary-btn:hover {
    filter: brightness(1.08);
}

/* Text animations */
.custom-home .swiper-slide-active .cfh-badge {
    animation: cfhBadgeFadeDown 0.65s ease both;
}

.custom-home .swiper-slide-active .cfh-slide-content h1,
.custom-home .swiper-slide-active .cfh-slide-content h2,
.custom-home .swiper-slide-active .cfh-slide-content h3,
.custom-home .swiper-slide-active .cfh-slide-content h4,
.custom-home .swiper-slide-active .cfh-slide-content h5,
.custom-home .swiper-slide-active .cfh-slide-content h6 {
    animation: cfhTitleFadeUp 0.75s ease both;
    animation-delay: 0.12s;
}

.custom-home .swiper-slide-active .cfh-slide-content p {
    animation: cfhTextFadeUp 0.75s ease both;
    animation-delay: 0.26s;
}

.custom-home .swiper-slide-active .cfh-slide-actions {
    animation: cfhActionsFadeUp 0.75s ease both;
    animation-delay: 0.40s;
}

@keyframes cfhBadgeFadeDown {
    from {
        opacity: 0;
        transform: translateY(-14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cfhTitleFadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes cfhTextFadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 0.94;
        transform: translateY(0);
    }
}

@keyframes cfhActionsFadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cfhButtonFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Respect accessibility */
@media (prefers-reduced-motion: reduce) {
    .custom-home .cfh-badge,
    .custom-home .cfh-slide-content h1,
    .custom-home .cfh-slide-content h2,
    .custom-home .cfh-slide-content h3,
    .custom-home .cfh-slide-content h4,
    .custom-home .cfh-slide-content h5,
    .custom-home .cfh-slide-content h6,
    .custom-home .cfh-slide-content p,
    .custom-home .cfh-slide-actions,
    .custom-home .cfh-cta-btn,
    .custom-home .cfh-primary-btn,
    .custom-home .cfh-outline-btn {
        animation: none !important;
        transition: none !important;
    }
}
.wd-fill{
    inset: unset !important;
}
/* =========================================================
   Special Sale Row
   ========================================================= */
.custom-home .cfh-special-sale {
    margin-top: 28px;
}

.custom-home .cfh-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.custom-home .cfh-section-head__title h2 {
    margin: 6px 0 0;
    font-size: 28px;
    color: var(--cfh-dark);
}

.custom-home .cfh-section-kicker {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--cfh-soft-orange);
    color: var(--cfh-primary);
    font-size: 13px;
    font-weight: 800;
}

.custom-home .cfh-section-head__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--cfh-primary);
    font-weight: 700;
}

.custom-home .cfh-special-sale-grid {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
}

.custom-home .cfh-sale-cover {
    position: relative;
    overflow: hidden;
    min-height: 420px;
    padding: 28px;
    border-radius: var(--cfh-radius);
    background: linear-gradient(160deg, var(--cfh-dark), #34205f 60%, #ff7a49 140%);
    color: #fff;
    box-shadow: var(--cfh-shadow-strong);
    display: flex;
    flex-direction: column;
}

.custom-home .cfh-sale-cover::before {
    content: "";
    position: absolute;
    left: -30px;
    bottom: -30px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,200,92,.30) 0%, rgba(255,200,92,0) 72%);
}

.custom-home .cfh-sale-cover__badge {
    position: relative;
    z-index: 1;
    display: inline-flex;
    width: max-content;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.18);
    font-size: 12px;
    font-weight: 700;
    color: var(--cfh-primary-light);
}

.custom-home .cfh-sale-cover h3 {
    position: relative;
    z-index: 1;
    margin: 20px 0 10px;
    font-size: 30px;
    line-height: 1.6;
    color: #fff;
}

.custom-home .cfh-sale-cover p {
    position: relative;
    z-index: 1;
    margin: 0 0 22px;
    color: rgba(255,255,255,.84);
    line-height: 2;
    font-size: 14px;
}

.custom-home .cfh-sale-cover__list {
    position: relative;
    z-index: 1;
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: grid;
    gap: 12px;
}

.custom-home .cfh-sale-cover__list li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-home .cfh-sale-cover__list svg {
    width: 18px;
    height: 18px;
    color: var(--cfh-primary-light);
}

.custom-home .cfh-sale-cover__btn {
    position: relative;
    z-index: 1;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--cfh-primary), var(--cfh-primary-light));
    color: var(--cfh-dark);
    font-weight: 800;
}

.custom-home .cfh-sale-cover__ghost {
    position: absolute;
    left: 18px;
    bottom: -4px;
    font-size: 64px;
    font-weight: 900;
    line-height: 1;
    color: rgba(255,255,255,.08);
    letter-spacing: 6px;
}

.custom-home .cfh-sale-slider-wrap {
    position: relative;
    overflow: hidden;
    background: var(--cfh-white);
    padding: 20px;
    border-radius: var(--cfh-radius);
    box-shadow: var(--cfh-shadow);
    min-width: 0;
}

.custom-home .cfh-sale-slider-nav {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 5;
    display: flex;
    gap: 10px;
}

.custom-home .cfh-sale-slider-nav button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    background: var(--cfh-soft-orange);
    color: var(--cfh-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(255,101,63,.16);
}

.custom-home .cfh-sale-products-swiper {
    padding-top: 52px;
}

.custom-home .cfh-sale-products-swiper .products {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}

.custom-home .cfh-sale-products-swiper .product {
    height: auto;
    margin: 0 !important;
}

/* فقط title و cover شخصی سازی شده */
.custom-home .cfh-sale-products-swiper .product .woocommerce-loop-product__title,
.custom-home .cfh-sale-products-swiper .product .wd-entities-title,
.custom-home .cfh-sale-products-swiper .product .product-title {
    font-size: 15px;
    line-height: 1.9;
    min-height: 58px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.custom-home .cfh-sale-products-swiper .product .product-element-top,
.custom-home .cfh-sale-products-swiper .product .thumbnail-wrapper,
.custom-home .cfh-sale-products-swiper .product .product-image-link,
.custom-home .cfh-sale-products-swiper .product .wd-product-img {
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, #fff8f4, #ffffff);
}

.custom-home .cfh-sale-products-swiper .product .product-element-top img,
.custom-home .cfh-sale-products-swiper .product .thumbnail-wrapper img,
.custom-home .cfh-sale-products-swiper .product .product-image-link img,
.custom-home .cfh-sale-products-swiper .product .wd-product-img img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

@media (max-width: 992px) {
    .custom-home .cfh-special-sale-grid {
        grid-template-columns: 1fr;
    }

    .custom-home .cfh-sale-cover {
        min-height: auto;
    }
}

@media (max-width: 640px) {
    /*.custom-home .cfh-section-head {*/
    /*    flex-direction: column;*/
    /*    align-items: flex-start;*/
    /*}*/

    .custom-home .cfh-section-head__title h2 {
        font-size: 22px;
    }

    .custom-home .cfh-sale-cover h3 {
        font-size: 24px;
    }

    .custom-home .cfh-sale-slider-wrap {
        padding: 16px;
    }

    .custom-home .cfh-sale-slider-nav {
        top: 14px;
        left: 14px;
    }

    .custom-home .cfh-sale-slider-nav button {
        width: 38px;
        height: 38px;
    }
}