/**
 * reussMEDIA Shop – Frontend Styles
 * Ergänzt das simple-cms theme.css.php
 */

/* === LAYOUT === */
.shop-page { font-family: var(--font-body, system-ui, sans-serif); color: var(--color-text, #222); }
.shop-main { padding: 32px 0 64px; min-height: 60vh; }
.shop-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
/* Mobile: Inhalt soll moeglichst breit sein damit Produktkarten und Tabellen Platz haben.
   Stattdessen nur sehr schmaler Seitenrand (8px statt 20px). */
@media (max-width: 768px) {
    .shop-container { padding: 0 8px; }
    .shop-main { padding: 20px 0 40px; }
    .shop-header-inner { padding: 0 12px; }
    .shop-footer-inner { padding: 0 12px; }
}

/* === HEADER === */
.shop-header { background: var(--color-bg, #fff); border-bottom: 1px solid #e5e5e5; padding: 16px 0; }
.shop-header-inner { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.shop-logo { font-size: 1.4rem; font-weight: 700; text-decoration: none; color: inherit; }
.shop-nav { display: flex; gap: 24px; align-items: center; }
.shop-nav a { color: inherit; text-decoration: none; }
.shop-nav a:hover { color: var(--color-primary, #0066cc); }
.cart-link { position: relative; }
.cart-badge { background: var(--color-primary, #0066cc); color: white; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 600; margin-left: 4px; }

/* === FOOTER === */
.shop-footer { background: #fafafa; border-top: 1px solid #e5e5e5; padding: 32px 0; margin-top: 48px; font-size: 14px; color: #666; }
.shop-footer-inner { display: flex; justify-content: space-between; gap: 24px; max-width: 1200px; margin: 0 auto; padding: 0 20px; flex-wrap: wrap; }
.shop-footer a { color: inherit; }

/* === KATEGORIEN === */
.shop-categories { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.shop-cat-tile { padding: 8px 16px; background: #f0f0f0; border-radius: 999px; text-decoration: none; color: inherit; transition: background 0.2s; }
.shop-cat-tile:hover { background: var(--color-primary, #0066cc); color: white; }
.shop-cat-desc { color: #666; max-width: 700px; margin-bottom: 24px; }

/* === PRODUKT-GRID === */
.shop-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; align-items: stretch; }
.shop-product-grid > * { height: 100%; min-width: 0; }
.product-card-wrap { position: relative; display: flex; flex-direction: column; height: 100%; width: 100%; background: white; border: 1px solid #eee; border-radius: 8px; overflow: hidden; transition: box-shadow 0.2s, transform 0.2s; }
.product-card-wrap:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-2px); border-color: #0066cc; }
.product-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; flex: 1 1 auto; width: 100%; min-height: 0; }
.product-card-img { aspect-ratio: 4/3; background-size: cover; background-position: center; background-color: #f5f5f5; flex-shrink: 0; }
.product-card-body { padding: 16px; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.product-card-body h3 { margin: 0 0 8px; font-size: 1rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-body p { color: #666; font-size: 14px; margin: 0 0 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Preis: Streichpreis oben, aktueller Preis darunter */
.product-card-price { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: auto; min-height: 0; }
.product-card-price s { color: #999; font-size: 13px; font-weight: normal; }
.product-card-price strong { font-size: 1.1rem; color: var(--color-text, #222); white-space: nowrap; }

/* Add-to-Cart Button — eigene Zeile unter dem Preis, voll-breit */
.product-card-add { margin: 0; padding: 0 12px 12px; }
.product-card-add button { border: 1.5px solid #1a1a1a; background: white; width: 100%; height: 40px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.15s; padding: 0; font-size: 14px; font-weight: 500; color: #1a1a1a; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) {
    .product-card-add button:hover { background: #1a1a1a; color: white; }
    .product-card-add button:hover svg { fill: white; }
}
.product-card-add button svg { fill: #1a1a1a; transition: fill 0.15s; flex-shrink: 0; }

/* Wishlist-Herz oben rechts */
.product-card-wishlist { position: absolute; top: 12px; right: 12px; margin: 0; z-index: 5; }
.product-card-wishlist button { border: none; background: rgba(255,255,255,0.95); width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; transition: all 0.15s; box-shadow: 0 2px 8px rgba(0,0,0,0.12); -webkit-tap-highlight-color: transparent; }
@media (hover: hover) {
    .product-card-wishlist button:hover { background: white; transform: scale(1.1); }
}

/* === PRODUKTDETAIL === */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.product-detail-images img.product-main-img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #f5f5f5; }
.product-thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.product-thumbs img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; cursor: pointer; border: 2px solid transparent; }
.product-thumbs img:hover { border-color: var(--color-primary, #0066cc); }
.product-detail-info h1 { margin-top: 0; font-size: 1.6rem; line-height: 1.2; }
.product-price { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin: 16px 0; }
.product-price s { color: #999; font-size: 1rem; }
.product-price strong { font-size: 1.6rem; color: var(--color-text, #222); }
.product-price small { color: #888; font-size: 12px; margin-top: 2px; }
.product-stock { padding: 6px 12px; border-radius: 4px; font-size: 14px; display: inline-block; margin-bottom: 16px; }
.product-stock.in-stock { background: #d4edda; color: #155724; }
.product-stock.out-of-stock { background: #f8d7da; color: #721c24; }
.product-short { color: #555; line-height: 1.6; margin: 16px 0 24px; font-size: 15px; }
.product-description { margin-top: 32px; line-height: 1.7; font-size: 15px; }

/* Detail "In den Warenkorb" — gleiche Optik wie auf der Karte */
.add-to-cart-form { display: flex; gap: 12px; align-items: center; margin: 24px 0; padding: 20px; background: #fafafa; border-radius: 8px; flex-wrap: wrap; }
.add-to-cart-form label { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: #555; }
.add-to-cart-form input[type=number] { width: 70px; height: 40px; padding: 0 8px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; box-sizing: border-box; }
/* Spezifisch genug, um btn/btn-primary/btn-lg zu überschreiben */
.add-to-cart-form button[type=submit],
.add-to-cart-form button.btn,
.add-to-cart-form button.btn-primary,
.add-to-cart-form button.btn-lg {
    border: 1.5px solid #1a1a1a !important;
    background: white !important;
    height: 40px !important;
    padding: 0 24px !important;
    border-radius: 6px !important;
    cursor: pointer;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #1a1a1a !important;
    transition: all 0.15s;
    flex: 1;
    min-width: 180px;
    box-sizing: border-box;
    line-height: 1;
    opacity: 1 !important;
}
@media (hover: hover) {
    .add-to-cart-form button[type=submit]:hover {
        background: #1a1a1a !important;
        color: white !important;
    }
}

/* === BUTTONS === */
.btn { display: inline-block; padding: 10px 20px; background: #ddd; color: #333; text-decoration: none; border-radius: 4px; border: none; cursor: pointer; font: inherit; transition: opacity 0.2s; }
.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--color-primary, #0066cc); color: white; }
.btn-lg { padding: 12px 28px; font-size: 1.05rem; }
.btn-link { background: transparent; border: none; color: #b00020; cursor: pointer; padding: 4px 8px; font-size: 1.2rem; }

/* === WARENKORB === */
.cart-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.cart-table th, .cart-table td { padding: 12px; text-align: left; border-bottom: 1px solid #eee; }
.cart-table th { background: #fafafa; font-weight: 600; }
.cart-shipping { margin: 24px 0; padding: 20px; background: #fafafa; border-radius: 8px; }
.cart-shipping h3 { margin-top: 0; }
.shipping-option { display: flex; gap: 12px; padding: 12px; border: 1px solid #eee; border-radius: 6px; margin-bottom: 8px; cursor: pointer; align-items: flex-start; }
.shipping-option:hover { background: white; border-color: var(--color-primary, #0066cc); }
.shipping-option input { margin-top: 4px; }
.cart-totals { margin-top: 24px; padding: 20px; background: #fafafa; border-radius: 8px; max-width: 380px; margin-left: auto; }
.cart-totals > div { display: flex; justify-content: space-between; padding: 4px 0; }
.cart-total-line { border-top: 2px solid #333; margin-top: 8px; padding-top: 12px; font-size: 1.2rem; }
.cart-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* === CHECKOUT === */
.checkout-form { max-width: 700px; }
.checkout-section { margin-bottom: 32px; padding: 24px; background: white; border: 1px solid #eee; border-radius: 8px; }
.checkout-section h3, .checkout-section h4 { margin-top: 0; }
.checkout-section label { display: block; margin-bottom: 12px; font-size: 14px; color: #555; }
.checkout-section input[type=text], .checkout-section input[type=email], .checkout-section input[type=tel], .checkout-section input[type=password], .checkout-section select, .checkout-section textarea {
  display: block; width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; font: inherit; box-sizing: border-box; margin-top: 4px;
}
.checkout-section .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* Checkbox + Label nebeneinander, aber:
   - align-items: flex-start statt center -> bei mehrzeiligen Texten bleibt Checkbox oben
   - line-height: 1.5 fuer bessere Lesbarkeit langer Texte (AGB/Datenschutz)
   - flex-shrink: 0 auf Input damit Checkbox bei wenig Platz nicht gequetscht wird
   - word-wrap fuer lange Links/Wortbestandteile */
.checkout-section label.checkbox { 
    display: flex; 
    gap: 10px; 
    align-items: flex-start; 
    cursor: pointer; 
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.checkout-section label.checkbox input { 
    width: auto; 
    margin: 0; 
    flex-shrink: 0;
    margin-top: 3px; /* Kleine Korrektur damit Checkbox optisch auf Hoehe des Textbeginns sitzt */
}
.checkout-section label.checkbox a { word-break: break-word; }
.payment-option { display: flex; gap: 12px; padding: 12px; border: 1px solid #eee; border-radius: 6px; margin-bottom: 8px; cursor: pointer; align-items: center; }
.payment-option:hover { border-color: var(--color-primary, #0066cc); }
.payment-option input { margin: 0; }
.checkout-summary { background: #fafafa; padding: 20px; border-radius: 8px; margin-bottom: 24px; }
.checkout-summary > div { display: flex; justify-content: space-between; padding: 4px 0; }
.checkout-summary .total-line { border-top: 2px solid #333; margin-top: 8px; padding-top: 12px; font-size: 1.2rem; }

/* === ALERTS === */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-info { background: #cce5ff; color: #004085; border: 1px solid #b8daff; }

/* === KUNDENKONTO === */
.account-layout { display: grid; grid-template-columns: 220px 1fr; gap: 32px; }
@media (max-width: 768px) { .account-layout { grid-template-columns: 1fr; } }
.account-nav { list-style: none; padding: 0; margin: 0; }
.account-nav li { margin-bottom: 4px; }
.account-nav a { display: block; padding: 10px 14px; border-radius: 6px; text-decoration: none; color: inherit; }
.account-nav a:hover, .account-nav a.active { background: var(--color-primary, #0066cc); color: white; }
.account-form { max-width: 500px; }
.account-form label { display: block; margin-bottom: 12px; font-size: 14px; color: #555; }
.account-form input, .account-form select, .account-form textarea {
  display: block; width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; font: inherit; box-sizing: border-box; margin-top: 4px;
}
.account-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.account-form label.checkbox { display: flex; gap: 8px; align-items: center; }
.account-form label.checkbox input { width: auto; margin: 0; }
.account-orders { width: 100%; border-collapse: collapse; }
.account-orders th, .account-orders td { padding: 10px; border-bottom: 1px solid #eee; text-align: left; }
.address-card { padding: 16px; border: 1px solid #eee; border-radius: 6px; margin-bottom: 12px; line-height: 1.5; }

/* ============================================
   MOBILE RESPONSIVE - SHOP
   ============================================ */
@media (max-width: 768px) {
    /* Grid: 2-Spalten auf Tablet/Mobile */
    .shop-product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    /* Karten kompakter */
    .product-card-img { aspect-ratio: 1 / 1; }
    .product-card-body { padding: 12px; }
    .product-card-body h3 { font-size: 14px; margin-bottom: 6px; }
    .product-card-body p { font-size: 12px; margin-bottom: 10px; }
    .product-card-price strong { font-size: 15px; }
    .product-card-price s { font-size: 12px; }
    .product-card-add { padding: 0 10px 10px; }
    .product-card-add button { height: 36px; font-size: 13px; gap: 6px; }
    .product-card-add button svg { width: 14px; height: 14px; }
    /* Wishlist-Herz kompakter */
    .product-card-wishlist { top: 8px; right: 8px; }
    .product-card-wishlist button { width: 32px; height: 32px; }
    .product-card-wishlist button svg { width: 16px; height: 16px; }

    /* Produkt-Detailseite */
    .product-detail { grid-template-columns: 1fr; gap: 20px; }
    .product-detail-info h1 { font-size: 1.3rem; }
    .product-price strong { font-size: 1.3rem; }
    .product-price s { font-size: 0.9rem; }
    .product-short { font-size: 14px; margin: 12px 0 16px; }
    .product-description { font-size: 14px; margin-top: 20px; line-height: 1.6; }
    .product-thumbs img { width: 60px; height: 60px; }
    .add-to-cart-form { padding: 14px; gap: 10px; margin: 16px 0; }
    .add-to-cart-form input[type=number] { height: 40px; }
    .add-to-cart-form button[type=submit],
    .add-to-cart-form button.btn,
    .add-to-cart-form button.btn-primary,
    .add-to-cart-form button.btn-lg { height: 40px !important; font-size: 13px !important; padding: 0 16px !important; min-width: 140px; }

    /* Kategorie-Pills */
    .shop-categories { flex-wrap: wrap; gap: 6px; }
    .shop-cat-tile { font-size: 13px; padding: 6px 12px; }

    /* Cart, Checkout */
    .cart-table { font-size: 13px; }
    .cart-table th, .cart-table td { padding: 8px 4px !important; }
    .cart-totals { max-width: 100% !important; margin-left: 0 !important; }
    .checkout-form .form-row { grid-template-columns: 1fr !important; }
    /* Mobile: weniger Innenpolster, damit AGB/Datenschutz-Text mehr Platz hat */
    .checkout-section { padding: 16px !important; margin-bottom: 16px !important; }
    .checkout-section label.checkbox { font-size: 13px; }
    .checkout-summary { padding: 14px !important; }

    .shop-plugin-subnav {
        justify-content: center !important;
        gap: 6px !important;
        font-size: 13px !important;
        padding: 8px 12px !important;
    }
    .shop-plugin-subnav .ssn-link { padding: 4px 6px !important; }
}

@media (max-width: 480px) {
    .shop-product-grid { gap: 8px !important; }
    .product-card-body { padding: 10px; }
    .product-card-body h3 { font-size: 13px; -webkit-line-clamp: 2; }
    .product-card-body p { font-size: 11px; -webkit-line-clamp: 2; margin-bottom: 8px; }
    .product-card-price strong { font-size: 14px; }
    .product-card-price s { font-size: 11px; }
    .product-card-add { padding: 0 8px 8px; }
    .product-card-add button { height: 32px; font-size: 11px; }

    /* Detail noch kompakter */
    .product-detail-info h1 { font-size: 1.15rem; }
    .product-price strong { font-size: 1.2rem; }
    .product-short { font-size: 13px; }
    .product-description { font-size: 13px; }
}

@media (max-width: 380px) {
    .product-card-add-label { display: none; }
}

/* ============================================
   KATEGORIE-PILLS MIT UNTERKATEGORIEN
   ============================================ */
.shop-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    align-items: flex-start;
}
.shop-cat-tile {
    display: inline-block;
    padding: 8px 16px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 999px;
    font-size: 14px;
    transition: all 0.2s;
}
.shop-cat-tile:hover { background: #e0e0e0; }
.shop-cat-tile.active {
    background: #0066cc;
    color: white;
}
.shop-cat-group {
    position: relative;
}
.shop-cat-group .shop-cat-subs {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-top: 4px;
    padding: 6px;
    min-width: 180px;
    z-index: 10;
}
.shop-cat-group:hover .shop-cat-subs,
.shop-cat-group.active .shop-cat-subs,
.shop-cat-group:focus-within .shop-cat-subs {
    display: block;
}
.shop-cat-sub {
    display: block;
    padding: 6px 12px;
    color: #555;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}
.shop-cat-sub:hover { background: #f5f5f5; color: #0066cc; }
.shop-cat-sub.active {
    background: #0066cc;
    color: white;
}

/* ============================================
   SHOP TOP-NAVI (Zalando-Style)
   ============================================ */
.shop-topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 24px;
    padding-bottom: 4px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-radius: 8px 8px 0 0;
    padding: 8px 16px;
    flex-wrap: wrap;
}

.shop-topnav-bar {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.shop-topnav-item {
    position: relative;
}

.shop-topnav-link {
    display: inline-block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    white-space: nowrap;
}

.shop-topnav-link:hover {
    color: #0066cc;
}

.shop-topnav-link.active,
.shop-topnav-item.active > .shop-topnav-link {
    color: #0066cc;
    border-bottom-color: #0066cc;
}

.shop-topnav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 200px;
    padding: 8px;
    z-index: 100;
}

.shop-topnav-item.has-subs:hover .shop-topnav-dropdown,
.shop-topnav-item.has-subs:focus-within .shop-topnav-dropdown {
    display: block;
}

.shop-topnav-sub {
    display: block;
    padding: 8px 14px;
    color: #444;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}

.shop-topnav-sub:hover {
    background: #f5f5f5;
    color: #0066cc;
}

.shop-topnav-sub.active {
    background: #e7f0ff;
    color: #0066cc;
    font-weight: 500;
}

.shop-search {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #ddd;
    border-radius: 999px;
    padding: 4px 4px 4px 14px;
    min-width: 220px;
    flex: 0 0 auto;
}

.shop-search input[type="search"] {
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    font-size: 14px;
    padding: 6px 0;
    min-width: 0;
}

.shop-search button {
    border: none;
    background: #0066cc;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
}

.shop-search button:hover { background: #0055aa; }

.shop-cat-heading {
    font-size: 24px;
    margin: 0 0 16px;
    color: #222;
}

@media (max-width: 768px) {
    .shop-topnav {
        flex-direction: column;
        align-items: stretch;
        padding: 8px;
    }

    .shop-topnav-bar {
        order: 2;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
        margin: 0 -8px;
        padding: 0 8px;
    }

    .shop-topnav-link {
        padding: 8px 12px;
        font-size: 14px;
    }

    .shop-search {
        order: 1;
        min-width: 100%;
        margin-bottom: 8px;
    }

    /* Dropdown auf mobil als Akkordeon (nur per :focus-within) */
    .shop-topnav-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        background: #f8f9fa;
        margin-top: 4px;
        border-radius: 4px;
    }
}

/* === WISHLIST HERZ === */
.product-card-wishlist { position: absolute; top: 12px; right: 12px; margin: 0; z-index: 5; }
.product-card-wishlist button {
    border: none; background: rgba(255,255,255,0.95);
    width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center; padding: 0;
    transition: all 0.15s; backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.product-card-wishlist button:hover { background: white; transform: scale(1.1); }
/* Standardmäßig: Outline anzeigen, Filled verstecken */
/* Aktiv: Filled anzeigen, Outline verstecken */
