/* Target the ACTUAL classes from your HTML */
.fe-filters-sorting-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 20px !important;
    padding: 10px 0 !important;
}

/* Left side - filters */
.fe-filters-box {
    flex: 1 !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
}

/* Right side - sorting */
.fe-sorting-box {
    flex: 0 0 auto !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
}

/* Force WPC filter widget to be inline */
.fe-filters-box .widget_wpc_filters_widget {
    display: inline-block !important;
    width: auto !important;
    margin: 0 !important;
}

/* WPC filter main wrapper - make inline */
.fe-filters-box .wpc-filters-main-wrap {
    display: inline-block !important;
    width: auto !important;
    margin: 0 !important;
}

/* WPC filter button container - make inline */
.fe-filters-box .wpc-filters-open-button-container {
    display: inline-block !important;
    width: auto !important;
    margin: 0 !important;
}

/* Keep existing button styles - just make it inline */
.fe-filters-box .wpc-filters-open-widget {
    display: inline-block !important;
    width: auto !important;
}

/* Sort content styling */
.fe-sorting-box .widget_wpc_sorting_widget {
    display: inline-block !important;
    margin: 0 !important;
    width: auto !important;
}

.fe-sorting-box .wpc-sorting-form {
    display: inline-block !important;
    margin: 0 !important;
}

.fe-sorting-box select {
    display: inline-block !important;
    width: auto !important;
}

/* HIDE the duplicate filter button that appears outside the row */
.wpc-filters-open-button-container:not(.fe-filters-box .wpc-filters-open-button-container) {
    display: none !important;
}


/* ==========================================================================
   Category Description After Pagination with Read More
   ========================================================================== */
.qf-category-description-bottom {
    margin: 40px auto 0;
    padding: 30px;
    max-width: 1200px;
    background: #f8faf9;
    border-left: 4px solid #2d5a4d;
    border-radius: 8px;
    position: relative;
}

/* Content Container */
.qf-cat-desc-content {
    color: #334155;
    font-size: 16px;
    line-height: 1.7;
    max-height: 200px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gradient overlay when collapsed */
.qf-cat-desc-content[data-collapsed="true"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, 
        rgba(248, 250, 249, 0) 0%, 
        rgba(248, 250, 249, 0.8) 50%, 
        rgba(248, 250, 249, 1) 100%
    );
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.qf-cat-desc-content[data-collapsed="false"]::after {
    opacity: 0;
}

/* Remove gradient if content doesn't need collapsing */
.qf-cat-desc-content.qf-no-collapse::after {
    display: none;
}

/* Read More Button */
.qf-read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 12px 24px;
    background: #2d5a4d;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.qf-read-more-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.qf-read-more-btn:hover::before {
    width: 300px;
    height: 300px;
}

.qf-read-more-btn:hover {
    background: #1e3d34;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 90, 77, 0.3);
}

.qf-read-more-btn:active {
    transform: translateY(0);
}

/* Button text states */
.qf-btn-text-more,
.qf-btn-text-less {
    position: relative;
    z-index: 1;
}

.qf-read-more-btn .qf-btn-text-less {
    display: none;
}

.qf-read-more-btn[aria-expanded="true"] .qf-btn-text-more {
    display: none;
}

.qf-read-more-btn[aria-expanded="true"] .qf-btn-text-less {
    display: inline;
}

/* Chevron icon */
.qf-chevron {
    position: relative;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.qf-read-more-btn[aria-expanded="true"] .qf-chevron {
    transform: rotate(180deg);
}

/* Typography */
.qf-cat-desc-content h2,
.qf-cat-desc-content h3 {
    color: #1e293b;
    margin: 0 0 15px;
    font-weight: 600;
    line-height: 1.3;
}

.qf-cat-desc-content h2 { font-size: 26px; }
.qf-cat-desc-content h3 { font-size: 22px; }

.qf-cat-desc-content p {
    margin: 0 0 18px;
}

.qf-cat-desc-content p:last-child {
    margin-bottom: 0;
}

/* Links */
.qf-cat-desc-content a {
    color: #2d5a4d;
    text-decoration: underline;
    text-decoration-color: rgba(45, 90, 77, 0.3);
    transition: color 0.2s ease;
}

.qf-cat-desc-content a:hover {
    color: #1e3d34;
}

/* Lists */
.qf-cat-desc-content ul,
.qf-cat-desc-content ol {
    margin: 0 0 18px;
    padding-left: 25px;
}

.qf-cat-desc-content li {
    margin-bottom: 8px;
}

/* Bold text */
.qf-cat-desc-content strong {
    color: #1e293b;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .qf-category-description-bottom {
        margin: 30px 15px 0;
        padding: 25px 20px;
    }

    .qf-cat-desc-content {
        font-size: 15px;
        max-height: 180px;
    }

    .qf-cat-desc-content h2 { font-size: 22px; }
    .qf-cat-desc-content h3 { font-size: 20px; }

    .qf-read-more-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .qf-category-description-bottom {
        margin: 25px 10px 0;
        padding: 20px 16px;
        border-left-width: 3px;
    }

    .qf-cat-desc-content {
        font-size: 14px;
        max-height: 160px;
    }

    .qf-cat-desc-content h2 { font-size: 20px; }
    .qf-cat-desc-content h3 { font-size: 18px; }

    .qf-read-more-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
}


/* ================================
   HIDE BREADCRUMB & HEADER ON VALENTINE'S PAGES
   ================================ */
.term-valentines-day-bundles .woocommerce-breadcrumb,
.term-valentines-day-flowers .woocommerce-breadcrumb,
.term-just-roses .woocommerce-breadcrumb {
    display: none;
}

.term-valentines-day-bundles .woocommerce-products-header,
.term-valentines-day-flowers .woocommerce-products-header,
.term-just-roses .woocommerce-products-header {
    display: none;
}

/* ================================
   REORDER: CARDS BEFORE FILTERS
   Using flexbox on parent container
   ================================ */
.term-valentines-day-bundles .site-main,
.term-valentines-day-flowers .site-main,
.term-just-roses .site-main {
    display: flex;
    flex-direction: column;
}

/* Cards come first */
.quinn-val-category-nav {
    order: -2;
}

/* Filters come second */
.fe-filters-sorting-row {
    order: -1;
}

/* Products stay in normal order */
.products {
    order: 0;
}

/* Pagination stays last */
.woocommerce-pagination {
    order: 1;
}

/* ================================
   VALENTINE'S CATEGORY NAVIGATION CARDS
   ================================ */
.quinn-val-category-nav {
    margin: 0 0 24px 0;
    padding: 0;
    width: 100%;
}

.val-nav-header {
    margin-bottom: 16px;
}

.val-nav-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.val-nav-header h3::before {
    content: '♥';
    color: #dc143c;
    font-size: 1.1em;
}

/* Cards Container */
.val-nav-cards {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 16px 0;
}

.val-nav-cards::-webkit-scrollbar {
    height: 6px;
}

.val-nav-cards::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.val-nav-cards::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.val-nav-cards::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Individual Card */
.val-nav-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 260px;
    max-width: 300px;
    flex: 1;
    padding: 14px;
    background: #fff;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.05);
    scroll-snap-align: start;
}

.val-nav-card:hover {
    box-shadow: 0 4px 20px rgba(185,28,60,0.12);
    transform: translateY(-3px);
    border-color: rgba(185,28,60,0.15);
}

/* Card Image */
.val-nav-card-img {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #f9f9f9;
}

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

.val-nav-card:hover .val-nav-card-img img {
    transform: scale(1.08);
}

/* Card Info */
.val-nav-card-info {
    flex: 1;
    min-width: 0;
}

.val-nav-card-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.val-nav-card-info p {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #888;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.val-nav-link {
    font-size: 12px;
    font-weight: 600;
    color: #b91c3c;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.val-nav-link::after {
    content: '→';
    transition: transform 0.25s ease;
    font-size: 14px;
}

.val-nav-card:hover .val-nav-link::after {
    transform: translateX(4px);
}

.val-nav-card:hover .val-nav-link {
    color: #dc143c;
}

/* View All Card - Special Styling */
.val-nav-card-all {
    background: linear-gradient(135deg, #fef5f6 0%, #fff5f5 100%);
    border-color: rgba(185,28,60,0.1);
}

.val-nav-card-all:hover {
    background: linear-gradient(135deg, #fdeef0 0%, #fff0f0 100%);
}

/* ================================
   RESPONSIVE: DESKTOP (768px+)
   ================================ */
@media (min-width: 768px) {
    .val-nav-cards {
        flex-wrap: nowrap;
        overflow-x: visible;
    }

    .val-nav-card {
        min-width: 0;
        max-width: none;
    }
}

/* ================================
   RESPONSIVE: MOBILE (below 768px)
   ================================ */
@media (max-width: 767px) {
    .quinn-val-category-nav {
        margin: 0 -15px 20px -15px;
        padding: 0 15px;
    }

    .val-nav-header h3 {
        font-size: 18px;
    }

    .val-nav-card {
        min-width: 220px;
        padding: 12px;
        gap: 12px;
    }

    .val-nav-card-img {
        width: 60px;
        height: 60px;
    }

    .val-nav-card-info h4 {
        font-size: 13px;
    }

    .val-nav-card-info p {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .val-nav-link {
        font-size: 11px;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .val-nav-card:hover {
        transform: none;
    }
}
