/**
 * SnusBlast Category Description Styles
 *
 * Extracted from inline styles in snusblast-category-description.php
 * Version: 1.0.0
 */

/* ==========================================================================
   Page Header & Navigation Fixes (from hide_category_banners)
   ========================================================================== */

/* Note: .page-header hiding moved to child theme style.css (global) */

/* Hide pagination (replaced by Load More button) */
nav.navigation,
nav#nav-below,
nav.woocommerce-pagination {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Navigation z-index fixes */
.site-header,
.main-navigation,
.main-navigation ul,
.main-navigation ul ul,
.main-navigation .sub-menu,
.main-navigation .children,
header,
header nav,
header ul,
header .dropdown,
header .dropdown-menu,
.navbar,
.navbar-nav,
.navbar .dropdown-menu {
    z-index: 9999 !important;
}

.menu-item:hover > .sub-menu,
.menu-item:hover > .children,
.dropdown:hover > .dropdown-menu,
nav li:hover > ul {
    z-index: 99999 !important;
}

/* Product grid styling */
ul.products {
    min-height: 300px;
    transition: min-height 0.3s ease;
}

ul.products.loading {
    position: relative;
}

.load-more-products-btn:disabled {
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

/* ==========================================================================
   Category Description Box (from add_styles_and_scripts)
   ========================================================================== */

.category-description-bottom-box-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 15px;
    display: block !important;
    visibility: visible !important;
    position: relative;
    z-index: 1 !important;
}

.category-description-bottom-box {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 1 !important;
}

/* Description Header */
.category-description-bottom-box .description-header {
    background-color: #239DC2 !important;
    color: white !important;
    padding: 12px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border: none !important;
}

/* Description Content */
.category-description-bottom-box .description-content-wrapper {
    padding: 30px !important;
    background: #ffffff !important;
}

.category-description-bottom-box .description-content {
    position: relative;
}

.category-description-bottom-box .description-text {
    font-size: 16px !important;
    line-height: 1.7 !important;
    color: #111 !important;
    margin-bottom: 0;
    transition: max-height 0.3s ease;
}

/* Read More collapsed state */
.category-description-bottom-box .description-text.has-read-more {
    max-height: 150px;
    overflow: hidden;
    position: relative;
}

.category-description-bottom-box .description-text.has-read-more::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.9), white);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Read More expanded state */
.category-description-bottom-box .description-text.has-read-more.expanded {
    max-height: none;
}

.category-description-bottom-box .description-text.has-read-more.expanded::after {
    opacity: 0;
    height: 0;
}

/* Read More Toggle Button */
.category-description-bottom-box .read-more-toggle {
    background: none !important;
    border: none !important;
    color: #239DC2 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    padding: 12px 0 !important;
    margin-top: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: color 0.3s ease !important;
    outline-offset: 2px !important;
}

.category-description-bottom-box .read-more-toggle:hover {
    color: #1a7a96 !important;
}

.category-description-bottom-box .read-more-toggle .toggle-arrow {
    display: inline-block !important;
    transition: transform 0.3s ease !important;
    font-size: 14px !important;
    line-height: 1 !important;
}

.category-description-bottom-box .read-more-toggle[data-expanded="true"] .toggle-arrow {
    transform: rotate(180deg) !important;
}

/* ==========================================================================
   FAQ Section (Category Pages)
   ========================================================================== */

.category-description-bottom-box .faq-schema {
    margin-top: 30px;
    border-top: 1px solid #e0e0e0;
    padding-top: 30px;
}

.category-description-bottom-box .faq-item {
    margin-bottom: 20px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.category-description-bottom-box .faq-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.category-description-bottom-box .faq-question {
    background: #f8f9fa !important;
    color: #111 !important;
    margin: 0 !important;
    padding: 16px 20px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    transition: background-color 0.3s ease !important;
    border: none !important;
    line-height: 1.4 !important;
}

.category-description-bottom-box .faq-question:hover {
    background: #e9ecef !important;
}

.category-description-bottom-box .faq-question::after {
    content: "▼";
    font-size: 14px;
    color: #239DC2;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.category-description-bottom-box .faq-item.active .faq-question::after {
    transform: rotate(180deg);
}

.category-description-bottom-box .faq-answer {
    padding: 0 20px !important;
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.4s ease, padding 0.4s ease !important;
    background: white !important;
    margin: 0 !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    color: #111 !important;
}

.category-description-bottom-box .faq-item.active .faq-answer {
    max-height: 200px !important;
    padding: 16px 20px 20px 20px !important;
}

/* ==========================================================================
   Load More Products Button
   ========================================================================== */

.load-more-products-container {
    text-align: center;
    margin: 40px auto;
    padding: 20px;
}

.load-more-products-btn {
    background: #239DC2 !important;
    color: white !important;
    padding: 12px 40px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
}

.load-more-products-btn:hover {
    background: #1a7a96 !important;
}

.load-more-products-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.loading-spinner {
    margin: 20px 0;
    color: #239DC2;
    font-size: 16px;
    display: none;
}

/* ==========================================================================
   FAQ Shortcode Styles (for non-category pages)
   ========================================================================== */

.faq-schema {
    margin-top: 30px;
    border-top: 1px solid #e0e0e0;
    padding-top: 30px;
}

.faq-item {
    margin-bottom: 20px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.faq-question {
    background: #f8f9fa;
    color: #111;
    margin: 0;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.3s ease;
    border: none;
    line-height: 1.4;
}

.faq-question:hover {
    background: #e9ecef;
}

.faq-question::after {
    content: "▼";
    font-size: 14px;
    color: #239DC2;
    transition: transform 0.3s ease;
    margin-left: 10px;
}

.faq-item.active .faq-question::after {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background: #fff;
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #111;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding: 16px 20px 20px;
}

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

@media (max-width: 767px) {
    .category-description-bottom-box-wrapper {
        max-width: 100%;
        margin: 20px auto;
    }

    .category-description-bottom-box .description-header {
        padding: 10px 20px !important;
        font-size: 14px !important;
    }

    .category-description-bottom-box .description-content-wrapper {
        padding: 20px !important;
    }

    .category-description-bottom-box .description-text {
        font-size: 15px !important;
    }

    .category-description-bottom-box .description-text.has-read-more {
        max-height: 120px;
    }

    .category-description-bottom-box .read-more-toggle {
        font-size: 15px !important;
        padding: 10px 0 !important;
        margin-top: 15px !important;
    }

    .category-description-bottom-box .faq-question {
        padding: 14px 16px !important;
        font-size: 15px !important;
    }

    .category-description-bottom-box .faq-item.active .faq-answer {
        padding: 14px 16px 18px 16px !important;
    }

    .load-more-products-btn {
        padding: 10px 30px !important;
        font-size: 15px !important;
    }

    /* FAQ Shortcode responsive */
    .faq-question {
        padding: 14px 16px;
        font-size: 15px;
    }

    .faq-item.active .faq-answer {
        padding: 14px 16px 18px;
    }
}
