/**
 * Shop Styles - Optimiert für Konversion
 * Verwendet für: shop.php, shop_kategorie.php
 */

/* ==========================================================================
   CRITICAL: Prevent Horizontal Scroll on Mobile
   ========================================================================== */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

.section, .container, .row {
    max-width: 100%;
}

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --shop-primary: #28a745;
    --shop-primary-hover: #218838;
    --shop-secondary: #ffc107;
    --shop-secondary-hover: #e0a800;
    --shop-amazon: #ff9900;
    --shop-amazon-hover: #e68a00;
    --shop-card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shop-card-shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shop-border-radius: 12px;
    --shop-transition: all 0.3s ease;
}

/* ==========================================================================
   Product Cards - Desktop
   ========================================================================== */
.shop-product-card {
    border-radius: var(--shop-border-radius);
    box-shadow: var(--shop-card-shadow);
    transition: var(--shop-transition);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.shop-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shop-card-shadow-hover);
}

.shop-product-card .card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.shop-product-card .card-img-top {
    object-fit: cover;
    height: 200px;
    width: 100%;
}

.shop-product-card .card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shop-product-card .card-title a {
    color: #333;
    text-decoration: none;
}

.shop-product-card .card-title a:hover {
    color: var(--shop-primary);
}

/* ==========================================================================
   Price Display - Prominent
   ========================================================================== */
.shop-price {
    font-size: 1.4em;
    font-weight: 700;
    color: #333;
    margin: 10px 0;
}

.shop-price-small {
    font-size: 0.75em;
    font-weight: 400;
    color: #666;
    display: block;
}

.shop-price-wrapper {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 10px;
    margin-bottom: 15px;
}

/* ==========================================================================
   CTA Buttons - Optimiert
   ========================================================================== */
.btn-shop-primary {
    background-color: var(--shop-primary);
    border-color: var(--shop-primary);
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    padding: 12px 20px;
    min-height: 48px;
    border-radius: 8px;
    transition: var(--shop-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-shop-primary:hover,
.btn-shop-primary:focus {
    background-color: var(--shop-primary-hover);
    border-color: var(--shop-primary-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-shop-secondary {
    background-color: transparent;
    border: 2px solid var(--shop-secondary);
    color: #856404;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 16px;
    min-height: 44px;
    border-radius: 8px;
    transition: var(--shop-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-shop-secondary:hover,
.btn-shop-secondary:focus {
    background-color: var(--shop-secondary);
    color: #212529;
}

.shop-cta-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding-top: 15px;
}

/* ==========================================================================
   Sell-Satz Highlight
   ========================================================================== */
.shop-sell-satz {
    padding: 15px;
    background-color: #f8f9fa;
    border-left: 4px solid var(--shop-primary);
    border-radius: 0 8px 8px 0;
    margin: 15px 0;
    font-style: italic;
    color: #333;
    line-height: 1.6;
}

/* ==========================================================================
   Category Cards
   ========================================================================== */
.shop-category-card {
    border-radius: 20px;
    box-shadow: var(--shop-card-shadow);
    transition: var(--shop-transition);
    overflow: hidden;
}

.shop-category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shop-card-shadow-hover);
}

.shop-category-card .card-title {
    padding: 15px;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.shop-category-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* ==========================================================================
   Sort & Filter Controls
   ========================================================================== */
.shop-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--shop-border-radius);
}

.shop-product-count {
    font-size: 14px;
    color: #666;
}

.shop-product-count strong {
    color: #333;
}

.shop-sort-select {
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
}

.shop-sort-select:focus {
    border-color: var(--shop-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* ==========================================================================
   Availability Badge
   ========================================================================== */
.shop-availability {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.shop-availability.in-stock {
    background-color: #d4edda;
    color: #155724;
}

.shop-availability.out-of-stock {
    background-color: #f8d7da;
    color: #721c24;
}

/* ==========================================================================
   Trust Signals
   ========================================================================== */
.shop-trust-signal {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #28a745;
    margin-top: 10px;
}

.shop-trust-signal i {
    font-size: 14px;
}

/* ==========================================================================
   Empty State
   ========================================================================== */
.shop-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: var(--shop-border-radius);
}

.shop-empty-state h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #333;
}

.shop-empty-state p {
    color: #666;
    margin-bottom: 20px;
}

/* ==========================================================================
   Pagination - Verbessert
   ========================================================================== */
.shop-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 30px 0;
}

.shop-pagination .page-link {
    border-radius: 8px;
    padding: 10px 15px;
    color: #333;
    border: 1px solid #dee2e6;
    transition: var(--shop-transition);
}

.shop-pagination .page-link:hover {
    background-color: var(--shop-primary);
    border-color: var(--shop-primary);
    color: #fff;
}

.shop-pagination .page-item.active .page-link {
    background-color: var(--shop-primary);
    border-color: var(--shop-primary);
}

/* ==========================================================================
   Mobile Optimizations
   ========================================================================== */
@media (max-width: 768px) {
    /* Sort Controls */
    .shop-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .shop-sort-select {
        width: 100%;
    }

    /* Category Cards */
    .shop-category-card img {
        height: 150px;
    }
}


/* ==========================================================================
   Hover Effects & Animations
   ========================================================================== */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.btn-shop-primary:active {
    animation: pulse 0.2s ease;
}

/* Image loading placeholder */
.shop-product-card .card-img-top {
    background-color: #f8f9fa;
}

/* ==========================================================================
   Shop Homepage Cards (shop.php)
   ========================================================================== */
.shop-homepage-card .card-footer.shop-price-footer {
    margin-top: 10px;
    border-top: 1px solid #e9ecef;
}

.shop-homepage-card .card-body {
    padding-bottom: 5px;
}

/* Smooth scroll for pagination */
html {
    scroll-behavior: smooth;
}

/* ==========================================================================
   Amazon Button - Prominent Styling
   ========================================================================== */
.btn-shop-amazon {
    background-color: var(--shop-amazon);
    border-color: var(--shop-amazon);
    color: #111;
    font-weight: 700;
    font-size: 16px;
    padding: 14px 24px;
    min-height: 52px;
    border-radius: 8px;
    transition: var(--shop-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-shop-amazon:hover,
.btn-shop-amazon:focus {
    background-color: var(--shop-amazon-hover);
    border-color: var(--shop-amazon-hover);
    color: #111;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.4);
}

/* ==========================================================================
   Mobile Product Card - Best Practice (wie Amazon/Zalando)
   Vertikales Kachel-Layout mit Bild oben, Buttons nebeneinander
   ========================================================================== */
@media (max-width: 768px) {
    .shop-product-card-mobile {
        margin-bottom: 15px;
        border-radius: 12px;
        border: 1px solid #e9ecef;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        overflow: hidden;
        background: #fff;
    }

    /* Bild: volle Breite, korrekte Proportionen */
    .shop-product-card-mobile .card-img-top {
        width: 100%;
        height: 200px;
        object-fit: contain;
        background: #f8f9fa;
        padding: 15px;
    }

    .shop-product-card-mobile .card-body {
        padding: 15px;
    }

    .shop-product-card-mobile .card-title {
        font-size: 16px;
        font-weight: 600;
        line-height: 1.4;
        margin-bottom: 8px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .shop-product-card-mobile .card-title a {
        color: #333;
        text-decoration: none;
    }

    .shop-product-card-mobile .shop-price {
        font-size: 1.4em;
        color: #B12704;
        font-weight: 700;
        margin-bottom: 15px;
    }

    /* Sell-Text / Werbetext */
    .shop-product-card-mobile .shop-sell-text {
        font-size: 13px;
        color: #555;
        font-style: italic;
        line-height: 1.4;
        margin-bottom: 10px;
        padding: 8px 10px;
        background: #f8f9fa;
        border-left: 3px solid #28a745;
        border-radius: 0 4px 4px 0;
    }

    /* Buttons NEBENEINANDER - Best Practice für 2 CTAs */
    .shop-product-card-mobile .shop-btn-row {
        display: flex;
        gap: 10px;
    }

    .shop-product-card-mobile .shop-btn-row .btn {
        flex: 1;
        padding: 14px 10px;
        font-size: 15px;
        font-weight: 600;
        border-radius: 8px;
        text-align: center;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Amazon Button - Orange wie Amazon */
    .shop-product-card-mobile .btn-amazon,
    .btn-amazon {
        background: #FFD814;
        border: 1px solid #FCD200;
        color: #0F1111;
        font-weight: 600;
    }

    .shop-product-card-mobile .btn-amazon:hover,
    .shop-product-card-mobile .btn-amazon:active,
    .btn-amazon:hover {
        background: #F7CA00;
        border-color: #F2C200;
        color: #0F1111;
    }

    /* Shop Button - Outline */
    .shop-product-card-mobile .btn-outline-secondary {
        background: #fff;
        border: 2px solid #dee2e6;
        color: #555;
    }

    .shop-product-card-mobile .btn-outline-secondary:hover {
        background: #f8f9fa;
        border-color: #adb5bd;
    }

    /* Kategorie-Cards auf Mobile */
    .shop-category-card {
        margin-bottom: 15px;
    }

    .shop-category-card img {
        height: 120px;
    }

    /* Pagination auf Mobile */
    .shop-pagination .page-link {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* ==========================================================================
   Touch-Friendly Targets
   ========================================================================== */
@media (max-width: 768px) {
    a.btn, button.btn, .affiliate {
        min-height: 44px;
        min-width: 44px;
    }

    /* Mehr Abstand zwischen Buttons */
    .shop-cta-wrapper {
        gap: 8px !important;
    }
}

/* ==========================================================================
   Mobile Search Field
   ========================================================================== */
.shop-search-mobile {
    padding: 0 15px;
}

.shop-search-mobile input {
    font-size: 16px !important; /* Verhindert iOS Zoom */
}

.shop-search-mobile .btn {
    min-height: 48px;
    min-width: 48px;
}

/* ==========================================================================
   Mobile Full-Width Cards - Ausbruch aus Container-Padding
   ========================================================================== */
@media (max-width: 767px) {
    /* Neutralisiere ALLE Container-Paddings für Shop-Cards */
    main.main:has(.section.dashboard),
    main.main:has(.section.blog .shop-product-card-mobile) {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .section.dashboard,
    .section.blog:has(.shop-product-card-mobile) {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* ALLE rows unter section neutralisieren */
    .section.dashboard > .row,
    .section.blog:has(.shop-product-card-mobile) > .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .section.dashboard .col-md-12,
    .section.blog:has(.shop-product-card-mobile) .col-md-12 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .section.dashboard .container,
    .section.blog:has(.shop-product-card-mobile) .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
    }

    .section.dashboard .container > .row,
    .section.blog:has(.shop-product-card-mobile) .container > .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* col full width ohne padding */
    .section.dashboard .col-md-4,
    .section.blog:has(.shop-product-card-mobile) .col-md-4 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Mobile Card volle Breite */
    .shop-product-card-mobile {
        border-radius: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 8px !important;
        border-left: none !important;
        border-right: none !important;
    }

    /* Überschriften bekommen direkten Margin (15px gewünscht + 12px row-offset) */
    .section.dashboard .col-md-12 > h2,
    .section.dashboard > .row > .col-md-12 > h2 {
        margin-left: 27px !important;
        margin-right: 27px !important;
    }

    /* Text-Elemente außerhalb von Rows */
    .section.dashboard > .pagetitle,
    .section.dashboard .breadcrumb,
    .section.dashboard .shop-controls,
    .section.dashboard .shop-empty-state,
    .section.dashboard .shop-pagination {
        margin-left: 15px !important;
        margin-right: 15px !important;
    }

    /* Kategorie-Cards auch mit Padding */
    .section.dashboard .shop-category-card {
        margin-left: 15px;
        margin-right: 15px;
    }

    /* Suchfeld Padding */
    .section.dashboard .shop-search-mobile,
    .section.blog .shop-search-mobile {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* ===== Produktdetailseite (shop_produkt.php) ===== */
    /* H1 Titel auf Produktseiten */
    main.main > h1.welcomme,
    main.main > div > h1.welcomme {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Subtitle auf Produktseiten */
    main.main > div > p.subtitle {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* ===== Shop-Suche (blog_suche.php) ===== */
    /* Pagetitle vor der section */
    main.main > .pagetitle {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* ===== Shop-Kategorie mit Header-Bild ===== */
    /* Breadcrumb nach #stheader (außerhalb von section) */
    main.main > nav > .breadcrumb,
    #stheader + nav > .breadcrumb {
        margin-left: 15px !important;
        margin-right: 15px !important;
    }
}
