/* ===========================================================================
   Projekt-Ergaenzungen zum eStore-Theme.

   Regel: Das Original (static/theme/css/estore.css) wird NIE bearbeitet.
   Alle Anpassungen stehen hier und ueberschreiben gezielt.
   =========================================================================== */

/* Sprungmarke fuer Tastaturnutzer */
.skip-link {
    position: absolute;
    top: .5rem;
    left: .5rem;
    z-index: 1080;
    padding: .5rem 1rem;
    background: #fff;
    border-radius: .375rem;
}

/* Warenkorb-Zaehler im Header */
.header-action-btn .badge {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    line-height: 18px;
    border-radius: 9px;
    background: var(--theme-primary, #0d6efd);
    color: #fff;
}

.header-action-btn { position: relative; }

/* Mandanten-Hinweisleiste (nur Betreiber-/Lieferantenbereiche) */
.tenant-bar {
    background: var(--theme-secondary, #6c757d);
    color: #fff;
    font-size: .875rem;
}

.tenant-bar a { color: #fff; text-decoration: underline; }

/* Produktkachel: einheitliche Bildhoehe ohne Verzerrung */
.product-thumb {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    width: 100%;
    background: #f6f7f9;
}

@media (prefers-reduced-motion: reduce) {
    [data-aos] { transition: none !important; }
}

/* ---------------------------------------------------------------------------
   Header-Varianten (Theme-Einstellung bzw. Shop.theme_config)
   --------------------------------------------------------------------------- */

/* transparent: Header liegt ueber dem Hero, wird beim Scrollen deckend */
.header-transparent .header {
    position: absolute;
    inset-inline: 0;
    z-index: 1030;
    background: transparent;
}

.header-transparent.scrolled .header {
    position: fixed;
    background: #fff;
    box-shadow: 0 .125rem .5rem rgba(0, 0, 0, .08);
}

.header-transparent .main-header .sitename,
.header-transparent .navmenu > ul > li > a {
    color: #fff;
}

.header-transparent.scrolled .main-header .sitename,
.header-transparent.scrolled .navmenu > ul > li > a {
    color: inherit;
}

/* zentriert: Logo mittig, Navigation darunter */
.header-centered .main-header .d-flex {
    flex-direction: column;
    gap: .75rem;
}

.header-centered .main-header .logo {
    justify-content: center;
}

@media (min-width: 992px) {
    .header-centered .header-nav .navmenu > ul {
        justify-content: center;
    }
}

/* ---------------------------------------------------------------------------
   Arbeitsbereiche (Lieferantenportal, Betreiberbereich)
   --------------------------------------------------------------------------- */
.portal-page .main { background: #f7f8fa; }

.portal-sidebar {
    position: sticky;
    top: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: .5rem;
    box-shadow: 0 .125rem .5rem rgba(0, 0, 0, .05);
}

.portal-nav .list-group-item {
    border: 0;
    border-radius: .375rem;
    padding: .55rem .75rem;
}

.portal-nav .list-group-item.active {
    background: var(--theme-primary, #0d6efd);
    color: #fff;
}

.portal-page .card { border: 0; box-shadow: 0 .125rem .5rem rgba(0, 0, 0, .05); }

.stat-tile { position: relative; }

.portal-table th { font-weight: 600; white-space: nowrap; }

.image-tile img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: .375rem;
}

/* ---------------------------------------------------------------------------
   Produktkacheln, Galerie und Warenkorb
   --------------------------------------------------------------------------- */
.product-thumb { position: relative; overflow: hidden; }

.product-thumb-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #f6f7f9;
    transition: transform .2s ease;
}

.product-box:hover .product-thumb-img { transform: scale(1.03); }

.product-label {
    position: absolute;
    top: .5rem;
    left: .5rem;
    z-index: 2;
    padding: .15rem .5rem;
    font-size: .75rem;
    border-radius: .25rem;
    background: var(--theme-primary, #0d6efd);
    color: #fff;
}

.add-to-cart-container {
    position: absolute;
    inset-inline: .5rem;
    bottom: .5rem;
    opacity: 0;
    transform: translateY(.5rem);
    transition: opacity .2s ease, transform .2s ease;
}

.product-box:hover .add-to-cart-container,
.product-box:focus-within .add-to-cart-container {
    opacity: 1;
    transform: none;
}

@media (hover: none) {
    /* Auf Touchgeraeten dauerhaft sichtbar - sonst unerreichbar. */
    .add-to-cart-container { opacity: 1; transform: none; position: static; margin-top: .5rem; }
}

.main-image { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #f6f7f9; }

.thumbnail-item.active { outline: 2px solid var(--theme-primary, #0d6efd); }

.quantity-selector { max-width: 9rem; }

.cart-item + .cart-item { border-top: 1px solid #e9ecef; }

.checkout-section .section-number {
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--theme-primary, #0d6efd);
    color: #fff;
    font-size: .875rem;
}

/* ---------------------------------------------------------------------------
   Content-Bausteine (StreamField)
   --------------------------------------------------------------------------- */
.theme-hero { position: relative; overflow: hidden; display: flex; align-items: center; }
.theme-hero--sm { min-height: 32vh; }
.theme-hero--md { min-height: 50vh; }
.theme-hero--lg { min-height: 70vh; }

.theme-hero__image,
.theme-banner__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .35;
}

.theme-banner { position: relative; overflow: hidden; }
.theme-banner--primary { background: var(--theme-primary, #0d6efd); color: #fff; }
.theme-banner--dark { background: #212529; color: #fff; }
.theme-banner--light { background: #f6f7f9; }

.info-card { padding: 1.5rem; background: #fff; border-radius: .5rem; height: 100%; }

.theme-slider .carousel-caption {
    background: rgba(0, 0, 0, .45);
    border-radius: .5rem;
    padding: 1.25rem;
}
