/**
 * T02 Theme Common Styles
 *
 * This file contains common customizations for t02 theme implementations.
 * Include this file in ANY new t02-based theme.
 *
 * Source: Tested and verified in production
 * Version: 1.0.0
 * Last Updated: 2025-10-26
 *
 * Location: themes/common/t02-common.css
 *
 * Usage in base.html.twig:
 * <link rel="stylesheet" href="{{ asset('common/t02-common.css') }}">
 */

/* ============================================================================
   1. SYMFONY DEBUG TOOLBAR (Black Bar at Bottom)
   ========================================================================= */
/* Note: Symfony debug toolbar is now visible in development mode (as intended)
   It will automatically be hidden in production mode by Symfony itself */

/* ============================================================================
   2. CURRENCY/LANGUAGE DROPDOWNS
   ========================================================================= */
/* Fix currency/language dropdown visibility issues */
.dropdown.bootstrap-select.image-select.style-default > .dropdown-menu {
    overflow: unset !important;
    margin-top: 17px !important;
    margin-bottom: 17px !important;
    padding: 15px 20px;
    border-radius: 0;
    border: 0;
    background-color: var(--white, #ffffff);
    box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 18px 0px;
    min-height: auto !important;
    height: auto !important;
}

/* Currency dropdown specific width */
.dropdown.bootstrap-select.image-select.type-currencies > .dropdown-menu {
    width: 300px;
    margin-left: calc(50% - 150px) !important;
}

/* Language dropdown specific width */
.dropdown.bootstrap-select.image-select.type-languages > .dropdown-menu {
    width: 96px;
    margin-left: calc(50% - 48px) !important;
}

/* Style the dropdown items */
.dropdown.bootstrap-select.image-select.style-default > .dropdown-menu ul.dropdown-menu > li > a {
    padding: 5px 0;
    color: var(--main, #000000);
}

.dropdown.bootstrap-select.image-select.style-default > .dropdown-menu ul.dropdown-menu > li > a .text {
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 5px;
    font-weight: 400;
    font-size: 14px;
    line-height: 16px;
}

/* Dropdown arrow/caret styling */
.dropdown.bootstrap-select.image-select.style-default > .dropdown-menu::after {
    position: absolute;
    content: "";
    width: 16px;
    height: 16px;
    transform: translate(-50%, -50%) rotate(45deg);
    background-color: var(--white, #ffffff);
    top: 0;
    left: 50%;
    z-index: 2;
}

/* Make sure inner dropdown menu is visible */
.dropdown.bootstrap-select.image-select > .dropdown-menu .inner {
    max-height: none !important;
    overflow-y: visible !important;
}

/* Top bar specific fixes */
.top-bar-language .dropdown.bootstrap-select.image-select.style-default > .dropdown-menu {
    margin-top: 12px !important;
}

/* Ensure dropdowns are above other content */
.dropdown.bootstrap-select.image-select > .dropdown-menu {
    z-index: 1050 !important;
}

/* Fix tf-currencies and tf-languages container overflow issues */
.tf-currencies,
.tf-languages {
    position: relative;
    overflow: visible !important;
}

/* Fix top-bar-language dropdown positioning - override inset: 0px */
.top-bar-language .dropdown-menu {
    inset: auto !important;
    top: 100% !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
}

/* Make sure the dropdown menu is not cut off */
.tf-top-bar,
.top-bar-language,
.tf-cur {
    overflow: visible !important;
}

/* Fix the inner dropdown menu to show content properly */
.dropdown.bootstrap-select.image-select .dropdown-menu .inner {
    max-height: none !important;
    overflow: visible !important;
}

/* Fix inner ul to display items correctly - CRITICAL */
.dropdown.bootstrap-select.image-select .dropdown-menu ul.dropdown-menu {
    position: static !important;
    float: none !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================================================
   3. SHOP SORT DROPDOWN
   ========================================================================= */
/* Matches original theme structure: div.dropdown-menu > a.select-item */
.tf-dropdown-sort {
    position: relative;
}

/* Ensure link items don't have underlines and inherit theme colors */
.tf-dropdown-sort .dropdown-menu a.select-item {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* ============================================================================
   4. NAVIGATION MENU DROPDOWNS
   ========================================================================= */
/* Fix regular dropdown positioning for Pages and Blog menus */
.box-nav-ul .menu-item.position-relative > .sub-menu {
    left: 0;
}

/* Fix for nested sub-menus (2nd level) - these should appear to the right */
.box-nav-ul .menu-item-2 .sub-menu {
    top: -22px;
    left: calc(100% + 23px);
}

/* RTL support for dropdowns */
.rtl .box-nav-ul .menu-item > .sub-menu {
    right: 0;
    left: unset;
}

.rtl .box-nav-ul .menu-item > .mega-menu {
    right: 0;
    left: unset;
}

/* ============================================================================
   5. LOGIN MODAL
   ========================================================================= */
/* Fix login modal styling - spacing and appearance */
.form-sign-in .modal-dialog {
    max-width: 640px;
}

.form-sign-in .modal-dialog .modal-content {
    border: 0;
    padding: 37px 35px;
    border-radius: 3px;
}

.form-sign-in .header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-sign-in .header .demo-title {
    font-size: 28px;
    line-height: 33.6px;
    font-weight: 600;
}

.form-sign-in .header .icon-close-popup {
    padding: 0 6px;
    font-size: 16px;
    cursor: pointer;
}

/* Add spacing between form fields */
.form-sign-in .tf-login-form form > div {
    margin-top: 15px;
}

.form-sign-in .tf-login-form form .tf-field:first-child {
    margin-top: 0;
}

/* Style the forgot password and register links */
.form-sign-in .tf-login-form form .btn-link {
    margin: 10px 0;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

/* Bottom section spacing */
.form-sign-in .tf-login-form .bottom {
    margin-top: 20px;
}

.form-sign-in .tf-login-form .bottom > div + div {
    margin-top: 15px;
}

/* Ensure tf-field has proper positioning for floating labels */
.tf-field {
    position: relative;
    margin-bottom: 20px;
}

.tf-field.style-1 {
    margin-bottom: 20px;
}

/* ============================================================================
   6. MOBILE MENU & RESPONSIVE BEHAVIOR
   ========================================================================= */
@media (max-width: 991px) {
    /* Hide desktop menu on mobile */
    .box-nav-ul {
        display: none !important;
    }

    /* Show mobile menu trigger */
    .nav-mobile {
        display: block !important;
    }

    /* Hide desktop footer headings on mobile */
    .footer-heading.footer-heading-desktop {
        display: none !important;
    }

    /* Show mobile footer headings - match original exactly */
    .footer .footer-col-block .footer-heading.footer-heading-moblie {
        margin-top: 30px;
        margin-bottom: 15px;
        display: block;
        position: relative;
        cursor: pointer;
    }

    /* Create horizontal line of plus sign */
    .footer .footer-col-block .footer-heading-moblie::after {
        position: absolute;
        content: "";
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 12px;
        height: 1px;
        background-color: var(--main, #000);
        transition: 0.25s ease-in-out;
    }

    /* Create vertical line of plus sign */
    .footer .footer-col-block .footer-heading-moblie::before {
        position: absolute;
        content: "";
        right: 15px;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 1px;
        height: 12px;
        background-color: var(--main, #000);
        transition: 0.25s ease-in-out;
    }

    /* When open, hide vertical line (::before) */
    .footer .footer-col-block.open .footer-heading-moblie::before {
        opacity: 0;
    }

    /* When open, rotate horizontal line (::after) */
    .footer .footer-col-block.open .footer-heading-moblie::after {
        transform: translate(0%, -50%) rotate(180deg);
    }

    /* Mobile-specific footer padding adjustments */
    .footer-infor {
        margin-bottom: 30px;
    }

    /* Style the Get direction link on mobile */
    .footer-infor .tf-btn.btn-line {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        margin: 15px 0;
        padding-bottom: 5px;
        border-bottom: 1px solid currentColor;
        font-size: 14px;
        font-weight: 500;
        text-decoration: none;
    }

    .footer-infor .tf-btn.btn-line i {
        font-size: 12px;
    }

    /* Footer collapse content - hidden by default on mobile */
    .footer .tf-collapse-content {
        display: none;
    }

    /*!* Newsletter section never collapses *!*/
    /*.footer-newsletter .tf-collapse-content {*/
    /*    display: block !important;*/
    /*}*/

    /* No expand/collapse indicators for newsletter */
    .footer-newsletter .footer-heading-moblie::before,
    .footer-newsletter .footer-heading-moblie::after {
        display: none !important;
    }

    /* Newsletter heading should not be clickable */
    .footer-newsletter .footer-heading-moblie {
        cursor: default !important;
    }
}

/* Desktop-specific styles */
@media (min-width: 992px) {
    /* Ensure desktop menu is visible */
    .box-nav-ul {
        display: flex !important;
    }

    /* Hide mobile menu trigger on desktop */
    .nav-mobile {
        display: none !important;
    }

    /* Show desktop footer headings */
    .footer-heading.footer-heading-desktop {
        display: block !important;
    }

    /* Hide mobile footer headings */
    .footer-heading.footer-heading-moblie {
        display: none !important;
    }

    /* Footer sections always expanded on desktop */
    .footer-menu-list,
    .tf-collapse-content {
        display: block !important;
    }

    /* No collapse arrows on desktop */
    .footer-heading::after {
        display: none !important;
    }
}

/* ============================================================================
   7. PRICE COMPARISON SECTION (Glami.bg Style)
   ========================================================================= */

/* --- Price Comparison Header --- */
.price-comparison-section {
    margin: 25px 0;
    padding: 20px;
    background-color: var(--bg-11, #f8f9fa);
    border-radius: 8px;
}

.price-comparison-header {
    margin-bottom: 15px;
}

.price-comparison-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.price-comparison-summary .price-from {
    font-size: 14px;
    color: var(--text, #666);
}

.price-comparison-summary .price-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--main, #000);
    margin: 0 5px;
}

.price-comparison-summary .price-secondary {
    font-size: 14px;
    color: var(--text, #666);
    font-weight: 400;
}

.price-comparison-summary .store-count {
    font-size: 14px;
    color: var(--text, #666);
}

/* --- Filter/Sort Bar --- */
.offer-filter-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--line, #ebebeb);
}

.offer-filter-bar .sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.offer-filter-bar .sort-label {
    font-size: 13px;
    color: var(--text, #666);
    margin: 0;
}

.offer-filter-bar .btn-group .btn {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 4px;
}

.offer-filter-bar .btn-group .btn-outline-secondary {
    border-color: var(--line, #ebebeb);
    color: var(--text, #666);
}

.offer-filter-bar .btn-group .btn-outline-secondary:hover {
    background-color: var(--bg-11, #f5f5f5);
    border-color: var(--line, #ebebeb);
    color: var(--main, #000);
}

/* --- Offer Cards List --- */
.offer-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- Individual Offer Card --- */
.offer-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    background-color: var(--white, #fff);
    border: 1px solid var(--line, #ebebeb);
    border-radius: 8px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.offer-card:hover {
    border-color: var(--primary, #000);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.offer-card-featured {
    border-color: var(--primary, #000);
    border-width: 2px;
    background-color: var(--bg-11, #fafafa);
}

/* --- Offer Card Header (Provider + Badges) --- */
.offer-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 200px;
    min-width: 180px;
}

.offer-provider {
    display: flex;
    align-items: center;
}

.offer-provider .provider-logo {
    max-height: 28px;
    max-width: 100px;
    object-fit: contain;
}

.offer-provider .provider-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--main, #000);
}

.offer-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.offer-badges .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
}

.offer-badges .badge-recommended {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.offer-badges .badge-lowest-price {
    background-color: #fff3e0;
    color: #e65100;
}

/* --- Offer Card Body (Availability, Return, Rating) --- */
.offer-card-body {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1 1 250px;
    flex-wrap: wrap;
}

.offer-availability {
    flex-shrink: 0;
}

.offer-availability .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

.status-in-stock {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-low-stock {
    background-color: #fff8e1;
    color: #f57f17;
}

.status-out-of-stock {
    background-color: #ffebee;
    color: #c62828;
}

.status-unknown {
    background-color: var(--bg-11, #f5f5f5);
    color: var(--text, #666);
}

.offer-return-policy {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text, #666);
}

.offer-return-policy i {
    font-size: 14px;
}

.offer-rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.offer-rating .icon-star {
    font-size: 12px;
    color: var(--line, #ddd);
}

.offer-rating .icon-star.filled {
    color: #ffc107;
}

.offer-rating .rating-value {
    font-size: 12px;
    color: var(--text, #666);
    margin-left: 4px;
}

/* --- Offer Card Footer (Price + CTA) --- */
.offer-card-footer {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 0 0 auto;
    margin-left: auto;
}

.offer-price {
    text-align: right;
}

.offer-price .price-main {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--main, #000);
    line-height: 1.2;
}

.offer-price .price-secondary {
    display: block;
    font-size: 13px;
    color: var(--text, #666);
    font-weight: 400;
}

.offer-price .shipping-cost {
    display: block;
    font-size: 12px;
    color: var(--text, #888);
    margin-top: 2px;
}

.offer-price .shipping-free {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #2e7d32;
    margin-top: 2px;
}

.btn-view-store {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-view-store i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.btn-view-store:hover i {
    transform: translateX(3px);
}

/* --- Price Comparison Footer --- */
.price-comparison-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--line, #ebebeb);
}

.price-comparison-footer p {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 5px 0;
    font-size: 12px;
    color: var(--text, #888);
}

.price-comparison-footer i {
    font-size: 14px;
}

/* --- Responsive Adjustments --- */
@media (max-width: 767px) {
    .price-comparison-section {
        padding: 15px;
        margin: 20px 0;
    }

    .price-comparison-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .offer-filter-bar {
        justify-content: flex-start;
    }

    .offer-card {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }

    .offer-card-header {
        flex: 1 1 100%;
        justify-content: space-between;
    }

    .offer-card-body {
        flex: 1 1 100%;
        padding: 10px 0;
        border-top: 1px solid var(--line, #ebebeb);
        border-bottom: 1px solid var(--line, #ebebeb);
    }

    .offer-card-footer {
        flex: 1 1 100%;
        justify-content: space-between;
        margin-left: 0;
    }

    .offer-price {
        text-align: left;
    }
}

/* ==========================================================================
   Price Filter Widget - Glami.bg Style
   ========================================================================== */

/* Price display row */
.price-display-row {
    margin-bottom: 12px;
    text-align: center;
}
.price-display-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--main, #333);
}
.price-display-secondary {
    font-size: 13px;
    color: var(--text, #666);
    margin-left: 4px;
}
.hidden { display: none !important; }

/* Slider container */
.price-slider-container {
    margin: 15px 0 20px;
    padding: 0 5px;
}

/* Input row */
.price-inputs-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}
.price-input-group {
    display: flex;
    align-items: center;
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px 12px;
    background: #f8f8f8;
    gap: 6px;
}
.price-input-group:focus-within {
    border-color: #999;
    background: #fff;
}
.price-manual-input {
    flex: 1;
    min-width: 40px;
    width: auto;
    border: none !important;
    box-shadow: none !important;
    font-size: 14px;
    padding: 0;
    outline: none !important;
    text-align: left;
    background: transparent;
    -moz-appearance: textfield;
}
.price-manual-input::placeholder {
    color: #bbb;
}
.price-manual-input:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}
.price-manual-input::-webkit-outer-spin-button,
.price-manual-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.price-currency-suffix {
    font-size: 14px;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}
.price-separator {
    color: var(--text, #999);
}
.btn-price-apply {
    padding: 8px 16px;
    background: var(--main, #333);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.btn-price-apply:hover {
    background: var(--main-hover, #000);
}

/* Predefined range buttons */
.price-range-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}
.price-range-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    background: #fff;
    border: 1px solid var(--line, #ddd);
    border-radius: 6px;
    text-decoration: none;
    color: var(--main, #333);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}
.price-range-btn:hover {
    border-color: var(--main, #333);
    background: var(--bg-11, #f5f5f5);
    color: var(--main, #333);
    text-decoration: none;
}
/* Active state - highlighted like hover but persistent */
.price-range-btn.active {
    border-color: var(--main, #333);
    background: var(--main, #333);
    color: #fff;
}
.price-range-btn.active:hover {
    background: var(--main-hover, #000);
    border-color: var(--main-hover, #000);
}
.price-range-btn.active .price-range-secondary {
    color: rgba(255, 255, 255, 0.8);
}
.price-range-primary {
    font-weight: 500;
}
.price-range-secondary {
    font-size: 11px;
    color: var(--text, #666);
    margin-top: 2px;
}

/* ==========================================================================
   Category Filter - Active/Selected State (Ecomus Style)
   ========================================================================== */

/* Active category - red color like Ecomus */
.list-categoris .cate-item.active > a,
.list-categoris .cate-item a.active-category {
    color: var(--red, #c00) !important;
    font-weight: 500;
}
.list-categoris .cate-item.active > a span,
.list-categoris .cate-item a.active-category span {
    color: var(--red, #c00) !important;
}

/* ==========================================================================
   Price Filter - Compact Input Styling
   ========================================================================== */

/* Make price inputs more compact - same height as Apply button */
.price-input-group {
    padding: 4px 8px;
}
.price-manual-input {
    height: 24px;
    font-size: 13px;
}
.btn-price-apply {
    padding: 6px 12px;
    font-size: 12px;
}

/* ==========================================================================
   Color Filter - Color Swatches (Ecomus Style)
   ========================================================================== */

/* Color swatch circle */
.color-swatch {
    display: inline-block;
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background-color: #ccc;
    position: relative;
    transition: all 0.2s;
}
.facet-link-color:hover .color-swatch {
    border-color: #999;
    transform: scale(1.1);
}
.color-swatch.checked {
    border-color: var(--main, #333);
    box-shadow: 0 0 0 2px var(--main, #333);
}

/* Color swatch backgrounds - Bulgarian color names */
.bg-color-cheren, .bg-color-черен { background-color: #1a1a1a; }
.bg-color-byal, .bg-color-бял { background-color: #fafafa; border-color: #ccc !important; }
.bg-color-sin, .bg-color-син { background-color: #1e88e5; }
.bg-color-tamnsin, .bg-color-тъмносин { background-color: #1a237e; }
.bg-color-cherven, .bg-color-червен { background-color: #e53935; }
.bg-color-zelen, .bg-color-зелен { background-color: #43a047; }
.bg-color-siv, .bg-color-сив { background-color: #9e9e9e; }
.bg-color-rozov, .bg-color-розов { background-color: #ec407a; }
.bg-color-oranjew, .bg-color-оранжев { background-color: #ff9800; }
.bg-color-kafiav, .bg-color-кафяв { background-color: #795548; }
.bg-color-bejov, .bg-color-бежов { background-color: #d7ccc8; }
.bg-color-zhylt, .bg-color-жълт { background-color: #fdd835; }
.bg-color-violeotv, .bg-color-виолетов { background-color: #7b1fa2; }
.bg-color-liliav, .bg-color-лилав { background-color: #9c27b0; }
.bg-color-zlatist, .bg-color-златист { background-color: #ffd700; }
.bg-color-srebyrist, .bg-color-сребрист { background-color: #c0c0c0; }
.bg-color-tyrkuazen, .bg-color-тюркоазен { background-color: #00bcd4; }
.bg-color-koralovu, .bg-color-коралов { background-color: #ff7043; }
.bg-color-bordo, .bg-color-бордо { background-color: #800020; }
.bg-color-krem, .bg-color-крем { background-color: #fffdd0; border-color: #e0d8b0 !important; }
.bg-color-mentov, .bg-color-ментов { background-color: #98ff98; }

/* English color names fallback */
.bg-color-black { background-color: #1a1a1a; }
.bg-color-white { background-color: #fafafa; border-color: #ccc !important; }
.bg-color-blue { background-color: #1e88e5; }
.bg-color-navy { background-color: #1a237e; }
.bg-color-red { background-color: #e53935; }
.bg-color-green { background-color: #43a047; }
.bg-color-gray, .bg-color-grey { background-color: #9e9e9e; }
.bg-color-pink { background-color: #ec407a; }
.bg-color-orange { background-color: #ff9800; }
.bg-color-brown { background-color: #795548; }
.bg-color-beige { background-color: #d7ccc8; }
.bg-color-yellow { background-color: #fdd835; }
.bg-color-purple { background-color: #7b1fa2; }
.bg-color-violet { background-color: #9c27b0; }
.bg-color-gold { background-color: #ffd700; }
.bg-color-silver { background-color: #c0c0c0; }
.bg-color-turquoise { background-color: #00bcd4; }
.bg-color-coral { background-color: #ff7043; }
.bg-color-burgundy, .bg-color-maroon { background-color: #800020; }
.bg-color-cream { background-color: #fffdd0; border-color: #e0d8b0 !important; }
.bg-color-mint { background-color: #98ff98; }
.bg-color-taupe { background-color: #483c32; }
.bg-color-ivory { background-color: #fffff0; border-color: #e0e0d8 !important; }
.bg-color-khaki { background-color: #c3b091; }
.bg-color-olive { background-color: #808000; }
.bg-color-teal { background-color: #008080; }
.bg-color-magenta { background-color: #ff00ff; }
.bg-color-cyan { background-color: #00ffff; border-color: #00d8d8 !important; }
.bg-color-lavender { background-color: #e6e6fa; border-color: #c8c8e0 !important; }
.bg-color-peach { background-color: #ffcba4; }
.bg-color-salmon { background-color: #fa8072; }
.bg-color-multicolor, .bg-color-multi {
    background: linear-gradient(135deg, #ff0000 0%, #ff9900 20%, #ffff00 40%, #00ff00 60%, #0099ff 80%, #9900ff 100%);
}

/* ============================================================================
   SHOP EMPTY STATE - No products found (AboutYou.bg inspired)
   ========================================================================= */
/* Make empty state span full grid width */
.tf-grid-layout .col-12:has(.tf-no-products) {
    grid-column: 1 / -1;
}

.tf-no-products {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    width: 100%;
}

.tf-no-products .empty-state-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-11, #f5f5f5);
    border-radius: 12px;
    margin-bottom: 20px;
}

.tf-no-products .empty-state-icon i {
    font-size: 32px;
    color: var(--text-2, #999);
}

.tf-no-products .empty-state-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--main, #1a1a1a);
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.tf-no-products .empty-state-text {
    font-size: 14px;
    color: var(--text, #666);
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.tf-no-products .empty-state-link {
    color: var(--main, #1a1a1a);
    font-weight: 600;
    text-decoration: underline;
}

.tf-no-products .empty-state-link:hover {
    color: var(--primary, #000);
}

.tf-no-products .tf-btn {
    min-width: 200px;
}

/* ============================================================================
   SHOP SIDEBAR/CONTENT WIDTH - Narrower sidebar (15%/85% instead of 25%/75%)
   ========================================================================= */
@media (min-width: 1150px) {
    .tf-row-flex .tf-shop-sidebar {
        width: calc(15% - 15px);
    }
    .tf-row-flex .tf-shop-content {
        width: calc(85% - 15px);
    }
}

/* ============================================================================
   BRAND PAGE - Gender-Grouped Categories (Glami.bg Style)
   ========================================================================= */
/* Gender group container */
.sidebar-gender-group {
    margin-bottom: 1.25rem;
}

/* Gender header - section title */
.sidebar-gender-header {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--line, #ebebeb);
}

.sidebar-gender-header a {
    color: var(--main, #1a1a1a);
    text-decoration: none;
    display: block;
}

.sidebar-gender-header a:hover {
    text-decoration: underline;
}

/* Categories under gender - compact list */
.sidebar-gender-group .list-categoris {
    margin-bottom: 0;
    padding-left: 0;
    list-style: none;
}

.sidebar-gender-group .cate-item {
    padding: 4px 0;
}

.sidebar-gender-group .cate-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text, #666);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.sidebar-gender-group .cate-item a:hover {
    color: var(--main, #1a1a1a);
}

/* Product count badge */
.sidebar-gender-group .cate-item .count {
    color: var(--text-2, #999);
    font-size: 0.85em;
    margin-left: 0.5rem;
}

/* Root category (e.g., "Дрехи") - Glami.bg style hierarchy */
.sidebar-root-category {
    margin-bottom: 0.75rem;
}

.sidebar-root-category .root-category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--main, #1a1a1a);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 4px 0;
    transition: color 0.2s;
}

.sidebar-root-category .root-category-link:hover {
    text-decoration: underline;
}

.sidebar-root-category .root-category-link .count {
    color: var(--text-2, #999);
    font-size: 0.85em;
    font-weight: 400;
    margin-left: 0.5rem;
}

/* Subcategories under root - indented */
.sidebar-root-category .subcategory-list {
    margin: 0.25rem 0 0 0;
    padding-left: 1rem;
    list-style: none;
}

.sidebar-root-category .subcategory-list .cate-item {
    padding: 3px 0;
}

.sidebar-root-category .subcategory-list .cate-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text, #666);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.sidebar-root-category .subcategory-list .cate-item a:hover {
    color: var(--main, #1a1a1a);
}

.sidebar-root-category .subcategory-list .cate-item .count {
    color: var(--text-2, #999);
    font-size: 0.85em;
}

/* ============================================================================
   FILTER APPLY BUTTON (Glami.bg Style)
   Sticky button at bottom of filter sidebar
   ========================================================================= */

.filter-apply-wrapper {
    position: sticky;
    bottom: 0;
    background: var(--white, #fff);
    padding: 15px;
    border-top: 1px solid var(--line, #ebebeb);
    margin: 15px -15px -15px;
    z-index: 10;
}

.filter-apply-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 14px;
    background: var(--main, #333);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.filter-apply-btn:hover {
    background: var(--main-hover, #000);
    color: #fff;
}

.filter-apply-count {
    font-weight: 400;
}

/* EVA-341 — debounced live-count fetch in flight. We keep the button
   interactive (the user can still apply with the last-known count) but
   visually hint "in-flight" via reduced opacity and a wait cursor. */
.filter-apply-btn.is-loading {
    opacity: 0.7;
    cursor: progress;
}
.filter-apply-btn.is-loading .filter-apply-count {
    opacity: 0.6;
}

/* Mobile offcanvas - fixed position at bottom */
@media (max-width: 991px) {
    #filterShop .filter-apply-wrapper {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        border-radius: 0;
        z-index: 1001;
    }

    /* Add padding to body so button doesn't cover last facet */
    #filterShop .canvas-body {
        padding-bottom: 80px;
    }
}

/* ============================================================
   EVA-339 — Merchant ("Online store") facet
   Layer 2 common CSS; lands in every Layer 3 theme that
   inherits from themeforest/ecomus.
   ============================================================ */

.widget-facet-merchant .popular-stores-heading,
.widget-facet-merchant .facet-empty-state {
    font-size: 12px;
    color: var(--text-secondary, #6b6b6b);
    margin: 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Popular stores grid: 3-up on small screens, 4-up at ≥480px.
   Touch targets are at least 44px tall (Apple HIG, glami's mobile reference). */
.popular-stores-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 16px;
    padding: 0;
}
@media (min-width: 480px) {
    .popular-stores-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.popular-stores-grid .store-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
    padding: 10px 6px;
    min-height: 88px;
    border: 1px solid var(--line, #e5e5e5);
    border-radius: 6px;
    background: var(--background-1, #fff);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.popular-stores-grid .store-tile:hover {
    border-color: var(--main, #181818);
}
.popular-stores-grid .store-tile.active {
    border-color: var(--main, #181818);
    background: var(--surface-2, #f7f7f7);
    /* Double-thickness border so a selected tile is unmistakable and distinct from :hover. */
    box-shadow: inset 0 0 0 1px var(--main, #181818);
}

.store-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface-2, #f3f3f3);
}
.store-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.store-logo.is-fallback,
.store-row-logo.is-fallback {
    background: linear-gradient(135deg, #e9e9e9, #d6d6d6);
}
.store-monogram {
    font-weight: 600;
    font-size: 16px;
    color: var(--text, #181818);
    line-height: 1;
}

.popular-stores-grid .store-name {
    font-size: 12px;
    line-height: 1.2;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.popular-stores-grid .store-count {
    font-size: 11px;
    color: var(--text-secondary, #6b6b6b);
}

/* In-facet search input */
.facet-search {
    position: relative;
    margin: 0 0 8px;
}
.facet-search-input {
    width: 100%;
    min-height: 36px;
    padding: 6px 28px 6px 10px;
    border: 1px solid var(--line, #e5e5e5);
    border-radius: 6px;
    font-size: 13px;
    background: var(--background-1, #fff);
    color: inherit;
}
.facet-search-input:focus {
    outline: none;
    border-color: var(--main, #181818);
}
.facet-search-clear {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-secondary, #6b6b6b);
    line-height: 1;
}

/* Searchable scrollable store list (NOT the brand 8-item show-more pattern) */
.store-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    list-style: none;
}
.store-row {
    /* 44px touch target — Apple HIG / WCAG 2.5.5 */
    min-height: 44px;
}
.store-row .facet-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
    width: 100%;
}
.store-row-logo {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--surface-2, #f3f3f3);
}
.store-row-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.store-row-logo .store-monogram {
    font-size: 12px;
}
.store-row .store-name {
    flex: 1;
    font-size: 13px;
    line-height: 1.3;
}

/* Mobile offcanvas: full-width search, no horizontal overflow at narrow widths. */
@media (max-width: 575px) {
    .facet-search-input { font-size: 16px; /* prevent iOS zoom on focus */ }
    .store-list { max-height: 50vh; }
}

/* ==========================================================================
   PRODUCT VARIANT PICKER — soft "availability uncertain" indicator (EVA-586)
   ==========================================================================
   On an affiliate catalog our grouped data is often INCOMPLETE vs the merchant,
   so a colour/size combo with no variant in our data is NOT "sold out". The old
   `sold-out` class inherited the vendor Ecomus strike-through + pointer-events:none,
   which discouraged click-through and lost commission. The picker JS now marks such
   combos with `availability-uncertain` instead: a small muted dot, fully clickable,
   resolving the colour's representative affiliate link. Shared by every Ecomus-derived
   theme (fashion10 / homedecor01 / cosmetics01) that loads t02-common.css. */
.variant-picker-values label.availability-uncertain {
    position: relative;
    opacity: 0.55;
    cursor: pointer;
    pointer-events: auto;          /* never block the revenue-bearing click */
    text-decoration: none;         /* never strike-through */
}
.variant-picker-values label.availability-uncertain:hover {
    opacity: 1;
}
/* Small muted dot in the corner — a hint, not a barrier. */
.variant-picker-values label.availability-uncertain::after {
    content: '';
    position: absolute;
    top: 1px;
    right: 1px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 2;
}

/* EVA-603: muted legend explaining the availability-uncertain dot. Rendered
   under the size picker only when the colour×size grid is incomplete. */
.variant-availability-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.3;
    color: rgba(0, 0, 0, 0.5);
}
.variant-availability-legend .variant-availability-dot {
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   PDP PHOTOSWIPE LIGHTBOX — preserve real image aspect ratio (EVA-651)
   ==========================================================================
   The vendor t02/css/photoswipe.css sizes the lightbox image with
   `.pswp__img { width:auto; height:auto }` (plus a width/height:100% group) but
   NEVER sets object-fit. So whenever PhotoSwipe's zoom box aspect ≠ the image's
   real aspect (e.g. a portrait feed image sized into a wrong box), the browser
   STRETCHES the bitmap to fill → the severe wide squash. `object-fit: contain`
   makes the image always preserve its true aspect inside whatever box PhotoSwipe
   builds, so it can only ever letterbox, never distort.

   Paired with the per-image natural-dimension detection in t02/js/zoom.js
   (lightbox `domItemData` filter reads the slide <img> naturalWidth/Height) so
   the box itself is sized to the real aspect — together the rendered .pswp__img
   matches the image's natural aspect exactly. Loaded AFTER photoswipe.css by every
   Ecomus-derived theme (fashion10 / cosmetics01 / homedecor01). The placeholder
   is a <div>, not a replaced element, so it is excluded for clarity. */
.pswp__img:not(.pswp__img--placeholder) {
    object-fit: contain;
}

