/* ======================================
   CactusIO Store Header - Mobile Optimiert
   Floating Design mit verbesserter Touch-Usability
====================================== */

/* ======================================
   FLOATING HEADER DESIGN - MOBILE OPTIMIERT
====================================== */
#header {
    background: var(--store-glass);
    backdrop-filter: blur(120px);
    -webkit-backdrop-filter: blur(120px);
    border: 1px solid var(--store-glass-border);
    border-radius: 20px;
    padding: 0.8rem 1rem;
    width: 95%;
    max-width: 1920px;
    height: auto;
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    transition: var(--header-transition);
    box-shadow: var(--header-shadow);
    display: flex;
    align-items: center;
    animation: headerSlideDown 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    /* Mobile Performance */
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

#header.scrolled {
    background: rgba(0, 0, 0, 0.9);
    top: 8px;
    border-radius: 15px;
    padding: 0.6rem 1rem;
    box-shadow: var(--header-shadow-scrolled);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

#header.hidden {
    transform: translate(-50%, -100%);
    opacity: 0.8;
}

@keyframes headerSlideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ======================================
   HEADER CONTAINER LAYOUT - RESPONSIVE
====================================== */
.header-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 1rem;
    display: grid;
    
    grid-template-columns: 200px 1fr 280px;
    align-items: center;
    gap: 2rem;
    height: 100%;
    box-sizing: border-box;
}

/* ======================================
   LOGO STYLES - TOUCH OPTIMIERT
====================================== */
.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    justify-self: start;
    /* Mobile Touch */
    min-height: 44px;
    min-width: 44px;
    transition: 
        background-color 0.3s ease,
        transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.header-logo img {
    height: 50px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    transition: 
        background-color 0.3s ease,
        transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-logo:hover img {
    transform: scale(1.07);
    transition: 
        background-color 0.3s ease,
        transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.3s ease;
}

#header.scrolled .header-logo img {
    height: 35px;
    transition: var(--header-transition);

}

/* ======================================
   SEARCH CONTAINER - MOBILE OPTIMIERT
====================================== */
.search-container {
    justify-self: center;
    width: 100%;
    max-width: 600px;
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    background: var(--store-glass);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--store-glass-border);
    color: var(--store-text);
    border-radius: 25px;
    padding: 0.8rem 3rem 0.8rem 1.5rem;
    font-size: 0.9rem;
    outline: none;
    transition: var(--header-transition);
    font-family: 'fatfrank', Arial, sans-serif;
    /* Mobile Touch */
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: var(--store-primary);
    box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.2);
    background: var(--store-surface);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    opacity: 0.8;
}

.search-button {
    position: absolute;
    right: 5px; /* Leichte Anpassung für besseres Aussehen */
    top: 50%;
    transform: translateY(-50%);
    background: var(--store-primary);
    border: none;
    color: var(--store-dark);
    width: 38px;  /* Angepasst */
    height: 38px; /* Angepasst */
    border-radius: 50%;
    cursor: pointer;
    transition: var(--header-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    /* Mobile Touch */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.search-button:hover {
    background: var(--store-primary-hover);
    transform: translateY(-50%) scale(1.05); /* Transform anpassen */
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

/* ======================================
   SEARCH RESULTS - MOBILE OPTIMIERT
====================================== */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
    background: var(--store-glass);
    backdrop-filter: blur(120px);
    -webkit-backdrop-filter: blur(120px);
    border: 1px solid var(--store-glass-border);
    border-radius: 20px;
    margin-top: 5px;
    box-shadow: 
        0 8px 32px var(--store-shadow),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    z-index: 1000;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Mobile Performance */
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-sizing: border-box;
}

.search-results.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.search-results-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.03);
    position: sticky;
    top: 0;
    z-index: 1;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px 20px 0 0;
}

.search-results-count {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    font-weight: 500;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    transition: var(--header-transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    outline: none;
    backdrop-filter: blur(10px);
    /* Mobile Touch */
    min-height: 60px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.active,
.search-result-item:focus {
    background: rgba(255, 255, 255, 0.06);
    border-left: 3px solid var(--store-primary);
    backdrop-filter: blur(20px);
}

.search-result-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 1rem;
    flex-shrink: 0;
    background: var(--store-glass);
    backdrop-filter: blur(10px);
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.search-result-name {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-name mark {
    background: var(--store-primary);
    color: var(--store-dark);
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    font-weight: 700;
}

.search-result-category {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-price {
    color: var(--store-primary);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.search-result-stock {
    font-size: 0.75rem;
    font-weight: 500;
}

.search-result-stock.in-stock {
    color: var(--store-success);
}

.search-result-stock.low-stock {
    color: var(--store-warning);
}

.search-result-stock.out-of-stock {
    color: var(--store-error);
}

.search-result-actions {
    margin-left: 1rem;
    flex-shrink: 0;
}

.search-add-to-cart {
    background: var(--store-primary);
    color: var(--store-dark);
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: var(--header-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    /* Mobile Touch */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.search-add-to-cart:hover {
    background: var(--store-primary-hover);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.search-add-to-cart:disabled {
    background: var(--store-text-muted);
    cursor: not-allowed;
    transform: none;
}

.search-results-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.01);
    position: sticky;
    bottom: 0;
    backdrop-filter: blur(30px);
    border-radius: 0 0 20px 20px;
}

.search-view-all {
    width: 100%;
    background: transparent;
    color: var(--store-primary);
    border: 1px solid var(--store-primary);
    border-radius: 8px;
    padding: 0.8rem;
    cursor: pointer;
    transition: var(--header-transition);
    font-weight: 600;
    backdrop-filter: blur(10px);
    /* Mobile Touch */
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.search-view-all:hover {
    background: var(--store-primary);
    color: var(--store-dark);
}

.search-loading,
.search-no-results,
.search-error {
    padding: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.search-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--store-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-results-icon,
.search-error-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results-suggestions {
    text-align: left;
    margin-top: 1rem;
    max-width: 250px;
    margin-left: auto;
    margin-right: auto;
}

.no-results-suggestions ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.no-results-suggestions li {
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}


/* ======================================
   HEADER ACTIONS - MOBILE OPTIMIERT
====================================== */
.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    position: relative;
}

/* ======================================
   CART BUTTON - TOUCH OPTIMIERT
====================================== */
.cart-button {
    position: relative;
    background: var(--store-glass);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--store-glass-border);
    color: var(--store-text);
    border-radius: 12px;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: var(--header-transition);
    display: flex;
    align-items: center;
    transition: 
        background-color 0.3s ease,
        transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.3s ease;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: 0.5s;
    font-family: 'fatfrank', Arial, sans-serif;
    position: relative;
    overflow: hidden;
    /* Mobile Touch */
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.cart-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: var(--header-transition);
}

.cart-button:hover {
    background: var(--store-primary-hover);
    transition: 0.5s;
    color: var(--store-dark);
    transform: translateY(-2px);
    transition: 
        background-color 0.3s ease,
        transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
}

.cart-button:hover::before {
    left: 100%;
}

.cart-count {
    background: var(--store-primary);
    color: var(--store-dark);
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 0.25rem;
    transition: var(--header-transition);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.cart-count.empty {
    display: none;
}

.cart-count.has-items {
    animation: cartBounce 0.3s ease-out;
}

@keyframes cartBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}


/* ======================================
   USER PROFILE - TOUCH OPTIMIERT
====================================== */
.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-button,
.user-button {
    background: var(--store-glass);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--store-glass-border);
    color: var(--store-text);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: var(--header-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    /* Mobile Touch */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.profile-button:hover,
.user-button:hover {
    background: var(--store-primary);
    color: var(--store-dark);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
}

.profile-button img,
.user-button img {
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center center;
    border-radius: 50%;
    transition: var(--header-transition);
    opacity: 1;
    visibility: visible;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    transform: scale(1.05);
}

.profile-button .profile-icon,
.profile-button i,
.user-button .profile-icon,
.user-button i {
    font-size: 1.2rem;
    transition: var(--header-transition);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    visibility: hidden;
    z-index: 1;
}

.profile-button.no-avatar img,
.user-button.no-avatar img {
    opacity: 0;
    visibility: hidden;
    display: none;
    transform: scale(0);
}

.profile-button.no-avatar .profile-icon,
.profile-button.no-avatar i,
.user-button.no-avatar .profile-icon,
.user-button.no-avatar i {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.user-button.authenticated {
    border: 2px solid var(--store-glass-border);
    width: 48px;
    height: 48px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.user-button.authenticated:hover {
    transform: scale(1.07);
    border-color: var(--store-primary);
}

.user-button.authenticated img {
    transform: scale(1.1);
    border-radius: 50%;
}

.profile-button.loading,
.user-button.loading {
    opacity: 0.7;
    cursor: wait;
}

.profile-button.loading::after,
.user-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid var(--store-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.profile-button.error,
.user-button.error {
    border-color: var(--store-error);
}

.profile-button.error .profile-icon,
.profile-button.error i,
.user-button.error .profile-icon,
.user-button.error i {
    color: var(--store-error);
}

.profile-button::before,
.user-button::before {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: var(--store-success);
    border: 2px solid var(--store-dark);
    border-radius: 50%;
    opacity: 0;
    transition: var(--header-transition);
    z-index: 5;
}

.profile-button.online::before,
.user-button.online::before {
    opacity: 1;
    background: var(--store-success);
}

.profile-button.offline::before,
.user-button.offline::before {
    opacity: 1;
    background: var(--store-text-muted);
}

/* ======================================
   USER DROPDOWN POSITIONING
====================================== */
.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 2000;
}

/* ======================================
   LOGIN BUTTON - TOUCH OPTIMIERT
====================================== */
.login-button {
    background: var(--store-primary);
    color: var(--store-dark);
    border: none;
    border-radius: 12px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--header-transition);
    white-space: nowrap;
    font-family: 'fatfrank', Arial, sans-serif;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
    /* Mobile Touch */
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: var(--header-transition);
}

.login-button:hover {
    background: var(--store-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.4);
}

.login-button:hover::before {
    left: 100%;
}

/* ======================================
   LIGHT MODE ADJUSTMENTS
====================================== */
body.light-mode {
    --store-dark: #ffffff;
    --store-surface: #f5f5f5;
    --store-glass: rgba(255, 255, 255, 0.85);
    --store-glass-border: rgba(0, 0, 0, 0.08);
    --store-text: #333333;
    --store-text-muted: #666666;
    --store-shadow: rgba(0, 0, 0, 0.15);
}

body.light-mode #header {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body.light-mode #header.scrolled {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 255, 136, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

body.light-mode .search-input {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .search-input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

body.light-mode .search-results {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05) inset;
}

body.light-mode .search-results-count {
    color: rgba(0, 0, 0, 0.5);
}

body.light-mode .search-result-name {
    color: rgba(0, 0, 0, 0.8);
}

body.light-mode .search-result-category {
    color: rgba(0, 0, 0, 0.4);
}

body.light-mode .search-loading,
body.light-mode .search-no-results,
body.light-mode .search-error {
    color: rgba(0, 0, 0, 0.5);
}

/* =================================================================== */
/* =================================================================== */
/* ==                                                               == */
/* ==      ERWEITERTE MOBILE RESPONSIVE DESIGN (ÜBERARBEITET)       == */
/* ==                                                               == */
/* =================================================================== */
/* =================================================================== */


/* Tablets & große Smartphones (bis 992px) */
@media (max-width: 992px) {
    #header {
        width: 96%;
    }
    
    .header-container {
        /* OPTIMIERT: Flexibleres Grid-Layout */
        grid-template-columns: auto 1fr auto; /* Logo (auto) | Suche (flexibel) | Aktionen (auto) */
        gap: 1.5rem;
        padding: 0 0.8rem;
    }
}


/* Mobile Geräte (bis 768px) */
@media (max-width: 768px) {
    #header {
        width: 95%;
        top: 10px;
        padding: 0.6rem;
        border-radius: 16px;
    }
    
    #header.scrolled {
        top: 5px;
        padding: 0.5rem;
        border-radius: 12px;
    }
    
    .header-container {
        /* NEU: Umstellung auf zweizeiliges Layout für bessere Bedienbarkeit. */
        /* Das Profilbild bleibt so immer oben in der ersten Zeile sichtbar. */
        grid-template-columns: auto 1fr; /* Spalten: Logo | Aktionen */
        grid-template-rows: auto auto;    /* Zwei Zeilen */
        grid-template-areas: 
            "logo actions"   /* Zeile 1: Logo links, Aktionen rechts */
            "search search"; /* Zeile 2: Suche über die volle Breite */
        gap: 0.8rem;
        padding: 0;
    }

    /* NEU: Zuweisung der Elemente zu den Grid-Bereichen */
    .header-logo { grid-area: logo; }
    .search-container { grid-area: search; }
    .header-actions { grid-area: actions; }
    
    .header-logo img {
        height: 35px;
    }

    .search-container {
        max-width: none; /* Erlaubt der Suche, die volle Breite einzunehmen */
        padding: 0 0.2rem; /* Kleiner horizontaler Abstand */
    }

    .search-input {
        padding: 0.6rem 2.8rem 0.6rem 1rem;
        font-size: 0.85rem;
        border-radius: 20px;
    }

    .search-button {
        width: 34px;
        height: 34px;
    }

    /* NEU: Text im Cart-Button ausblenden und in ein reines Icon umwandeln */
    .cart-button .cart-text {
        display: none;
    }
    .cart-button {
        padding: 0.5rem; /* Padding anpassen für reines Icon */
        width: 44px; /* Feste Größe für konsistentes Aussehen */
        height: 44px;
        justify-content: center;
        gap: 0;
    }
    .cart-count {
        position: absolute;
        top: 2px;
        right: 2px;
        margin-left: 0;
    }

    .profile-button,
    .user-button {
        width: 44px;
        height: 44px;
    }
    
    .login-button {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        border-radius: 10px;
    }
    
    .search-results {
        max-height: 300px;
    }
}


/* Kleine Smartphones (bis 480px) */
@media (max-width: 480px) {
    #header {
        width: calc(100% - 16px);
        top: 8px;
        padding: 0.5rem;
        border-radius: 12px;
    }
    
    #header.scrolled {
        top: 4px;
        border-radius: 10px;
    }

    .header-container {
        gap: 0.5rem;
    }

    .header-logo img {
        height: 32px;
    }
    
    .search-input {
        padding: 0.5rem 2.5rem 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .search-button {
        width: 30px;
        height: 30px;
    }
    
    .cart-button,
    .profile-button,
    .user-button {
        width: 40px;
        height: 40px;
    }

    .header-actions {
        gap: 0.5rem;
    }
    
    .login-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
}

/* ======================================
   ACCESSIBILITY IMPROVEMENTS
====================================== */
.search-input:focus,
.search-button:focus,
.cart-button:focus,
.profile-button:focus,
.user-button:focus,
.login-button:focus,
.search-view-all:focus,
.search-add-to-cart:focus {
    outline: 2px solid var(--store-primary);
    outline-offset: 2px;
}

.search-result-item:focus {
    outline: 2px solid var(--store-primary);
    outline-offset: -2px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ======================================
   SCROLLBAR STYLING - MOBILE OPTIMIERT
====================================== */
.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    backdrop-filter: blur(10px);
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Light mode scrollbar */
body.light-mode .search-results::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
}

body.light-mode .search-results::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

body.light-mode .search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* ======================================
   PERFORMANCE OPTIMIZATIONS
====================================== */
#header,
.search-results,
.profile-button,
.user-button,
.cart-button,
.login-button {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* GPU-Beschleunigung für Touch-Interaktionen auf Mobile */
@media (max-width: 768px) {
    .header-logo,
    .search-button,
    .cart-button,
    .profile-button,
    .user-button,
    .login-button,
    .search-result-item,
    .search-add-to-cart {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
}

/* ======================================
   REDUCED MOTION SUPPORT
====================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    #header {
        animation: none;
    }
    
    .profile-button.loading::after,
    .user-button.loading::after {
        animation: none;
    }
    
    .cart-count.has-items {
        animation: none;
    }
}

/* ======================================
   HIGH CONTRAST MODE
====================================== */
@media (prefers-contrast: high) {
    #header,
    .search-results,
    .cart-button,
    .profile-button,
    .user-button,
    .login-button {
        border: 2px solid var(--store-text);
    }
    
    .search-input {
        border: 2px solid var(--store-text);
    }
}

