/* ===== HEADER & CART FIXES ===== */

:root {
  --header-h: 64px; /* Fallback, wird per JS überschrieben */
}

/* Header immer sichtbar mit fixed position */
.header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
  background-color: var(--primary-green) !important;
  width: 100% !important;
}

/* Inhalt unter den Header schieben */
body {
  padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px)) !important;
  display: block !important;
  position: relative !important;
}

/* Style wenn gescrolled (Schatten, Hintergrund, etc.) */
.header.scrolled {
  box-shadow: 0 6px 20px rgba(0,0,0,.08) !important;
  backdrop-filter: saturate(140%) blur(6px) !important;
}

/* Cart positioning fixes with highest priority */
.cart-dropdown,
.simple-cart-dropdown {
    position: fixed !important;
    top: calc(var(--header-h, 64px) + 8px) !important; /* Position below header with small gap */
    right: 50px !important;
    z-index: 999 !important;
}

/* Responsive cart positioning - more to the left on PC */
@media (min-width: 1024px) {
    .cart-dropdown,
    .simple-cart-dropdown {
        right: 100px !important;
        width: 420px !important;
    }
}

@media (min-width: 1280px) {
    .cart-dropdown,
    .simple-cart-dropdown {
        right: 150px !important;
        width: 450px !important;
    }
}

/* Mobile cart positioning */
@media (max-width: 768px) {
    .cart-dropdown,
    .simple-cart-dropdown {
        top: calc(var(--header-h, 64px) + 4px) !important; /* Closer to header on mobile */
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-width: none !important;
    }
}

/* Ensure search button stays in correct position */
.header .search-btn {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}