/**
 * Category Banner Styles
 *
 * Professional, SEO-optimized banner for WooCommerce category pages
 *
 * @package Xpert_Energy
 * @since 2.0.0
 */

/* ==========================================================================
   Banner Container
   ========================================================================== */

.xpertenergy-category-banner {
    position: relative;
    width: 100%;
    min-height: 400px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 50px;
    overflow: hidden;
}

/* Fallback gradient if no image - now handled by PHP with dynamic colors */
.xpertenergy-category-banner.no-image {
    /* Background color set via inline style from PHP */
}

/* Dark overlay for text readability */
.xpertenergy-banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* Content container */
.xpertenergy-banner-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    width: 100%;
    padding: 60px 20px;
    text-align: center;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.xpertenergy-breadcrumbs {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 25px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.xpertenergy-breadcrumbs ol {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

.xpertenergy-breadcrumbs li {
    display: inline-block;
    margin: 0;
    padding: 0;
}

.xpertenergy-breadcrumbs a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 3px;
}

.xpertenergy-breadcrumbs a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.xpertenergy-breadcrumbs .separator {
    margin: 0 8px;
    opacity: 0.6;
    font-weight: 300;
}

.xpertenergy-breadcrumbs .active {
    color: #fff;
    font-weight: 600;
}

/* ==========================================================================
   Category Title (H1)
   ========================================================================== */

.xpertenergy-category-title {
    font-size: 48px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin: 20px 0 25px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

/* ==========================================================================
   Category Description
   ========================================================================== */

.xpertenergy-category-description {
    font-size: 18px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.xpertenergy-category-description p {
    margin: 0 0 15px;
}

.xpertenergy-category-description p:last-child {
    margin-bottom: 0;
}

.xpertenergy-category-description a {
    color: #fff;
    text-decoration: underline;
    transition: opacity 0.3s ease;
}

.xpertenergy-category-description a:hover {
    opacity: 0.8;
}

/* ==========================================================================
   Responsive Design - Tablet
   ========================================================================== */

@media screen and (max-width: 1199px) {
    .xpertenergy-category-banner {
        min-height: 350px;
    }

    .xpertenergy-banner-content {
        padding: 50px 20px;
    }

    .xpertenergy-category-title {
        font-size: 40px;
    }

    .xpertenergy-category-description {
        font-size: 17px;
        max-width: 90%;
    }
}

@media screen and (max-width: 991px) {
    .xpertenergy-category-banner {
        min-height: 320px;
    }

    .xpertenergy-category-title {
        font-size: 38px;
    }
}

/* ==========================================================================
   Responsive Design - Mobile
   ========================================================================== */

@media screen and (max-width: 768px) {
    .xpertenergy-category-banner {
        min-height: 300px;
        margin-bottom: 40px;
    }

    .xpertenergy-banner-content {
        padding: 40px 15px;
    }

    .xpertenergy-breadcrumbs {
        font-size: 12px;
        letter-spacing: 0.5px;
        margin-bottom: 20px;
    }

    .xpertenergy-breadcrumbs .separator {
        margin: 0 6px;
    }

    .xpertenergy-category-title {
        font-size: 36px;
        margin: 15px 0 20px;
        letter-spacing: -0.3px;
    }

    .xpertenergy-category-description {
        font-size: 16px;
        line-height: 1.6;
        max-width: 95%;
        padding: 0 10px;
    }

    .xpertenergy-category-description p {
        margin-bottom: 12px;
    }
}

/* ==========================================================================
   Responsive Design - Small Mobile
   ========================================================================== */

@media screen and (max-width: 480px) {
    .xpertenergy-category-banner {
        min-height: 250px;
        margin-bottom: 30px;
    }

    .xpertenergy-banner-content {
        padding: 30px 15px;
    }

    .xpertenergy-breadcrumbs {
        font-size: 11px;
        margin-bottom: 15px;
    }

    .xpertenergy-breadcrumbs ol {
        justify-content: center;
    }

    .xpertenergy-breadcrumbs .separator {
        margin: 0 4px;
    }

    .xpertenergy-category-title {
        font-size: 28px;
        margin: 12px 0 15px;
        letter-spacing: 0;
    }

    .xpertenergy-category-description {
        font-size: 14px;
        line-height: 1.5;
        padding: 0 5px;
    }

    .xpertenergy-category-description p {
        margin-bottom: 10px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .xpertenergy-category-banner {
        min-height: auto;
        page-break-inside: avoid;
    }

    .xpertenergy-banner-overlay {
        display: none;
    }

    .xpertenergy-breadcrumbs,
    .xpertenergy-category-title,
    .xpertenergy-category-description {
        color: #000 !important;
        text-shadow: none !important;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/* Focus states for keyboard navigation */
.xpertenergy-breadcrumbs a:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
    background: rgba(255, 255, 255, 0.2);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .xpertenergy-banner-overlay {
        background: rgba(0, 0, 0, 0.7);
    }

    .xpertenergy-category-title,
    .xpertenergy-breadcrumbs,
    .xpertenergy-category-description {
        text-shadow: 0 3px 10px rgba(0, 0, 0, 0.8);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .xpertenergy-breadcrumbs a {
        transition: none;
    }
}

/* ==========================================================================
   Dark Mode Support (Optional)
   ========================================================================== */

/* Dark mode handled by dynamic colors set in Theme Options */

/* ==========================================================================
   Animation (Optional Enhancement)
   ========================================================================== */

@keyframes xpertenergy-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth entry animation */
.xpertenergy-banner-content > * {
    animation: xpertenergy-fade-in-up 0.6s ease-out backwards;
}

.xpertenergy-breadcrumbs {
    animation-delay: 0.1s;
}

.xpertenergy-category-title {
    animation-delay: 0.2s;
}

.xpertenergy-category-description {
    animation-delay: 0.3s;
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .xpertenergy-banner-content > * {
        animation: none;
    }
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

[dir="rtl"] .xpertenergy-breadcrumbs ol {
    direction: rtl;
}

[dir="rtl"] .xpertenergy-breadcrumbs .separator {
    transform: scaleX(-1);
}

/* ==========================================================================
   Performance Optimizations
   ========================================================================== */

/* GPU acceleration for smoother animations */
.xpertenergy-banner-content {
    transform: translateZ(0);
    will-change: transform;
}

/* Optimize background image rendering */
.xpertenergy-category-banner {
    background-attachment: scroll; /* Better performance than fixed on mobile */
}

/* ==========================================================================
   Browser-Specific Fixes
   ========================================================================== */

/* Safari background image fix */
@supports (-webkit-appearance: none) {
    .xpertenergy-category-banner {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}

/* Edge background position fix */
@supports (-ms-ime-align: auto) {
    .xpertenergy-category-banner {
        background-attachment: scroll;
    }
}
