/* ===================================
   Amazon-Style Mobile Header
   =================================== */

.mobile-header-amazon {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #131921;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Top Bar - Menu + Logo + Cart + Account */
.mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 12px 0px;
    background: #263248;
    gap: 10px;
}

.mobile-menu-trigger {
    flex-shrink: 0;
    cursor: pointer;
}

.mobile-menu-trigger i {
    font-size: 22px;
    color: #fff;
}

.mobile-menu-trigger .burger-icon {
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-trigger .burger-icon span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff !important;
    margin: 4px 0;
    transition: 0.3s;
}

.burger-icon-white span {
    background: #fff !important;
}

.mobile-left-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-logo-left img {
    height: 34px;
    max-width: 130px;
    object-fit: contain;
}

.mobile-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.mobile-cart-icon {
    position: relative;
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
}

.mobile-cart-icon i { font-size: 18px; }

.mobile-cart-icon .cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ff9900;
    color: #131921;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

.mobile-account-icon {
    color: #fff;
    font-size: 18px;
}

.mobile-account-icon i {
    font-size: 18px;
}

/* Search Bar */
.mobile-search-bar {
    padding: 0px 12px 0px;
    background: #263248;
}

.search-wrapper {
    height: 32px;
    padding: 0px 0px 0px 8px;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.search-wrapper .search-icon {
    display: none;
}

.search-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 8px;
    font-size: 14px;
    background: transparent;
}

.search-wrapper input::placeholder {
    color: #999;
}

.search-wrapper .search-btn {
    background: #ff9900;
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.search-wrapper .search-btn:hover {
    background: #f08804;
}

.search-wrapper .search-btn i {
    color: #131921;
    font-size: 16px;
}

/* Delivery Location Bar */
.mobile-delivery-bar {
    padding: 8px 12px 9px;
    background: #232f3e;
    border-top: 1px solid #3a4553;
}

.delivery-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.delivery-icon {
    color: #fff;
    font-size: 16px !important;
    flex-shrink: 0;
}

.delivery-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.delivery-label {
    font-size: 10px;
    color: #ccc;
    line-height: 0;
    margin-bottom: 1px;
}

.delivery-select {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 0;
    outline: none;
    cursor: pointer;
    width: 100%;
}

.delivery-select option {
    background: #232f3e;
    color: #fff;
}

/* Promo Badge */
/* Search suggestions */
.search-suggestions {
    display: none;
    background: #fff;
    border-radius: 8px;
    margin-top: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    max-height: 220px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 10px 12px;
    font-size: 14px;
    color: #222;
    cursor: pointer;
    display: block;
    text-decoration: none;
}

.suggestion-item:hover { background: #f5f5f5; }

/* Add spacing to body content when header is fixed */
@media (max-width: 991px) {
    body {
        padding-top: 135px;
        padding-bottom: 56px;
    }
    
    /* Hide old mobile header elements */
    .header-action-icon-2.d-block.d-lg-none,
    .header-action-right.d-block.d-lg-none {
        display: none !important;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 130px;
        padding-bottom: 50px;
    }
}

@media (max-width: 375px) {
    body {
        padding-top: 120px;
        padding-bottom: 48px;
    }
}

@media (max-width: 320px) {
    body {
        padding-top: 110px;
        padding-bottom: 46px;
    }
}

/* RTL Support for Arabic */
[dir="rtl"] .mobile-top-bar,
[dir="rtl"] .mobile-actions-right,
[dir="rtl"] .delivery-wrapper {
    direction: rtl;
}

[dir="rtl"] .mobile-cart-icon .cart-count {
    right: auto;
    left: -10px;
}

[dir="rtl"] .search-wrapper .search-icon {
    padding: 0 12px 0 0;
}

[dir="rtl"] .search-wrapper input {
    text-align: right;
}

/* Additional Enhancements */
.mobile-header-amazon * {
    -webkit-tap-highlight-color: transparent;
}

.mobile-top-bar,
.mobile-search-bar,
.mobile-delivery-bar {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bottom Navigation Bar - Fixed horizontal layout */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-around;
    align-items: center;
    padding: 6px 4px;
    z-index: 2000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}

/* Hide on large screens (768px and above) */
@media (min-width: 768px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

.mobile-bottom-nav .nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px;
    color: #565959;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    padding: 6px 2px;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
    flex: 1;
    text-align: center;
    min-height: 48px;
}

@media (max-width: 480px) {
    .mobile-bottom-nav .nav-item {
        padding: 5px 2px;
        font-size: 9px;
        min-height: 44px;
    }
    
    .mobile-bottom-nav .nav-item i {
        font-size: 18px;
    }
}

@media (max-width: 375px) {
    .mobile-bottom-nav .nav-item {
        padding: 4px 1px;
        font-size: 8px;
        gap: 2px;
        min-height: 40px;
    }
    
    .mobile-bottom-nav .nav-item i {
        font-size: 16px;
    }
}

@media (max-width: 320px) {
    .mobile-bottom-nav .nav-item {
        padding: 3px 1px;
        font-size: 7px;
        min-height: 38px;
    }
    
    .mobile-bottom-nav .nav-item i {
        font-size: 14px;
    }
}

.mobile-bottom-nav .nav-item i { 
    font-size: 22px;
    transition: transform 0.2s ease;
}

.mobile-bottom-nav .nav-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.mobile-bottom-nav .nav-item:hover {
    color: #ff9900;
    background: #fff7ed;
}

.mobile-bottom-nav .nav-item:hover i {
    transform: scale(1.1);
}

.mobile-bottom-nav .nav-item:active {
    transform: scale(0.95);
}

/* Cart Badge */
.mobile-bottom-nav .nav-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-bottom-nav .nav-cart-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #ff4444;
    color: #fff;
    font-size: 9px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Safe Area for modern devices */
@supports (padding: env(safe-area-inset-bottom)) {
    .mobile-bottom-nav {
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }
}

/* Active State (auto-detected by URL) */
body[data-page="home"] .mobile-bottom-nav a[href="/"],
body[data-page="categories"] .mobile-bottom-nav a[href*="category-list"],
body[data-page="cart"] .mobile-bottom-nav a[href*="cart"],
body[data-page="account"] .mobile-bottom-nav a[href*="my-account"] {
    color: #ff9900;
    background: #fff7ed;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .mobile-header-amazon { background: #0f1111; }
    .mobile-search-bar { background: #0f1111; }
    .search-wrapper { background: #111; }
    .search-wrapper .search-icon { color: #ccc; }
    .search-wrapper input { color: #fff; }
    
    /* Bottom Nav Dark Mode */
    .mobile-bottom-nav {
        background: #1a1a1a;
        border-top-color: #333;
    }
    .mobile-bottom-nav .nav-item {
        color: #e0e0e0;
    }
    .mobile-bottom-nav .nav-item:hover {
        background: #2a2a2a;
        color: #ff9900;
    }
    .search-wrapper input::placeholder { color: #aaa; }
    .search-wrapper .search-btn { background: #ff9900; }
    .mobile-delivery-bar { background: #1b2530; border-top-color: #2a3644; }
    .delivery-select option { background: #1b2530; }
    .mobile-quick-categories { background: #0f1111; }
    .quick-cat-item { background: #1b2530; }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .mobile-top-bar {
        margin-bottom: -13px;
        padding: 4px 8px;
        gap: 8px;
    }
    
    .mobile-logo-left img {
        height: 38px;
        max-width: 100px;
    }
    
    .mobile-menu-trigger i {
        font-size: 20px;
    }
    
    .mobile-cart-icon,
    .mobile-account-icon {
        font-size: 20px;
    }
    
    .mobile-actions-right {
        gap: 8px;
    }
    
    .mobile-search-bar {
        padding: 6px 8px;
    }
    
    .search-wrapper input {
        padding: 8px 6px;
        font-size: 13px;
    }
    
    .search-wrapper .search-btn {
        padding: 8px 20px;
    }
    
    .mobile-delivery-bar {
        padding: 6px 8px;
    }
    
    .delivery-content {
        gap: 2px;
    }
    
    .delivery-label {
        margin-top: 8px;
        font-size: 11px;
    }
    
    .delivery-select {
        font-size: 12px;
    }
    
    body {
        padding-top: 130px;
    }
}

@media (max-width: 375px) {
    .mobile-top-bar {
        padding: 5px 6px;
        margin-bottom: -13px;
    }
    
    .mobile-logo-left img {
        height: 36px;
    }
    
    .mobile-menu-trigger i {
        font-size: 18px;
    }
    
    .mobile-cart-icon,
    .mobile-account-icon {
        font-size: 18px;
    }
    
    .mobile-actions-right {
        gap: 6px;
    }
    
    .mobile-search-bar {
        padding: 5px 6px;
    }
    
    .search-wrapper input {
        padding: 6px 5px;
        font-size: 12px;
    }
    
    .search-wrapper .search-btn {
        padding: 6px 8px;
    }
    
    .search-wrapper .search-btn i {
        font-size: 14px;
    }
    
    .mobile-delivery-bar {
        padding: 5px 6px;
    }
    
    .delivery-icon {
        font-size: 16px;
    }
    
    body {
        padding-top: 120px;
    }
}

@media (max-width: 320px) {
    .mobile-top-bar {
        padding: 4px 4px;
        gap: 4px;
    }
    
    .mobile-logo-left img {
        height: 36px;
        max-width: 100%;
    }
    
    .mobile-menu-trigger i {
        font-size: 16px;
    }
    
    .mobile-cart-icon,
    .mobile-account-icon {
        font-size: 16px;
    }
    
    .mobile-actions-right {
        gap: 4px;
    }
    
    body {
        padding-top: 110px;
    }
}

@media (min-width: 481px) and (max-width: 767px) {
    .mobile-top-bar {
        padding: 6px 12px;
    }
    
    .mobile-logo-left img {
        height: 36px;
        max-width: 100%;
    }
    
    body {
        padding-top: 135px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .mobile-logo-left img {
        height: 36px;
        max-width: 100%;
    }
}

/* ===================================
   Hero Slider Full Size on Mobile
   =================================== */
@media only screen and (max-width: 767px) {
    /* Make slider full width and remove border radius */
    .hero-slider-1 .single-hero-slider {
        height: auto !important;
        min-height: 300px;
        border-radius: 0 !important;
        background-size: cover !important;
        background-position: center center !important;
    }
    
    /* Make slider images full size */
    .hero-slider-1 img {
        width: 100% !important;
        max-height: none !important;
        height: auto !important;
        border-radius: 0 !important;
        object-fit: cover;
    }
    
    /* Adjust slider container */
    .hero-slider-1 {
        margin: 0 !important;
        border-radius: 0 !important;
    }
    
    /* Make single slider image container full size */
    .hero-slider-1 .single-slider-img-1 {
        height: auto !important;
        min-height: 300px;
    }
    
    /* Adjust slider content positioning for better visibility */
    .hero-slider-1 .slider-content {
        left: 5%;
        right: 5%;
        padding: 15px;
    }
    
    /* Make slider wrapper full width */
    .home-slider {
        margin-left: -15px !important;
        margin-right: -15px !important;
    }
    
    /* Remove container padding for slider section */
    .section-padding.pb-5 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}
