/* ==========================================================================
   TINY MARKET STYLES v5.3 (Image Fixes: Contain)
   ========================================================================== */

   :root {
    --header-height: 80px;
    --cart-width: 420px;
    
    /* Z-Index Layer Management */
    --z-filter: 900;
    --z-cart-backdrop: 2000;
    --z-cart-drawer: 2001;
    --z-modal-backdrop: 3000;
    --z-modal-content: 3001;
    --z-modal-close: 3002;
}

/* ==========================================================================
   0. HEADER & CART BUTTON (NEW STYLE)
   ========================================================================== */
.nav-icons {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 20px;
}

#cart-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 2px solid var(--dark-color);
    color: var(--dark-color);
    padding: 8px 20px;
    border-radius: 50px;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1;
}

#cart-btn:hover {
    background: var(--dark-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#cart-btn i {
    font-size: 1.1rem;
}

.cart-count {
    background: var(--primary-color);
    color: var(--dark-color);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

/* Mobile Adjustments for Header Button */
@media (max-width: 900px) {
    .nav-icons {
        gap: 15px;
    }

    #cart-btn {
        border: none;
        padding: 5px;
        position: relative;
        background: transparent;
    }
    
    #cart-btn:hover {
        background: transparent;
        color: var(--primary-color);
        box-shadow: none;
        transform: none;
    }

    #cart-btn .cart-label-text {
        display: none; /* Text ausblenden auf Mobile */
    }

    #cart-btn i {
        font-size: 1.6rem; /* Größeres Icon */
    }

    .cart-count {
        position: absolute;
        top: -2px;
        right: -2px;
        background: var(--secondary-color); /* Rot für bessere Sichtbarkeit */
        color: #fff;
        font-size: 0.7rem;
        padding: 2px 5px;
        min-width: 18px;
        height: 18px;
        display: flex; align-items: center; justify-content: center;
        border: 2px solid #fff; /* Kleiner weißer Rand zur Abgrenzung */
    }
}


/* ==========================================================================
   1. HERO SECTION
   ========================================================================== */
.shop-hero {
    background-color: var(--dark-color); 
    color: var(--light-color);
    padding: 140px 5% 60px 5%;
    text-align: center;
    position: relative;
    background: radial-gradient(circle at 80% 20%, rgba(255, 201, 52, 0.08), transparent 40%), var(--dark-color);
}

.shop-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.highlight-text {
    color: var(--primary-color);
}

.search-bar-container {
    max-width: 600px;
    margin: 30px auto 0;
    position: relative;
}

.search-bar-container input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border-radius: 50px;
    border: 2px solid transparent;
    font-family: var(--font-family);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.search-bar-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(255, 201, 52, 0.2);
}

.search-bar-container i {
    position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
    color: var(--dark-color);
}

/* ==========================================================================
   2. STICKY FILTER BAR
   ========================================================================== */
.filter-bar-sticky {
    position: sticky;
    top: 80px; /* Header Höhe */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(69, 53, 50, 0.08);
    z-index: var(--z-filter);
    padding: 15px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

.filter-scroll-container {
    display: flex; justify-content: center; gap: 10px;
    overflow-x: auto; padding: 5px 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.filter-scroll-container::-webkit-scrollbar { display: none; }

.filter-chip {
    padding: 8px 22px;
    border-radius: 50px;
    border: 1px solid #ddd;
    background: #fff;
    color: var(--dark-color);
    font-family: var(--font-family);
    font-weight: 600; font-size: 0.9rem;
    cursor: pointer; white-space: nowrap;
    transition: all 0.3s ease;
}

.filter-chip:hover {
    border-color: var(--dark-color);
    transform: translateY(-2px);
}

.filter-chip.active {
    background: var(--dark-color);
    color: #fff;
    border-color: var(--dark-color);
    box-shadow: 0 5px 15px rgba(69, 53, 50, 0.3);
}

/* ==========================================================================
   3. PRODUCT GRID (SHOWCASE STYLE)
   ========================================================================== */
.shop-content {
    background-color: #fafafa;
    min-height: 80vh;
    padding: 60px 5%;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 40px;
    padding-bottom: 40px;
}

.empty-shop-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-shop-state i { font-size: 3rem; margin-bottom: 20px; opacity: 0.3; }

/* POP CARD STYLES */
.pop-card {
    display: flex; flex-direction: column; align-items: center;
    position: relative; overflow: visible; 
    cursor: pointer; transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}
.pop-card:hover { z-index: 10; }
.pop-card:active { transform: scale(0.98); }

.pop-title {
    font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    color: #999; margin-bottom: 15px; text-align: center; transition: color 0.3s;
}
.pop-card:hover .pop-title { color: var(--primary-color); }

.pop-image-wrapper {
    position: relative; width: 100%; display: flex; justify-content: center;
    z-index: 10; margin-bottom: -50px; pointer-events: none;
    animation: floatImage 5s ease-in-out infinite; will-change: transform;
}
.pop-img {
    width: auto; max-width: 85%; height: 200px; object-fit: contain;
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.25));
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
    transform-origin: center bottom;
}
@keyframes floatImage { 
    0% { transform: translateY(0); } 50% { transform: translateY(-12px); } 100% { transform: translateY(0); } 
}
.pop-card:hover .pop-img {
    transform: scale(1.15) translateY(-10px) rotate(2deg);
    filter: drop-shadow(0 30px 45px rgba(0,0,0,0.35));
}

.pop-card-body {
    background: #fff; width: 100%; padding: 70px 20px 30px 20px;
    border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    text-align: center; position: relative; z-index: 1;
    transition: all 0.4s ease; border: 1px solid rgba(0,0,0,0.03);
}
.pop-card:hover .pop-card-body {
    transform: translateY(8px); box-shadow: 0 20px 50px rgba(0,0,0,0.12); border-color: var(--primary-color);
}
.pop-badge {
    display: inline-block; background-color: var(--light-color); color: var(--dark-color);
    padding: 4px 12px; border-radius: 50px; font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; margin-bottom: 1rem;
}
.card-price {
    display: block; font-size: 1.2rem; font-weight: 800; color: var(--primary-color); margin-top: 5px;
}

/* ==========================================================================
   4. SHOPPING CART DRAWER
   ========================================================================== */
.cart-backdrop {
    position: fixed; inset: 0; background: rgba(69, 53, 50, 0.6); backdrop-filter: blur(4px);
    z-index: var(--z-cart-backdrop); opacity: 0; visibility: hidden; transition: opacity 0.3s ease;
}
.cart-backdrop.active { opacity: 1; visibility: visible; }

.cart-drawer {
    position: fixed; top: 0; right: 0; width: 100%; max-width: var(--cart-width); height: 100%;
    background: #fff; z-index: var(--z-cart-drawer); transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 40px rgba(0,0,0,0.15); display: flex; flex-direction: column;
}
.cart-drawer.active { transform: translateX(0); }

.cart-header {
    padding: 25px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; background: #fff;
}
.close-cart {
    width: 40px; height: 40px; border: none; background: var(--light-color); color: var(--dark-color);
    border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.close-cart:hover { background: var(--primary-color); color: #fff; }

.cart-items-container { flex: 1; overflow-y: auto; padding: 20px; background: #fafafa; }

.cart-item {
    background: #fff; border-radius: 16px; padding: 12px; margin-bottom: 15px; display: flex; gap: 15px; align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03); border: 1px solid #eee;
}

/* FIX: Cart Image Contain */
.cart-item-img { 
    width: 65px; height: 65px; 
    border-radius: 10px; 
    object-fit: contain; /* Kein Zoom mehr */
    background: #fff;    /* Weißer Hintergrund für sauberen Look */
    border: 1px solid #eee; 
    padding: 3px;        /* Etwas Abstand zum Rand */
}

.cart-item-title { font-weight: 700; color: var(--dark-color); font-size: 0.95rem; }
.cart-item-price { color: #888; font-size: 0.85rem; }
.qty-mini-btn { width: 28px; height: 28px; background: #fff; border: 1px solid #ddd; border-radius: 8px; cursor: pointer; font-weight: 600; }
.cart-item-controls { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.cart-item-remove { margin-left: auto; color: var(--secondary-color); cursor: pointer; padding: 5px; }

.cart-footer { padding: 30px; background: #fff; border-top: 1px solid #eee; box-shadow: 0 -5px 20px rgba(0,0,0,0.02); }
.cart-total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.total-price { font-size: 1.5rem; color: var(--dark-color); font-weight: 800; }
.shipping-note { font-size: 0.8rem; color: #999; margin-bottom: 20px; text-align: right; }

.cta-button.btn-block {
    background: var(--primary-color); color: var(--dark-color); padding: 16px; border-radius: 50px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; width: 100%; border: none; cursor: pointer; box-shadow: 0 5px 15px rgba(255, 201, 52, 0.3);
}
.cta-button.btn-block:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255, 201, 52, 0.4); }

/* ==========================================================================
   5. PRODUCT MODAL
   ========================================================================== */
.product-modal {
    position: fixed; inset: 0; z-index: var(--z-modal-backdrop);
    display: flex; align-items: flex-start; justify-content: center;
    opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.3s ease;
    overflow-y: auto; padding: 20px 0;
}
.product-modal.active { opacity: 1; visibility: visible; pointer-events: auto; }

.product-modal .modal-backdrop {
    position: fixed; inset: 0; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(20px);
}

.modal-content-wrapper {
    position: relative; z-index: var(--z-modal-content); width: 100%; max-width: 1100px; padding: 20px; margin: auto;
}

.modal-close-btn {
    position: absolute; top: 0; right: 20px; z-index: 100;
    width: 50px; height: 50px; border-radius: 50%; background: #fff; border: 1px solid #eee; font-size: 1.5rem;
    cursor: pointer; box-shadow: 0 5px 20px rgba(0,0,0,0.1); color: var(--dark-color); display: flex; align-items: center; justify-content: center; transition: all 0.3s;
}
.modal-close-btn:hover { background: var(--dark-color); color: #fff; transform: rotate(90deg); }

.modal-grid { display: flex; align-items: center; justify-content: center; min-height: 60vh; }

.modal-left-col { flex: 1.2; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; z-index: 10; }
.modal-img-container { width: 100%; display: flex; justify-content: center; margin-bottom: 20px; }
.modal-main-img { 
    max-width: 100%; max-height: 70vh; width: auto; 
    object-fit: contain; /* Sicherstellen dass auch Hauptbild nicht verzerrt */
    filter: drop-shadow(0 40px 80px rgba(0,0,0,0.6)); 
    will-change: transform; 
}

/* FIX: Modal Thumbnails Contain */
.modal-thumbnails { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.modal-thumbnails img { 
    width: 60px; height: 60px; 
    object-fit: contain; /* Kein Zoom */
    background: #fff;    /* Weißer Hintergrund */
    border-radius: 10px; 
    border: 2px solid #eee; 
    cursor: pointer; opacity: 0.7; transition: all 0.2s; 
    padding: 2px;
}
.modal-thumbnails img.active { border-color: var(--primary-color); opacity: 1; transform: scale(1.1); }

.modal-right-col {
    flex: 0.8; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px);
    padding: 50px; border-radius: 30px; box-shadow: 0 20px 60px rgba(0,0,0,0.08); border: 1px solid rgba(255,255,255,0.5);
    margin-left: -80px; z-index: 5; transform: translateX(100px); opacity: 0; transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.product-modal.active .modal-right-col { transform: translateX(0); opacity: 1; transition-delay: 0.2s; }

.modal-badge { display: inline-block; color: var(--primary-color); font-weight: 800; text-transform: uppercase; letter-spacing: 2px; font-size: 0.9rem; margin-bottom: 0.5rem; }
.modal-title { font-size: 2.5rem; line-height: 1.1; font-weight: 800; margin-bottom: 1rem; color: var(--dark-color); }
.price-row { display: flex; align-items: center; gap: 20px; margin-bottom: 1.5rem; }
.price-tag { font-size: 1.8rem; color: var(--primary-color); font-weight: 800; }
.stock-indicator { font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }

.modal-desc { color: #555; font-size: 1rem; line-height: 1.6; margin-bottom: 2rem; max-height: 200px; overflow-y: auto; }
.tech-specs { list-style: none; margin-bottom: 2rem; border-top: 1px solid #eee; padding-top: 1rem; }
.tech-specs li { margin-bottom: 8px; display: flex; align-items: center; gap: 10px; color: #666; }
.tech-specs i { width: 20px; text-align: center; color: var(--dark-color); }

.modal-actions { margin-top: auto; display: flex; gap: 15px; }
.qty-selector { border: 2px solid #eee; border-radius: 50px; height: 55px; display: flex; align-items: center; padding: 0 5px; background: #fff; }
.qty-btn { background: none; border: none; width: 40px; font-size: 1.2rem; cursor: pointer; }
#modal-qty { border: none; width: 30px; text-align: center; font-weight: 700; font-size: 1.1rem; outline: none; }
.modal-cta { background: var(--primary-color); color: var(--dark-color); border: none; border-radius: 50px; height: 55px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; flex: 1; cursor: pointer; transition: transform 0.2s; }
.modal-cta:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255, 201, 52, 0.3); }
.modal-cta:disabled { background: #eee; color: #aaa; cursor: not-allowed; }

@media (max-width: 900px) {
    .modal-grid { flex-direction: column; padding-top: 20px; }
    .modal-left-col { width: 100%; margin-bottom: -30px; z-index: 20; }
    .modal-main-img { max-height: 30vh; }
    .modal-right-col { width: 100%; margin-left: 0; padding: 50px 25px 30px 25px; text-align: center; border-radius: 20px; transform: translateY(30px); margin-bottom: 40px; }
    .product-modal.active .modal-right-col { transform: translateY(0); }
    .price-row { justify-content: center; }
    .modal-title { font-size: 1.8rem; }
    .modal-close-btn { top: 10px; right: 10px; width: 40px; height: 40px; position: fixed; background: rgba(255,255,255,0.9); backdrop-filter: blur(5px); z-index: 999; }
    .gallery-grid { gap: 60px; padding-top: 20px; grid-template-columns: 1fr; }
    .cart-drawer { max-width: 100%; }
}