/*
==================================================================
  ATTRACTIVE & ADAPTIVE HEADER STYLES (v3 - Final)
  - Keeps search in the top bar and makes it convenient
  - Uses your requested color: #e6ad12
==================================================================
*/

:root {
    --brand-color: #e6ad12;
    --brand-dark: #222;
    --brand-text: #333;
    --brand-text-light: #fff;
}

/*
 * 1. TOP HEADER BAR
 */
.top-header {
    background-color: var(--brand-dark) !important;
    padding: 8px 0;
    color: var(--brand-text-light);
    /* overflow-x: hidden;  <-- DELETE THIS LINE */
}

.top-header .container {
    padding-top: 20px;
    padding-bottom: 20px;
}

.ais-SearchBox-input.form-control::placeholder {
    color: var(--brand-text-light);
}
.ais-SearchBox-input.form-control:hover {
    cursor: pointer;
}

.ais-SearchBox-resetIcon {
    color: var(--brand-color);
}

.top-header .contact-number {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.top-header .contact-number i {
    color: var(--brand-color);
    font-size: 1.3rem;
    margin-right: 8px;
}

.top-header .contact-number a {
    color: var(--brand-text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.top-header .contact-number a:hover {
    color: var(--brand-color);
}

 .tf-ion-ios-telephone__phone, .profile-name {
        color: var(--brand-text-light);
    }

/* Main Logo */
.logo, .logo:hover, .navbar-brand.logo {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 2.2rem;
    color: var(--brand-color) !important;
    text-decoration: none;
    letter-spacing: 1px;
}

/* Top Menu Actions (Cart/User) */
.top-menu a {
    color: var(--brand-text-light);
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.top-menu a:hover {
    color: var(--brand-color);
}

.top-menu .tf-ion-person {
    font-size: 1.6rem;
}

/* Cart Styles */
.cart-nav .tf-ion-android-cart {
    font-size: 1.5rem;
    position: relative;
    margin-right: 5px;
}
.cart-nav .tip {
    position: absolute;
    top: -6px;
    right: -10px;
    background: var(--brand-color);
    color: var(--brand-dark);
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 1px solid var(--brand-dark);
}
.cart-nav #cart_sum {
    color: var(--brand-text-light);
    font-size: 14px;
}

/* User Dropdown */
.top-menu .dropdown-slide {
    position: relative;
}

.top-menu .dropdown-menu {
    border-radius: 4px;
    border: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-top: 10px !important;
}
.top-menu .dropdown-item {
    padding: 10px 15px;
    transition: all 0.3s ease;
    color: var(--brand-text) !important;
}
.top-menu .dropdown-item:hover,
.top-menu .dropdown-item button:hover {
    background-color: var(--brand-color) !important;
    color: var(--brand-dark) !important;
}
.top-menu .dropdown-item button {
    background: none;
    border: none;
    padding: 0;
    width: 100%;
    text-align: left;
    color: var(--brand-text);
}


/*
 * 2. MAIN NAVIGATION BAR (White bar)
 */
.main-nav {
    background: #fff;
    border-bottom: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    overflow-x: hidden;
}
.main-nav .nav-link {
    font-size: 1rem;
    font-weight: 600;
    color: var(--brand-text);
    text-transform: uppercase;
    padding: 20px 15px;
    transition: color 0.3s ease;
    position: relative;
    text-decoration: none;
}
.main-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 15px;
    right: 15px;
    height: 2px;
    background-color: var(--brand-color);
    transform: scaleX(0);
    transition: transform 0.3s ease-out;
}
.main-nav .nav-link:hover,
.main-nav .nav-item.active .nav-link {
    color: var(--brand-color);
}
.main-nav .nav-link:hover::after {
    transform: scaleX(1);
}

/* Main Nav Dropdown */
.main-nav .dropdown-menu {
    border: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
}
.main-nav .dropdown-item {
    color: var(--brand-text);
    transition: all 0.3s ease;
    padding: 10px 15px;
}
.main-nav .dropdown-item:hover {
    background-color: var(--brand-color);
    color: var(--brand-dark);
}

/* Mobile Toggler Icon */
.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}
.navbar-toggler:focus {
    box-shadow: none;
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(230, 173, 18, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}


/*
 * 3. CONVENIENT SEARCH BAR FIX (This is the new part)
 */

#searchbox {
    background-color: var(--brand-dark);
}

#top-header-search {
    width: 100%;
}
#top-header-search #app {
    width: 100%;
}

/* Styles for search input inside #app */
#top-header-search input[type="text"],
#top-header-search input[type="search"] {
    background-color: #444;
    border: 1px solid #666;
    color: #fff;

    /* CHANGE THESE TWO LINES */
    padding: 6px 10px;  /* Was 6px 12px */
    font-size: 13px;      /* Was 14px */

    border-radius: 20px;
    width: 100%;
    transition: all 0.3s ease;
}

#top-search-li {
    position: relative;
}

/*
 * 4. MOBILE-SPECIFIC ADJUSTMENTS (Fixes your code)
 */

/* This overrides your "column-reverse" style */
@media (max-width: 768px) {
    .top-menu {
        flex-direction: row !important; /* Keep it as a row */
        align-items: center !important;
        gap: 0 !important;
        padding: 0 !important;
    }
    .top-menu > li {
        width: auto !important;
    }

    /* THIS IS THE FIX for header size */
    #top-search-li {
        position: relative;
        flex-grow: 1 !important;
        flex-shrink: 1 !important; /* Allows it to shrink */
        min-width: 50px;         /* Stops it from disappearing */
    }

    .top-menu {
        width: 100%;
    }

    .tf-ion-ios-telephone__phone {
        display: none;
    }
}

@media (max-width:991px) {
    /* .logo {
        display: none;
    } */ /* <-- THIS WAS THE PROBLEM. It's now fixed. */
    .tf-ion-ios-telephone:before {
        color: var(--brand-color);
    }
}

/*
 * 5. NO-SCROLL & #HITS STYLES (Moved from blade.php)
 */

/* This is the guaranteed "no-horizontal-scroll" fix */


#hits {
    position: absolute;   /* Ось головне виправлення */
    top: 100%;            /* Позиція: одразу під батьківським елементом */
    right: 0;             /* Прив'язка до правого краю поля пошуку */
    left: auto;
    width: 450px;         /* Конкретна ширина для десктопу (можеш змінити) */

    background: white;
    z-index: 9999;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.25rem;
    padding: 1rem;
    max-height: 400px;    /* Можна зробити вищим на десктопі */
    overflow-y: auto;
    border: 1px solid #ddd; /* Додамо рамку для чіткості */
}

/*
 * 6. BURGER MENU DROPDOWN FIX (ADD THIS NEW BLOCK)
 */
@media (max-width: 991.98px) {
    /*
     * This forces the "Деталіше" dropdown to behave like a
     * simple list *inside* the mobile menu, instead of
     * a full-width absolute-positioned element.
     */
    .main-nav .navbar-collapse .nav-item.dropdown .dropdown-menu {
        position: static !important; /* Override 'absolute' from old theme */
        float: none !important;
        width: auto !important;      /* Override '100%' or '100vw' */
        margin: 0 !important;
        padding: 0 !important;
        background-color: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Style the nested links */
    .main-nav .navbar-collapse .dropdown-menu .dropdown-item {
        color: var(--brand-text);
        padding: 10px 15px;
        text-align: center;
        font-weight: 500;
        background-color: #f8f8f8; /* Give it a slight nested background */
    }

    .main-nav .navbar-collapse .dropdown-menu .dropdown-item:hover {
        background-color: var(--brand-color);
        color: var(--brand-dark);
    }

    .logo {
        display: none;
    }
    .navbar-brand.logo {
        display: block;
    }

    #hits {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        z-index: 1051;
        max-height: 200px;
        overflow-y: auto;
        border: 1px solid #ddd;
        border-radius: 0 0 0.5rem 0.5rem;
        padding: 0.5rem;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    }
}

/*
 * 7. FIX FOR PROFILE DROPDOWN ON MOBILE (ADD THIS NEW BLOCK)
 */
@media (max-width: 768px) {
    /*
     * This stops the user profile dropdown from
     * becoming full-width on mobile.
     */
    .top-menu .dropdown-menu {
        position: absolute !important; /* Ensure it's absolute */
        width: auto !important;     /* NOT full-width */
        /* 'dropdown-menu-end' should handle this, but we force it */
        left: auto !important;
        right: 0 !important;

        min-width: 180px; /* Give it a nice min-width */
    }
}

@media (min-width: 992px) {
  header.sticky-top {
    position: static; /* Вимикаємо 'sticky' */
  }
}
