/* ====================================================================
   BullDesign Frontend - Professional Modern Design
   Responsive layout that works on all devices with Finnish UI
   ULTRA HIGH SPECIFICITY TO OVERRIDE ALL THEME STYLES
   ================================================================== */

/* SIMPLE FULL WIDTH CENTERING - NO COMPLEX POSITIONING */
.bulldesign-schools-directory,
.bulldesign-category-page,
.bulldesign-school-store {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    position: relative !important;
    box-sizing: border-box !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}

/* ====================================================================
   GLOBAL RESET AND BASE STYLES
   ================================================================== */

/* REMOVED GLOBAL * SELECTOR TO AVOID AFFECTING HEADER */

/* SIMPLIFIED CENTERING - REMOVE PROBLEMATIC POSITIONING */
.bulldesign-schools-directory,
.bulldesign-category-page,
.bulldesign-school-store {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    line-height: 1.6 !important;
    color: #2c3e50 !important;
    margin: 0 auto !important;
    padding: 40px 10px !important;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important;
    min-height: 80vh !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    text-align: center !important;
}

/* ====================================================================
   CONTAINERS AND LAYOUT
   ================================================================== */

/* ONLY TARGET BULLDESIGN CONTAINERS */
.bulldesign-schools-directory .container,
.bulldesign-category-page .container,
.bulldesign-school-store .container {
    max-width: 1800px !important;
    margin: 0 auto !important;
    padding: 0 1% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
    text-align: center !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}

/* ====================================================================
   MAIN PAGE HEADERS
   ================================================================== */

body .bulldesign-schools-directory h1,
body .bulldesign-category-page h1,
.bulldesign-schools-directory h1,
.bulldesign-category-page h1 {
    font-size: clamp(28px, 5vw, 48px) !important;
    font-weight: 800 !important;
    text-align: center !important;
    margin: 0 0 60px 0 !important;
    margin-bottom: 60px !important;
    color: #2c3e50;
    position: relative;
    padding: 20px 0 35px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bulldesign-schools-directory h1::after,
.bulldesign-category-page h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* ====================================================================
   CATEGORY SECTIONS
   ================================================================== */

.category-section {
    margin-bottom: 80px;
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    padding: 50px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

/* Extra spacing for first category on main page */
.bulldesign-schools-directory .category-section:first-of-type {
    margin-top: 60px;
}

.category-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.bulldesign-category-page .category-section h2,
.bulldesign-schools-directory .category-section h2,
.category-section h2 {
    font-size: clamp(24px, 4vw, 36px) !important;
    font-weight: 700 !important;
    margin-bottom: 80px !important;
    text-align: center !important;
    position: relative !important;
    padding: 15px 0 35px 0 !important;
}

.category-section h2 a {
    color: #2c3e50;
    text-decoration: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.3s ease;
    position: relative;
}

.category-section h2 a:hover {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transform: translateY(-2px);
}

.category-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* ====================================================================
   SCHOOLS GRID - RESPONSIVE FLEXBOX LAYOUT (HIGH SPECIFICITY)
   ================================================================== */

.bulldesign-schools-directory .schools-grid,
.bulldesign-category-page .schools-grid,
.schools-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
}

.bulldesign-schools-directory .schools-grid .school-card,
.bulldesign-category-page .schools-grid .school-card,
.schools-grid .school-card {
    flex: 1 1 280px !important;
    max-width: 400px !important;
    min-width: 250px !important;
}

/* Reduced spacing for category page schools grid */
body .bulldesign-category-page .schools-grid,
.bulldesign-category-page .schools-grid {
    margin-top: 20px !important;
    padding-top: 0px !important;
}

/* Removed problematic visual separator */

/* Responsive width control - REMOVE ALL HTML BODY SELECTORS */
@media (min-width: 1200px) {
    .bulldesign-schools-directory .schools-grid,
    .bulldesign-category-page .schools-grid,
    .schools-grid {
        width: 98% !important;
        max-width: 1600px !important;
        margin: 0 auto !important;
        left: auto !important;
        right: auto !important;
        position: relative !important;
    }
}

@media (max-width: 1199px) and (min-width: 768px) {
    .bulldesign-schools-directory .schools-grid,
    .bulldesign-category-page .schools-grid,
    .schools-grid {
        width: 95% !important;
        max-width: 1400px !important;
        margin: 0 auto !important;
        left: auto !important;
        right: auto !important;
        position: relative !important;
    }
}

@media (max-width: 767px) {
    .bulldesign-schools-directory .schools-grid,
    .bulldesign-category-page .schools-grid,
    .schools-grid {
        width: 95% !important;
        max-width: 800px !important;
        margin: 0 auto !important;
        left: auto !important;
        right: auto !important;
        position: relative !important;
    }
}

/* ====================================================================
   SCHOOL CARDS - MODERN DESIGN
   ================================================================== */

.bulldesign-schools-directory .school-card,
.bulldesign-category-page .school-card,
.school-card {
    display: block !important;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%) !important;
    border-radius: 24px !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    text-decoration: none !important;
    color: inherit !important;
    position: relative !important;
    border: 2px solid rgba(255, 255, 255, 0.9) !important;
}

.school-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    color: inherit;
}

.school-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.school-card:hover::before {
    opacity: 1;
}

.school-image {
    width: 100%;
    height: 320px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
}

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

.school-card:hover .school-image img {
    transform: scale(1.1);
}

.school-info {
    padding: 30px 25px;
    text-align: center;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
}

.school-info h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    text-shadow: 0 2px 4px rgba(0,0,0,0.08);
    line-height: 1.3;
}

/* ====================================================================
   SCHOOL STORE PAGE - BANNER AND HEADER
   ================================================================== */

.bulldesign-school-store {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important;
    padding: 40px 0 !important;
    min-height: 80vh !important;
}

.bulldesign-school-store .container {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 30px !important;
    margin: 20px auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: blur(10px) !important;
    max-width: 1400px !important;
    width: 90% !important;
}

.bulldesign-school-store .school-header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    /* Dynamic background set via inline style in PHP - no fallback background to avoid conflicts */
    border-radius: 30px 30px 0 0;
    overflow: hidden;
}

/* Fallback background for stores without primary color - lower specificity */
.bulldesign-school-store .school-header:not([style*="background"]) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Ensure inline styles for primary color always take precedence */
.bulldesign-school-store .school-header[style*="background"] {
    /* Inline style will override this automatically */
}

/* High specificity to ensure no theme CSS overrides our background */
body div.bulldesign-school-store div.school-header[style*="background"] {
    /* Inline styles automatically win over CSS */
}

.bulldesign-school-store .school-banner {
    width: 100%;
    height: 300px;
    overflow: hidden;
    position: relative;
}

.bulldesign-school-store .school-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8);
}

.bulldesign-school-store .school-banner::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 0;
    right: 0;
    height: 150px;
    /* Vertical gradient (top to bottom fade) with horizontal color variation using multiple color stops */
    background: linear-gradient(to top,
        /* Bottom: full opacity with color shift from left to right (simulated via single average) */
        rgba(102, 126, 234, 1) 0%,
        rgba(102, 126, 234, 0.8) 30%,
        rgba(102, 126, 234, 0.4) 60%,
        transparent 100%
    );
    z-index: 1;
}

/* Dynamic banner fade using CSS custom property */
.bulldesign-school-store .school-banner[style*="--banner-fade-color"]::after {
    /* Using mask for vertical fade combined with horizontal gradient background */
    background: linear-gradient(135deg, var(--banner-fade-color) 0%, color-mix(in srgb, var(--banner-fade-color) 53%, white) 100%);
    -webkit-mask-image: linear-gradient(to top, black 0%, transparent 100%);
    mask-image: linear-gradient(to top, black 0%, transparent 100%);
}

/* Fallback for browsers that don't support color-mix */
@supports not (color: color-mix(in srgb, red, blue)) {
    .bulldesign-school-store .school-banner[style*="--banner-fade-color"]::after {
        background: linear-gradient(to top,
            var(--banner-fade-color) 0%,
            color-mix(in srgb, var(--banner-fade-color) 80%, transparent) 30%,
            color-mix(in srgb, var(--banner-fade-color) 40%, transparent) 60%,
            transparent 100%
        );
        -webkit-mask-image: none;
        mask-image: none;
    }
}

.bulldesign-school-store .school-title {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 800;
    color: white;
    margin: 0;
    padding: 30px;
    position: relative;
    z-index: 3;
    text-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

/* Hide the product photo in school store page header */
.bulldesign-school-store .school-header .school-product-photo {
    display: none;
}

/* ====================================================================
   PRODUCTS SECTION
   ================================================================== */

.products-section {
    padding: 50px;
    background: #f8f9fa;
}

.products-section h2 {
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.products-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* ====================================================================
   PRODUCTS GRID - RESPONSIVE LAYOUT
   ================================================================== */

.bulldesign-school-store .products-grid,
.products-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 20px !important;
    margin: 0 auto !important;
    width: 98% !important;
    max-width: 1600px !important;
}

.bulldesign-school-store .products-grid .product-card,
.products-grid .product-card,
.product-card {
    flex: 1 1 220px !important;
    max-width: 280px !important;
    min-width: 200px !important;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 24px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.9);
    display: flex !important;
    flex-direction: column !important;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* Ensure proper order: image first, title second, price third */
.product-card .product-image-link {
    order: 1 !important;
    display: block !important;
}

.product-card img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

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

.product-card h3 {
    order: 2 !important;
    margin: 20px 20px 15px;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    line-height: 1.3;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-card h3 a:hover {
    color: #667eea;
}

.product-price {
    order: 3 !important;
    font-weight: 800;
    font-size: 20px;
    color: #27ae60;
    margin: 0 20px 25px;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Hide any WooCommerce add-to-cart buttons or links inside product cards */
.product-card .add_to_cart_button,
.product-card .added_to_cart,
.product-card .button,
.product-card .product_type_simple,
.product-card .product_type_variable,
.product-card .ajax_add_to_cart,
.product-card a.button {
    display: none !important;
}

/* ====================================================================
   NO PRODUCTS MESSAGE AND EMPTY STATES - FORCE CENTER
   ================================================================== */

/* ONLY TARGET BULLDESIGN NO-PRODUCTS */
.bulldesign-schools-directory .no-products,
.bulldesign-category-page .no-products,
.bulldesign-school-store .no-products,
.no-products {
    text-align: center !important;
    padding: 80px 20px !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-radius: 20px !important;
    margin: 40px auto !important;
    max-width: 600px !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
    width: 90% !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    display: block !important;
}

/* FORCE CENTER FOR EMPTY STATE WHEN NO SCHOOLS EXIST */
.bulldesign-schools-directory:empty,
.bulldesign-category-page:empty {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    min-height: 60vh !important;
}

/* FORCE CENTER FOR EMPTY STATE TEXT */
.bulldesign-schools-directory p:only-child,
.bulldesign-category-page p:only-child {
    text-align: center !important;
    font-size: 18px !important;
    color: #6c757d !important;
    margin: 0 auto !important;
    padding: 40px 20px !important;
    max-width: 600px !important;
    width: 90% !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}

.no-products h2 {
    font-size: 28px !important;
    margin-bottom: 15px !important;
    color: #2c3e50 !important;
    font-weight: 600 !important;
    text-align: center !important;
}

.no-products p {
    font-size: 16px !important;
    color: #6c757d !important;
    margin: 0 !important;
    text-align: center !important;
}

/* ====================================================================
   NAVIGATION LINKS
   ================================================================== */

.bulldesign-back-link,
.bulldesign-category-page p:last-child,
.bulldesign-school-store p:last-child {
    text-align: center;
    margin: 60px 0 50px 0;
    padding: 20px 40px;
}

.bulldesign-back-link a,
.bulldesign-category-page p:last-child a,
.bulldesign-school-store p:last-child a {
    display: inline-block;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    padding: 16px 32px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.4s ease;
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.25);
    font-size: 16px;
    letter-spacing: 0.3px;
}

.bulldesign-back-link a:hover,
.bulldesign-category-page p:last-child a:hover,
.bulldesign-school-store p:last-child a:hover {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(108, 117, 125, 0.35);
    color: white;
    text-decoration: none;
}

/* ====================================================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ================================================================== */

/* Large screens */
@media (min-width: 1200px) {
    .schools-grid .school-card {
        flex: 1 1 280px !important;
        max-width: 380px !important;
        min-width: 250px !important;
    }

    .products-grid .product-card {
        flex: 1 1 210px !important;
        max-width: 270px !important;
        min-width: 190px !important;
    }
}

/* Tablets */
@media (max-width: 1024px) {
    .category-section {
        padding: 30px 20px;
        margin-bottom: 60px;
    }

    .schools-grid {
        gap: 25px;
        width: 90%;
    }

    .products-grid {
        gap: 20px;
        width: 98%;
    }

    .products-section {
        padding: 40px 30px;
    }
}

/* Small tablets */
@media (max-width: 768px) {
    .bulldesign-schools-directory,
    .bulldesign-category-page,
    .bulldesign-school-store {
        padding: 20px 0;
    }

    .bulldesign-schools-directory .container,
    .bulldesign-category-page .container,
    .bulldesign-school-store .container {
        padding: 0 1%;
    }

    .schools-grid {
        gap: 20px;
        width: 95%;
    }

    .schools-grid .school-card {
        flex: 1 1 240px !important;
        max-width: 350px !important;
        min-width: 220px !important;
    }

    .products-grid .product-card {
        flex: 1 1 220px !important;
        max-width: 280px !important;
        min-width: 180px !important;
    }

    .bulldesign-school-store .school-banner {
        height: 250px;
    }

    .products-section {
        padding: 30px 20px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .schools-grid {
        gap: 15px;
        width: 100%;
    }

    .schools-grid .school-card {
        flex: 1 1 100%;
        max-width: none;
        min-width: auto;
    }

    .products-grid {
        gap: 15px;
        width: 100%;
    }

    .products-grid .product-card {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 400px !important;
        min-width: auto !important;
    }

    .category-section {
        padding: 20px 15px;
        margin-bottom: 40px;
    }

    .bulldesign-school-store .container {
        margin: 10px auto;
        border-radius: 20px;
    }

    .bulldesign-school-store .school-header {
        border-radius: 20px 20px 0 0;
    }

    .bulldesign-school-store .school-banner {
        height: 180px;
    }

    .products-section {
        padding: 20px 15px;
    }
}

/* ====================================================================
   MENU INTEGRATION - COMPLETELY REMOVED TO AVOID ANY HEADER CONFLICTS
   ================================================================== */

/* All menu-related CSS has been removed to ensure no interference with header elements */

/* ====================================================================
   ACCESSIBILITY AND PERFORMANCE
   ================================================================== */

@media (prefers-reduced-motion: reduce) {
    .bulldesign-schools-directory *,
    .bulldesign-category-page *,
    .bulldesign-school-store * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for accessibility */
.school-card:focus,
.product-card:focus,
.product-button:focus,
.bulldesign-back-link a:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* ====================================================================
   NUCLEAR OPTION: ULTIMATE CENTERING AND FULL-WIDTH OVERRIDE
   ================================================================== */

/* ENSURE BULLDESIGN CONTENT IS CENTERED */
.bulldesign-schools-directory,
.bulldesign-category-page,
.bulldesign-school-store {
    text-align: center !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
}

.bulldesign-schools-directory *,
.bulldesign-category-page *,
.bulldesign-school-store * {
    box-sizing: border-box !important;
}

/* DO NOT TARGET ANY PARENT CONTAINERS - ONLY BULLDESIGN CONTENT ITSELF */
/* This ensures we don't affect header, navigation, or any other site elements */

/* SIMPLE CENTERING FOR CHILD ELEMENTS */
.bulldesign-schools-directory > *,
.bulldesign-category-page > *,
.bulldesign-school-store > * {
    text-align: center !important;
    margin: 0 auto !important;
    max-width: 1400px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
}

/* CENTER TEXT ELEMENTS */
.bulldesign-schools-directory h1,
.bulldesign-category-page h1,
.bulldesign-school-store h1,
.bulldesign-schools-directory p,
.bulldesign-category-page p,
.bulldesign-school-store p {
    text-align: center !important;
    margin: 0 auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
}

/* Print styles */
@media print {
    .bulldesign-schools-directory,
    .bulldesign-category-page,
    .bulldesign-school-store {
        background: white;
        color: black;
    }

    .school-card,
    .product-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ====================================================================
   WOOCOMMERCE PRODUCT GALLERY IMPROVEMENTS
   ================================================================== */

/* Issue #1: Make gallery thumbnails clearer (less grayed out) */
body .woocommerce-product-gallery .flex-control-thumbs li img,
body .woocommerce-product-gallery__image--placeholder,
body .woocommerce-product-gallery ol.flex-control-nav.flex-control-thumbs li img,
body.single-product .woocommerce-product-gallery .flex-control-thumbs li img,
body.single-product div.product div.images .flex-control-thumbs li img {
    opacity: 0.85 !important; /* Was typically 0.5 or lower */
    transition: opacity 0.3s ease !important;
}

body .woocommerce-product-gallery .flex-control-thumbs li img:hover,
body .woocommerce-product-gallery ol.flex-control-nav.flex-control-thumbs li img:hover,
body .woocommerce-product-gallery .flex-control-thumbs li img.flex-active,
body.single-product .woocommerce-product-gallery .flex-control-thumbs li img:hover,
body.single-product div.product div.images .flex-control-thumbs li img:hover {
    opacity: 1 !important;
}

/* Issue #2: Reduce zoom intensity on main product image */
body .woocommerce-product-gallery__image img,
body.single-product div.product div.images img {
    transition: transform 0.3s ease !important;
}

/* Override WooCommerce's default strong zoom effect */
body .woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:hover img,
body .woocommerce-product-gallery__image:hover img,
body.single-product div.product div.images .woocommerce-product-gallery__image:hover img {
    transform: scale(1.1) !important; /* Much more subtle than default 1.5+ */
}

/* Disable aggressive PhotoSwipe zoom */
.pswp__zoom-wrap {
    transition: transform 0.3s ease !important;
}

/* Ensure zoom stays reasonable even with PhotoSwipe */
.pswp--zoomed-in .pswp__img {
    max-width: 150% !important; /* Limit maximum zoom to 1.5x instead of 3x+ */
}

/* Issue #3: Style navigation arrows for FlexSlider gallery */
body .woocommerce-product-gallery .flex-direction-nav,
body.single-product div.product div.images .flex-direction-nav {
    display: block !important;
    opacity: 1 !important;
}

body .woocommerce-product-gallery .flex-direction-nav a,
body.single-product div.product div.images .flex-direction-nav a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    background: rgba(0, 0, 0, 0.5) !important;
    color: white !important;
    text-decoration: none !important;
    font-size: 24px !important;
    line-height: 1 !important;
    border-radius: 50% !important;
    opacity: 0.7 !important;
    transition: opacity 0.3s ease, background 0.3s ease !important;
    cursor: pointer !important;
    z-index: 10 !important;
}

body .woocommerce-product-gallery .flex-direction-nav a:hover,
body.single-product div.product div.images .flex-direction-nav a:hover {
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.8) !important;
}

body .woocommerce-product-gallery .flex-direction-nav .flex-prev,
body.single-product div.product div.images .flex-direction-nav .flex-prev {
    left: 10px !important;
}

body .woocommerce-product-gallery .flex-direction-nav .flex-next,
body.single-product div.product div.images .flex-direction-nav .flex-next {
    right: 10px !important;
}

/* Make sure arrows show properly with icon content */
body .woocommerce-product-gallery .flex-direction-nav a:before,
body.single-product div.product div.images .flex-direction-nav a:before {
    display: inline-block !important;
    font-family: 'WooCommerce', sans-serif !important;
    speak: none !important;
    font-weight: 400 !important;
    font-variant: normal !important;
    text-transform: none !important;
    -webkit-font-smoothing: antialiased !important;
    margin: 0 !important;
}

body .woocommerce-product-gallery .flex-prev:before,
body.single-product div.product div.images .flex-prev:before {
    content: '‹' !important;
}

body .woocommerce-product-gallery .flex-next:before,
body.single-product div.product div.images .flex-next:before {
    content: '›' !important;
}