/* ========================================
   RESPONSIVE HEADER SYSTEM
   Mobile-First Design with 5 Breakpoints
   ======================================== */

/* ========================================
   BASE STYLES (Mobile First - xs: <576px)
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Mobile-first approach - these styles apply to all devices and are overridden for larger screens */

.top-header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 8px 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 50px;
    flex-wrap: wrap;
}

/* Logo Section */
.logo {
    flex-shrink: 0;
    min-width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo img {
    height: 50px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
}


/* Header Right Section */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* For mobile, make search container full width and order it below logo and other elements */
@media (max-width: 576px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .header-right {
        justify-content: space-between;
    }
    
    .search-container {
        order: 2;
        margin-top: 8px;
        width: 100%;
    }
}

/* Search Container - Mobile (Icon Only) */
.search-container {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
}

.search-box {
    position: relative;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: all 0.3s ease;
    width: 100%;
    height: 36px;
    cursor: pointer;
    gap: 8px;
}

.search-box:hover {
    border-color: #ff6600;
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.15);
}

.search-box i {
    color: #6c757d;
    font-size: 14px;
    transition: color 0.3s ease;
}

.search-box:hover i {
    color: #ff6600;
}

/* Show search input and placeholder on mobile */
.search-box input {
    display: block;
    border: none;
    outline: none;
    background: transparent;
    font-size: 12px;
    color: #495057;
    flex: 1;
    min-width: 0;
}

.search-box input::placeholder {
    color: transparent;
}

.placeholder-overlay {
    display: block;
    position: absolute;
    left: 35px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #6c757d;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Search Results */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    display: none;
    margin-top: 4px;
}

.result-category {
    padding: 8px 0;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 12px;
}

.result-item:hover {
    background-color: #f8f9fa;
}

.result-item i {
    color: #ff6600;
    font-size: 12px;
    width: 16px;
}

/* Currency Selector */
.currency-selector {
    position: relative;
    flex-shrink: 0;
}

.selected-currency {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    color: #495057;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.selected-currency:hover {
    border-color: #ff6600;
    background: #fff;
}

.selected-currency i {
    font-size: 8px;
    color: #6c757d;
}

.currency-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1002;
    display: none;
    margin-top: 4px;
    min-width: 80px;
}

.currency-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 10px;
}

.currency-option:hover {
    background-color: #f8f9fa;
}

.currency-flag {
    font-size: 12px;
}

.currency-code {
    font-weight: 500;
    color: #495057;
}

.currency-symbol {
    color: #6c757d;
    margin-left: auto;
}

/* Login Button */
.login-btn {
    background: transparent;
    border: 1px solid #ff6600;
    color: #ff6600;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}

.login-btn:hover {
    background: #ff6600;
    color: white;
    transform: translateY(-1px);
}

/* ========================================
   SMALL DEVICES (sm: 576px - 767px)
   Large Mobile / Small Tablets
   ======================================== */
@media (min-width: 576px) {
    .top-header {
        padding: 10px 0;
    }
    
    .header-content {
        gap: 12px;
        min-height: 55px;
    }
    
    .logo {
        min-width: 50px;
    }
    
    .logo img {
        height: 45px;
    }
    
    .header-right {
        gap: 10px;
    }
    
    .search-box {
        width: 40px;
        height: 40px;
        padding: 10px;
    }
    
    .search-box i {
        font-size: 15px;
    }
    
    .result-item {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .result-item i {
        font-size: 13px;
    }
    
    .selected-currency {
        padding: 7px 10px;
        font-size: 11px;
        gap: 5px;
    }
    
    .selected-currency i {
        font-size: 9px;
    }
    
    .currency-dropdown {
        min-width: 90px;
    }
    
    .currency-option {
        font-size: 11px;
        padding: 8px 10px;
    }
    
    .login-btn {
        font-size: 11px;
        padding: 7px 12px;
    }
}

/* ========================================
   MEDIUM DEVICES (md: 768px - 991px)
   Tablets
   ======================================== */
@media (min-width: 768px) {
    .top-header {
        padding: 12px 0;
    }
    
    .header-content {
        gap: 16px;
        min-height: 60px;
    }
    
    .logo {
        min-width: 60px;
    }
    
    .logo img {
        height: 50px;
    }
    
    .header-right {
        gap: 15px;
    }
    
    /* Show full search bar on tablets and up */
    .search-container {
        flex: 1;
        max-width: 250px;
        min-width: 180px;
    }
    
    .search-box {
        width: 100%;
        height: 42px;
        padding: 10px 15px;
        border-radius: 25px;
        gap: 10px;
        justify-content: flex-start;
    }
    
    .search-box i {
        font-size: 16px;
        flex-shrink: 0;
    }
    
    /* Show search input and placeholder */
    .search-box input {
        display: block;
        border: none;
        outline: none;
        background: transparent;
        font-size: 13px;
        color: #495057;
        flex: 1;
        min-width: 0;
    }
    
    .search-box input::placeholder {
        color: transparent;
    }
    
    .placeholder-overlay {
        display: block;
        position: absolute;
        left: 45px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 13px;
        color: #6c757d;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .search-box input:focus + .placeholder-overlay,
    .search-box input:not(:placeholder-shown) + .placeholder-overlay {
        opacity: 0;
    }
    
    /* Make search results display on focus */
    .search-box:focus-within .search-results {
        display: block;
    }
    
    #dynamic-text {
        color: #ff6600;
        font-weight: 500;
    }
    
    .search-results {
        min-width: 200px;
    }
    
    .result-item {
        font-size: 14px;
        padding: 12px 16px;
    }
    
    .result-item i {
        font-size: 14px;
        width: 18px;
    }
    
    .selected-currency {
        padding: 8px 12px;
        font-size: 12px;
        gap: 6px;
    }
    
    .selected-currency i {
        font-size: 10px;
    }
    
    .currency-dropdown {
        min-width: 100px;
    }
    
    .currency-option {
        font-size: 12px;
        padding: 10px 12px;
    }
    
    .login-btn {
        font-size: 12px;
        padding: 8px 16px;
    }
}

/* ========================================
   LARGE DEVICES (lg: 992px - 1199px)
   Laptops
   ======================================== */
@media (min-width: 992px) {
    .top-header {
        padding: 15px 0;
    }
    
    .header-content {
        gap: 20px;
        min-height: 65px;
    }
    
    .logo {
        min-width: 70px;
    }
    
    .logo img {
        height: 55px;
    }
    
    .header-right {
        gap: 20px;
    }
    
    .search-container {
        max-width: 300px;
        min-width: 220px;
    }
    
    .search-box {
        height: 45px;
        padding: 12px 18px;
        gap: 12px;
    }
    
    .search-box i {
        font-size: 17px;
    }
    
    .search-box input {
        font-size: 14px;
    }
    
    .placeholder-overlay {
        left: 50px;
        font-size: 14px;
    }
    
    .result-item {
        font-size: 15px;
        padding: 14px 18px;
    }
    
    .result-item i {
        font-size: 15px;
        width: 20px;
    }
    
    .selected-currency {
        padding: 10px 14px;
        font-size: 13px;
        gap: 7px;
    }
    
    .selected-currency i {
        font-size: 11px;
    }
    
    .currency-dropdown {
        min-width: 110px;
    }
    
    .currency-option {
        font-size: 13px;
        padding: 12px 14px;
    }
    
    .login-btn {
        font-size: 13px;
        padding: 10px 20px;
    }
}

/* ========================================
   EXTRA LARGE DEVICES (xl: ≥1200px)
   Desktops
   ======================================== */
@media (min-width: 1200px) {
    .top-header {
        padding: 18px 0;
    }
    
    .header-content {
        gap: 25px;
        min-height: 70px;
    }
    
    .logo {
        min-width: 80px;
    }
    
    .logo img {
        height: 60px;
    }
    
    .header-right {
        gap: 25px;
    }
    
    .search-container {
        max-width: 350px;
        min-width: 250px;
    }
    
    .search-box {
        height: 48px;
        padding: 14px 20px;
        gap: 15px;
    }
    
    .search-box i {
        font-size: 18px;
    }
    
    .search-box input {
        font-size: 15px;
    }
    
    .placeholder-overlay {
        left: 55px;
        font-size: 15px;
    }
    
    .result-item {
        font-size: 16px;
        padding: 16px 20px;
    }
    
    .result-item i {
        font-size: 16px;
        width: 22px;
    }
    
    .selected-currency {
        padding: 12px 16px;
        font-size: 14px;
        gap: 8px;
    }
    
    .selected-currency i {
        font-size: 12px;
    }
    
    .currency-dropdown {
        min-width: 120px;
    }
    
    .currency-option {
        font-size: 14px;
        padding: 14px 16px;
    }
    
    .login-btn {
        font-size: 14px;
        padding: 12px 24px;
    }
}

/* ========================================
   INTERACTIVE STATES
   ======================================== */

/* Search box focus state */
.search-box:focus-within {
    border-color: #ff6600;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

/* Currency dropdown active state */
.currency-selector.active .currency-dropdown {
    display: block;
}

.currency-selector.active .selected-currency {
    border-color: #ff6600;
    background: #fff;
}

/* Search results active state */
.search-container.active .search-results {
    display: block;
}

/* Smooth transitions */
* {
    transition: all 0.3s ease;
}

/* Focus accessibility */
.search-box:focus-visible,
.selected-currency:focus-visible,
.login-btn:focus-visible {
    outline: 2px solid #ff6600;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .top-header {
        box-shadow: none;
        border-bottom: 1px solid #ddd;
    }
}