/**
 * Enhanced Sheeel Theme Styles - Unique rules only
 */

/* ============================================
   Language Switcher Dropdown
============================================ */
.language-switcher-dropdown {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.language-switcher-dropdown .language-switcher-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333 !important;
    transition: border-color 0.2s, background 0.2s;
    white-space: nowrap;
    line-height: 1.4;
    font-family: inherit;
}

.language-switcher-dropdown .language-switcher-toggle:hover {
    border-color: var(--sheeel-primary) !important;
    background: rgba(201,28,94,0.05) !important;
}

.language-switcher-dropdown .language-switcher-toggle .dropdown-arrow {
    transition: transform 0.2s;
    flex-shrink: 0;
}

.language-switcher-dropdown .language-switcher-toggle[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

.language-switcher-dropdown .language-switcher-menu {
    display: none !important;
    position: absolute !important;
    top: calc(100% + 6px) !important;
    right: 0 !important;
    left: auto !important;
    min-width: 150px;
    background: #fff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15) !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 4px 0 !important;
    z-index: 99999 !important;
    flex-direction: column !important;
}

.language-switcher-dropdown .language-switcher-menu.active {
    display: block !important;
}

.language-switcher-dropdown .language-switcher-menu li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    background: none !important;
    border: none !important;
}

.language-switcher-dropdown .language-option {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 9px 14px !important;
    text-decoration: none !important;
    color: #333 !important;
    font-size: 0.9rem;
    transition: background 0.15s;
    white-space: nowrap;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    width: 100%;
    box-sizing: border-box;
}

.language-switcher-dropdown .language-option:hover {
    background: #f8f9fa !important;
    color: var(--sheeel-primary) !important;
}

.language-switcher-dropdown .language-option.active {
    color: var(--sheeel-primary) !important;
    font-weight: 600;
}

.language-switcher-dropdown .language-option .checkmark {
    margin-right: auto;
    margin-left: 4px;
    color: var(--sheeel-primary);
    flex-shrink: 0;
}

/* Ensure nav CSS does not collapse the dropdown list */
.language-switcher-dropdown ul.language-switcher-menu {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    background: #fff !important;
    padding: 4px 0 !important;
    margin: 0 !important;
}

[dir="rtl"] .language-switcher-dropdown .language-switcher-menu {
    right: auto !important;
    left: 0 !important;
}

/* ============================================
   Language Switch Loader
============================================ */
.language-switch-loader {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.loader-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #dee2e6;
    border-top-color: var(--sheeel-primary);
    border-radius: 50%;
    animation: lang-spin 0.7s linear infinite;
}

@keyframes lang-spin { to { transform: rotate(360deg); } }

/* ============================================
   Main Deal Image Size Overrides
============================================ */
.main-deal-content-grid {
    grid-template-columns: 1.4fr 0.6fr !important;
    align-items: center !important;
}

.main-deal-image {
    max-height: 240px !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 auto;
    display: block;
    object-fit: contain !important;
}

.main-deal-gallery-column {
    display: flex;
    justify-content: center;
}

.main-deal-gallery-wrapper {
    max-width: 320px !important;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 768px) {
    .main-deal-content-grid {
        grid-template-columns: 1fr !important;
    }
    .main-deal-image {
        max-height: 200px !important;
    }
    .main-deal-gallery-wrapper {
        max-width: 280px !important;
    }
}

/* ============================================
   Product Image Visibility Fix
   - WooCommerce starts the product gallery wrapper with inline `opacity: 0`
     and relies on JS to fade it in. If that JS is delayed, images appear only
     after hover/interaction.
============================================ */
.woocommerce-product-gallery,
.woocommerce-product-gallery img,
.product-gallery,
.product-gallery img,
.featured-carousel img,
.featured-carousel .product-image-container img,
.featured-carousel .swiper-slide img,
.product-image-container img,
.product-image-wrapper img,
.product-image-photo,
.product-card-image,
.deal-card img,
.product-item-main-deal img,
.main-deal-image,
.main-deal-image img,
.wc-block-cart-item__image img,
.wc-block-components-product-image img,
.wc-block-cart-item-container img,
.wc-block-components-product__image img {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Force product images always visible - never hidden */
.featured-carousel-section .swiper-slide,
.featured-carousel-section .swiper-slide > * {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Fix for images only showing on hover */
.featured-carousel-section img,
.featured-carousel .product-image-container img,
.featured-carousel .product-card img {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    animation: none !important;
    transition: none !important;
}

.featured-carousel-section img:not(:hover),
.featured-carousel .product-image-container img:not(:hover),
.featured-carousel .product-card img:not(:hover) {
    opacity: 1 !important;
    visibility: visible !important;
}
