/* ============================================
   PROFESSIONAL TEMPLATE v2.0
   ============================================ */

/* RESET & BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #1a2a6c;
    --primary-light: #2d4a8a;
    --secondary: #b21f1f;
    --accent: #fdbb2d;
    --success: #28a745;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-600: #6c757d;
    --gray-800: #343a40;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    color: var(--gray-800);
    padding: 24px;
    line-height: 1.6;
    min-height: 100vh;
}

@media (max-width: 768px) { body { padding: 12px; } }

/* CONTAINER */
.container {
    max-width: 1440px;
    margin: 0 auto;
    background: #ffffff;
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) { .container { padding: 16px; } }

/* ============================================
   HEADER
   ============================================ */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #2d4a8a 100%);
    color: #fff;
    padding: 32px 40px;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: rgba(255,255,255,0.05);
    transform: rotate(15deg);
    pointer-events: none;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    position: relative;
}

.header p {
    font-size: 1rem;
    opacity: 0.85;
    font-weight: 300;
    position: relative;
}

.header .badge-header {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    padding: 4px 16px;
    border-radius: 30px;
    font-size: 0.8rem;
    margin-top: 8px;
    backdrop-filter: blur(4px);
}

@media (max-width: 600px) {
    .header { padding: 24px 20px; }
    .header h1 { font-size: 1.5rem; }
}

/* ============================================
   TOP BAR
   ============================================ */
.top-bar {
    background: var(--gray-100);
    padding: 10px 20px;
    border-radius: 50px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px 24px;
    font-size: 0.85rem;
    border: 1px solid var(--gray-200);
}

.top-bar a,
.top-bar span {
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.top-bar a:hover { color: var(--primary); }

.top-bar .divider {
    color: var(--gray-300);
    user-select: none;
}

@media (max-width: 600px) {
    .top-bar { border-radius: 16px; padding: 12px 16px; gap: 8px 16px; }
    .top-bar .divider { display: none; }
}

/* ============================================
   SEARCH
   ============================================ */
.search-container {
    text-align: center;
    margin-bottom: 28px;
}

.search-wrapper {
    display: inline-flex;
    align-items: center;
    background: var(--gray-100);
    border-radius: 50px;
    padding: 4px;
    border: 2px solid transparent;
    transition: var(--transition);
    max-width: 560px;
    width: 100%;
    box-shadow: var(--shadow-sm);
}

.search-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26, 42, 108, 0.1);
    background: #fff;
}

#searchInput {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: transparent;
    font-size: 1rem;
    outline: none;
    min-width: 0;
}

.search-wrapper .search-icon {
    padding: 0 16px 0 20px;
    color: var(--gray-600);
    font-size: 1.1rem;
}

.search-wrapper .search-clear {
    padding: 0 16px 0 0;
    color: var(--gray-600);
    cursor: pointer;
    display: none;
    font-size: 1.2rem;
}

#searchInput:not(:placeholder-shown) ~ .search-clear { display: block; }

@media (max-width: 600px) {
    .search-wrapper { border-radius: 30px; }
    #searchInput { padding: 12px 16px; font-size: 0.95rem; }
    .search-wrapper .search-icon { padding: 0 10px 0 14px; }
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs {
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    color: var(--gray-600);
}

.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumbs a:hover { color: var(--secondary); }

.breadcrumbs .separator {
    color: var(--gray-300);
    margin: 0 2px;
}

/* ============================================
   ARTICLE GRID
   ============================================ */
.offer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 1200px) { .offer-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .offer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 550px) { .offer-grid { grid-template-columns: 1fr; gap: 16px; } }

/* ============================================
   OFFER CARD
   ============================================ */
.offer-card {
    background: #fff;
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.offer-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: var(--transition);
}

.offer-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.offer-card:hover::after { opacity: 1; }

.offer-card:active { transform: scale(0.98); }

/* Card Brand */
.card-brand {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-light);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-brand .badge-source {
    font-size: 0.6rem;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.badge-source.shop {
    background: #d4edda;
    color: #155724;
}

.badge-source.ebay {
    background: #cce5ff;
    color: #004085;
}

/* Card Image */
.card-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: var(--gray-100);
    border-radius: 8px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.offer-card:hover .card-image { transform: scale(1.02); }

/* Card Title */
.card-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--gray-800);
    margin-bottom: 8px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Nummer */
.card-nummer {
    background: var(--gray-100);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    color: var(--gray-600);
    display: inline-block;
    margin-bottom: 10px;
    width: fit-content;
}

/* Bild Indicator */
.bild-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    margin-left: 6px;
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.4);
    vertical-align: middle;
    flex-shrink: 0;
}

/* ============================================
   PRICE
   ============================================ */
.preis-container {
    margin: 10px 0 8px;
    padding: 10px 0;
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
}

.old-preis {
    color: var(--gray-600);
    font-size: 0.8rem;
    text-decoration: line-through;
}

.rabatt-preis {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.rabatt-badge {
    background: var(--success);
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
}

.ersparnis {
    background: #fff3cd;
    color: #856404;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    display: inline-block;
    margin-top: 4px;
    font-weight: 500;
}

/* ============================================
   BUTTONS
   ============================================ */
.card-btn,
.mail-btn,
.modal-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    width: 100%;
    margin-top: 12px;
    transition: var(--transition);
    min-height: 44px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.card-btn::after,
.mail-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.card-btn:active::after,
.mail-btn:active::after {
    width: 300px;
    height: 300px;
}

.card-btn:hover,
.mail-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 42, 108, 0.3);
}

.card-btn:active,
.mail-btn:active {
    transform: scale(0.97);
    box-shadow: none;
}

.btn-ebay {
    background: #0066c0;
}

.btn-ebay:hover {
    background: #004d99;
    box-shadow: 0 6px 20px rgba(0, 102, 192, 0.3);
}

/* ============================================
   SECTION TITLES
   ============================================ */
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin: 28px 0 4px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary);
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title .count {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--gray-600);
    background: var(--gray-100);
    padding: 2px 14px;
    border-radius: 20px;
}

.section-subtitle {
    grid-column: 1 / -1;
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-top: -2px;
    margin-bottom: 8px;
}

/* ============================================
   SINGLE ARTICLE
   ============================================ */
.single {
    background: #fff;
    padding: 20px 0;
    border-radius: var(--radius);
}

.single h1 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
    color: var(--gray-800);
}

@media (max-width: 600px) {
    .single h1 { font-size: 1.3rem; }
}

/* Gallery */
.gallery-main {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.gallery-main img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.gallery-main img:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* Price Box */
.price-box {
    background: linear-gradient(135deg, #e8f4fd 0%, #d4edda 100%);
    padding: 20px 24px;
    border-radius: var(--radius);
    text-align: center;
    margin: 20px 0;
    border: 1px solid rgba(40, 167, 69, 0.15);
}

.price-box .old-preis {
    font-size: 1rem;
    color: var(--gray-600);
}

.big-price {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--success);
}

.savings-badge {
    background: var(--success);
    color: #fff;
    padding: 4px 16px;
    border-radius: 30px;
    font-weight: 600;
    display: inline-block;
    font-size: 0.85rem;
    margin-top: 4px;
}

/* Detail Items */
.detail-item {
    background: var(--gray-100);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.85rem;
    border-left: 3px solid var(--primary);
    display: inline-block;
    margin: 4px 6px 4px 0;
}

/* Description */
.article-description {
    margin-top: 24px;
    padding: 20px 24px;
    background: var(--gray-100);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.article-description h3 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 32px 0 8px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    min-width: 40px;
    text-align: center;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    color: var(--gray-800);
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.pagination .active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination .dots {
    border: none;
    color: var(--gray-600);
    cursor: default;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

.lightbox.active { display: flex; }

.lightbox img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: lightboxIn 0.3s ease;
}

@keyframes lightboxIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
    background: none;
    border: none;
}

.lightbox-close:hover {
    transform: rotate(90deg);
    color: var(--accent);
}

/* ============================================
   CART
   ============================================ */
.cart {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 300px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    z-index: 1000;
    max-height: 500px;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

@media (max-width: 550px) {
    .cart {
        width: calc(100% - 24px);
        right: 12px;
        bottom: 12px;
        max-height: 420px;
    }
}

.cart-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
    padding: 14px 18px;
    font-weight: 700;
    text-align: center;
    color: #fff;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    font-size: 0.9rem;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header .countdown {
    font-weight: 400;
    font-size: 0.85rem;
    opacity: 0.9;
}

.cart-body {
    padding: 14px 16px;
    overflow-y: auto;
    flex: 1;
}

.cart-body::-webkit-scrollbar {
    width: 4px;
}

.cart-body::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

.cart-item {
    font-size: 0.8rem;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.cart-item .item-info {
    flex: 1;
    overflow: hidden;
}

.cart-item .item-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item .item-qty {
    color: var(--gray-600);
    font-size: 0.75rem;
}

.cart-item .item-price {
    font-weight: 600;
    color: var(--success);
    white-space: nowrap;
}

.cart-item button {
    background: var(--secondary);
    color: #fff;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
    flex-shrink: 0;
}

.cart-item button:hover {
    transform: scale(1.1);
}

.cart-empty {
    text-align: center;
    color: var(--gray-600);
    padding: 16px 0;
}

.total {
    font-weight: 700;
    font-size: 1.2rem;
    margin: 12px 0 10px;
    text-align: right;
    color: var(--primary);
    padding-top: 10px;
    border-top: 2px solid var(--gray-200);
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal.active { display: flex; }

.modal-content {
    background: #fff;
    max-width: 420px;
    width: 92%;
    padding: 28px 32px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content h3 {
    font-size: 1.3rem;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.modal-content .modal-sub {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.shipping-option {
    padding: 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.shipping-option:hover {
    border-color: var(--primary-light);
    background: var(--gray-100);
}

.shipping-option.active {
    border-color: var(--primary);
    background: #e8f0fe;
}

.shipping-option .shipping-name {
    font-weight: 500;
}

.shipping-option .shipping-price {
    font-weight: 700;
    color: var(--success);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.modal-actions .modal-btn {
    flex: 1;
    margin-top: 0;
}

.modal-actions .modal-btn-secondary {
    flex: 1;
    background: var(--gray-200);
    color: var(--gray-800);
    margin-top: 0;
}

.modal-actions .modal-btn-secondary:hover {
    background: var(--gray-300);
    box-shadow: none;
}

@media (max-width: 480px) {
    .modal-content { padding: 20px; }
    .modal-actions { flex-direction: column; }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--gray-100); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-600); }