/* =====================================================
   HEADER STYLES - Navigacija i header elementi
   ===================================================== */

/* Main Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-header, 1000);
    padding: 1rem 0;
    padding-bottom: 1.5rem;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transition: all var(--transition-normal, 0.3s ease);
    overflow: visible;
}

.header--scrolled {
    padding: 0.75rem 0;
    background: rgba(10, 10, 15, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Header Inner - Main Layout */
.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* Logo - Burger Icon Style */
.header__logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.header__logo:hover .header__logo-img {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 15px rgba(255, 107, 53, 0.5));
}

.header__logo-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.header__logo-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary, #ff6b35), var(--primary-dark, #e55a2b));
    border-radius: 14px;
    font-size: 1.5rem;
    color: #fff;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.header__logo:hover .header__logo-icon {
    transform: scale(1.05) rotate(-5deg);
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.4);
}

.header__logo-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.header__logo-text {
    font-family: var(--font-display, 'Clash Display', sans-serif);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--text-primary, #fff);
    letter-spacing: -0.02em;
}

.header__logo-text strong {
    font-weight: 700;
    background: var(--gradient-primary, linear-gradient(135deg, #ff6b35, #ff8f5a));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (max-width: 768px) {
    .header__logo-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .header__logo-text {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .header__logo-text {
        display: none;
    }
}

/* Navigation */
.header__nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header__nav a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-weight: 500;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.header__nav a:hover,
.header__nav a.active {
    color: #fff;
    background: rgba(255, 107, 53, 0.15);
}

/* App Link in Navigation - Special Styling */
.header__nav-app {
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.2), rgba(255, 107, 0, 0.08)) !important;
    border: 1px solid rgba(255, 107, 0, 0.25);
    color: #ff6b00 !important;
    font-weight: 600 !important;
}

.header__nav-app:hover {
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.3), rgba(255, 107, 0, 0.15)) !important;
    border-color: rgba(255, 107, 0, 0.4);
    color: #ff8c00 !important;
}

.header__nav-app i {
    font-size: 0.9rem;
}

/* Header Actions */
.header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    overflow: visible;
    padding-bottom: 20px;
    margin-bottom: -20px;
}

/* Cart Button */
.header__cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--glass-bg, rgba(255,255,255,0.05));
    border: 1px solid var(--glass-border, rgba(255,255,255,0.1));
    color: var(--text-primary, #fff);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header__cart:hover {
    background: var(--gradient-primary);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
}

.header__cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--gradient-primary);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

/* Cart Price Badge */
.header__cart-price {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 8px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    animation: pricePopIn 0.3s ease;
    z-index: 10;
}

@keyframes pricePopIn {
    from {
        transform: translateX(-50%) scale(0.5);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
}

/* Ensure cart button doesn't clip price badge */
.header__cart {
    overflow: visible;
}

.header__actions {
    overflow: visible;
}

/* Mobile Menu Toggle - Hamburger Icon */
.header__menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    /* iOS Safari touch fix */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
    position: relative;
    z-index: 1001;
}

.header__menu-toggle:hover {
    background: rgba(255, 107, 53, 0.15);
    border-color: rgba(255, 107, 53, 0.3);
}

.header__menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary, #fff);
    border-radius: 2px;
    transition: all 0.3s ease;
    margin: 2px 0;
}

.header__menu-toggle.is-active {
    background: rgba(255, 107, 53, 0.2);
    border-color: var(--primary);
}

.header__menu-toggle.is-active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.header__menu-toggle.is-active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.header__menu-toggle.is-active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Navigation */
@media (max-width: 991px) {
    .header__menu-toggle {
        display: flex;
    }
    
    .header__nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 320px;
        max-width: 100%;
        height: 100vh;
        height: -webkit-fill-available;
        height: calc(var(--vh, 1vh) * 100);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.5rem;
        padding: 100px 2rem 2rem;
        padding-bottom: env(safe-area-inset-bottom, 2rem);
        background: rgba(15, 15, 20, 0.98);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        border-left: 1px solid rgba(255,255,255,0.1);
        -webkit-transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        /* iOS Safari fix */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    .header__nav.is-open {
        right: 0;
    }
    
    .header__nav a {
        padding: 1rem 1.25rem;
        font-size: 1.1rem;
        border-radius: 12px;
        /* iOS touch fix */
        -webkit-tap-highlight-color: transparent;
    }
}

/* Nav Overlay */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: calc(var(--z-header, 1000) - 1);
}

.nav-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* User Menu Dropdown */
.header__user-menu {
    position: relative;
}

.header__user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.header__user-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header__user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.header__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    padding: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.header__user-menu:hover .header__dropdown,
.header__dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header__dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.header__dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.header__dropdown-item--danger {
    color: var(--danger);
}

.header__dropdown-item--danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}
/* =====================================================
   LANDSCAPE & ADDITIONAL RESPONSIVE STYLES
   ===================================================== */

/* Landscape mode - reduce header height */
@media (orientation: landscape) and (max-height: 500px) {
    .header {
        padding: 0.5rem 0;
    }
    
    .header__logo-img {
        width: 36px;
        height: 36px;
    }
    
    .header__logo-text {
        font-size: 1rem;
    }
    
    .header__cart-btn {
        padding: 0.5rem;
    }
    
    .header__nav.is-open {
        padding-top: 70px;
    }
}

/* Small screens - compact header */
@media (max-width: 375px) {
    .header__container {
        padding: 0 0.75rem;
    }
    
    .header__logo-text {
        font-size: 1rem;
    }
    
    .header__logo-img {
        width: 38px;
        height: 38px;
    }
    
    .header__cart-count {
        font-size: 0.65rem;
        min-width: 16px;
        height: 16px;
    }
}