/* WP Gift Cards v2.0 - Frontend Styles (Design Integration) */

/* lores-9-wide Font Import */
@import url('https://fonts.googleapis.com/css2?family=lores-9-wide:wght@300;400;500;600;700;900&display=swap');

/* Product Progress Virtual Color */
:root {
    --wpgc-virtual-color: #B3DDDC;
    /* Responsive Design Variables */
    --wpgc-progress-title-size: clamp(1rem, 4vw, 0.8rem);
    --wpgc-progress-text-size: clamp(0.8rem, 3vw, 0.7rem);
    --wpgc-progress-labels-size: clamp(0.7rem, 2.5vw, 0.9rem);
    --wpgc-progress-bar-height: clamp(20px, 4vw, 24px);
    --wpgc-progress-padding: clamp(1rem, 3vw, 2rem);
    --wpgc-progress-gap: clamp(0.5rem, 2vw, 1rem);
}

/* Basis-Styles für das Modul (angelehnt an geschenke-modul.css) */
.wpgc-frontend-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.wpgc-frontend-container {
    font-family: 'lores-9-wide', sans-serif;
    color: #333; /* Standard Textfarbe */
}

/* Section Titles (für das Geschenkemodul) */
.wpgc-section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 3px 3px 0 #1a1a2e, -1px -1px 0 #1a1a2e, 1px -1px 0 #1a1a2e, -1px 1px 0 #1a1a2e;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.2;
}

/* Geschenkemodul - Hauptcontainer */
.wpgc-gift-section {
    background: white;
    border: 3px solid #333;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.wpgc-gift-container {
    max-width: 100%;
}

/* Fortschrittsbereich */
.wpgc-gift-progress-section {
    background: transparent;
    background-image: linear-gradient(225deg, #F6935C 0%, #F47934 100%);
    border: 4px solid #001632;
    border-radius: 10px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: -7px 7px 0px 0px #001632;
}

.wpgc-progress-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
    /* text-shadow: 2px 2px 4px rgba(0,0,0,0.3); */
}

.wpgc-progress-text {
    font-size: 1rem;
    color: #FFE66D;
    margin-bottom: 1rem;
    font-weight: 500;
    /* text-shadow: 1px 1px 2px rgba(0,0,0,0.3); */
}

.wpgc-progress-bar-container {
    max-width: 400px;
    margin: 0 auto;
}

.wpgc-progress-bar {
    width: 100%;
    height: 24px;
    background: white;
    border-radius: 0;
    overflow: hidden;
    border: 4px solid #001632;
    margin-bottom: 0.5rem;
    box-shadow: -4px 4px 0px 0px #001632;
}

.wpgc-progress-fill {
    height: 100%;
    background: #FFD700;
    border-radius: 0;
    transition: width 0.5s ease;
    animation: wpgcProgressBuildUp 1.5s ease-out forwards;
    transform-origin: left;
    border-right: 4px solid #001632;
}

/* Product Progress Unified Progress Styles */
.wpgc-dual-progress {
    position: relative;
}

.wpgc-dual-progress .wpgc-progress-fill {
    position: relative;
    height: 100%;
    transition: width 0.5s ease;
    animation: wpgcProgressBuildUp 1.5s ease-out forwards;
    transform-origin: left;
}

/* Durchgehender Balken mit normaler Farbe */
.wpgc-unified-fill {
    background: #FFD700 !important;
    position: relative;
}

/* Trennstrich zwischen den Bereichen */
.wpgc-progress-divider {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: #001632;
    z-index: 10;
}

/* Legacy Styles für Kompatibilität */
.wpgc-product-progress .wpgc-progress-fill {
    background: var(--wpgc-virtual-color) !important;
}

.wpgc-virtual-progress .wpgc-progress-fill {
    background: var(--wpgc-virtual-color) !important;
}

.wpgc-virtual-fill {
    background: var(--wpgc-virtual-color) !important;
}

/* Product Progress Section Styling - Rest wie normaler Fortschrittsbalken */
.wpgc-product-progress {
    /* Kein spezieller Border - nutzt Standard-Styling */
}

.wpgc-product-progress .wpgc-progress-title {
    /* Gleiche Farbe wie normaler Fortschrittsbalken */
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.wpgc-product-progress .wpgc-progress-text {
    /* Gleiche Farbe wie normaler Fortschrittsbalken */
    color: #FFE66D;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Product Progress Wrapper Styling */
.wpgc-product-progress-wrapper {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid var(--wpgc-virtual-color);
}

/* ===== RESPONSIVE PRODUCT PROGRESS - BEST PRACTICES ===== */

/* Mobile First: Base styles for smallest screens */
.wpgc-product-progress {
    padding: 0.2rem;
}

.wpgc-product-progress .wpgc-progress-title {
    font-size: var(--wpgc-progress-title-size);
    line-height: 0.8;
    margin-bottom: var(--wpgc-progress-gap);
    word-wrap: break-word;
    hyphens: auto;
}

.wpgc-product-progress .wpgc-progress-text {
    font-size: var(--wpgc-progress-text-size);
    line-height: 0.9;
    margin-bottom: var(--wpgc-progress-gap);
    word-wrap: break-word;
}

.wpgc-product-progress .wpgc-progress-bar {
    height: var(--wpgc-progress-bar-height);
    margin-bottom: var(--wpgc-progress-gap);
}

/* Responsive Progress Labels - Mobile First */
.wpgc-product-progress .wpgc-progress-labels {
    display: flex;
    flex-direction: column; /* Stacked on mobile */
    gap: 0.3rem;
    font-size: var(--wpgc-progress-labels-size);
    line-height: 1.2;
    text-align: center;
}

.wpgc-product-progress .wpgc-current-amount,
.wpgc-product-progress .wpgc-product-amount,
.wpgc-product-progress .wpgc-target-amount {
    font-size: var(--wpgc-progress-labels-size);
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    background: transparent; /* Transparent für einheitlichen Hintergrund */
    border-radius: 4px;
    white-space: normal; /* Erlaubt Text-Wrapping */
    overflow: visible; /* Kein Text-Overflow mehr */
    text-overflow: unset; /* Entfernt Ellipsis */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    min-width: 0; /* Erlaubt Flex-Shrinking */
    flex: 1; /* Nimmt verfügbaren Platz ein */
}

/* Neue Label-Struktur für bessere responsive Darstellung */
.wpgc-product-progress .wpgc-label-text {
    font-size: 0.8em;
    opacity: 0.9;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    word-wrap: break-word; /* Erlaubt Wortumbrüche */
    hyphens: auto; /* Automatische Silbentrennung */
    text-align: center;
    max-width: 100%; /* Verhindert Überlauf - Max 30 Zeichen empfohlen */
}

.wpgc-product-progress .wpgc-amount-value {
    font-size: 1.1em;
    font-weight: 700;
    color: #FFD700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    white-space: nowrap; /* Preise bleiben in einer Zeile */
}

/* Small Mobile: 320px - 424px (nur sehr kleine Geräte) */
@media (max-width: 424px) {
    .wpgc-product-progress {
        padding: 0.2rem;
    }
    
    .wpgc-product-progress .wpgc-progress-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .wpgc-product-progress .wpgc-progress-text {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .wpgc-product-progress .wpgc-progress-labels {
        font-size: 0.75rem;
        gap: 0.2rem;
    }
    
    .wpgc-product-progress .wpgc-current-amount,
    .wpgc-product-progress .wpgc-product-amount,
    .wpgc-product-progress .wpgc-target-amount {
        font-size: 0.75rem;
        padding: 0.15rem 0.3rem;
        flex-direction: column;
        min-height: auto;
    }
    
    .wpgc-product-progress .wpgc-label-text {
        font-size: 0.7em;
        letter-spacing: 0.3px;
        line-height: 1.1;
    }
    
    .wpgc-product-progress .wpgc-amount-value {
        font-size: 1em;
    }
    
    /* Compact progress bar for very small screens */
    .wpgc-product-progress .wpgc-progress-bar {
        height: 18px;
    }
}

/* Medium Mobile: 425px - 767px (Mobile L und größer) */
@media (min-width: 425px) and (max-width: 767px) {
    .wpgc-product-progress .wpgc-progress-labels {
        flex-direction: row; /* Horizontal layout */
        justify-content: space-between;
        flex-wrap: wrap; /* Wrap if needed */
        gap: 0.5rem;
        align-items: flex-end; /* Preise auf einer Linie */
    }
    
    .wpgc-product-progress .wpgc-current-amount,
    .wpgc-product-progress .wpgc-product-amount,
    .wpgc-product-progress .wpgc-target-amount {
        flex: 1;
        min-width: 0; /* Allow shrinking */
        text-align: center;
        flex-direction: column;
        min-height: auto;
        justify-content: flex-end; /* Preise nach unten ausrichten */
    }
    
    /* Ensure labels don't overlap */
    .wpgc-product-progress .wpgc-progress-labels {
        font-size: 0.8rem;
    }
    
    .wpgc-product-progress .wpgc-label-text {
        font-size: 0.75em;
        line-height: 1.1;
        margin-bottom: 0.2rem; /* Konsistenter Abstand zum Preis */
    }
    
    .wpgc-product-progress .wpgc-amount-value {
        font-size: 1.05em;
        /* Preise stehen jetzt auf einer Linie */
    }
}

/* Tablet: 768px - 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    .wpgc-product-progress .wpgc-progress-labels {
        flex-direction: row;
        justify-content: space-between;
        gap: 0.8rem;
        font-size: 0.85rem;
        align-items: flex-end; /* Preise auf einer Linie */
    }
    
    .wpgc-product-progress .wpgc-current-amount,
    .wpgc-product-progress .wpgc-product-amount,
    .wpgc-product-progress .wpgc-target-amount {
        flex: 1;
        text-align: center;
        flex-direction: column;
        min-height: auto;
        justify-content: flex-end; /* Preise nach unten ausrichten */
    }
    
    .wpgc-product-progress .wpgc-label-text {
        font-size: 0.8em;
        line-height: 1.2;
        margin-bottom: 0.3rem; /* Konsistenter Abstand zum Preis */
    }
    
    .wpgc-product-progress .wpgc-amount-value {
        font-size: 1.1em;
        /* Preise stehen jetzt auf einer Linie */
    }
}

/* Desktop: 1024px+ - Gleiche Einstellungen wie Tablet */
@media (min-width: 1024px) {
    .wpgc-product-progress .wpgc-progress-labels {
        flex-direction: row;
        justify-content: space-between;
        gap: 0.8rem; /* Gleicher Gap wie Tablet */
        font-size: 0.85rem; /* Gleiche Schriftgröße wie Tablet */
        align-items: flex-end; /* Preise auf einer Linie */
    }
    
    .wpgc-product-progress .wpgc-current-amount,
    .wpgc-product-progress .wpgc-product-amount,
    .wpgc-product-progress .wpgc-target-amount {
        flex: 1;
        text-align: center;
        flex-direction: column;
        min-height: auto;
        justify-content: flex-end; /* Preise nach unten ausrichten */
        /* Kein zusätzliches Padding - gleiche Einstellungen wie Tablet */
    }
    
    .wpgc-product-progress .wpgc-label-text {
        font-size: 0.8em; /* Gleiche Schriftgröße wie Tablet */
        line-height: 1.2; /* Gleiche Zeilenhöhe wie Tablet */
        margin-bottom: 0.3rem; /* Gleicher Abstand wie Tablet */
    }
    
    .wpgc-product-progress .wpgc-amount-value {
        font-size: 1.1em; /* Gleiche Schriftgröße wie Tablet */
    }
}

/* Landscape Mobile Optimization */
@media (max-width: 767px) and (orientation: landscape) {
    .wpgc-product-progress {
        padding: 0.2rem;
    }
    
    .wpgc-product-progress .wpgc-progress-labels {
        flex-direction: row;
        justify-content: space-between;
        gap: 0.3rem;
        font-size: 0.75rem;
    }
    
    .wpgc-product-progress .wpgc-current-amount,
    .wpgc-product-progress .wpgc-product-amount,
    .wpgc-product-progress .wpgc-target-amount {
        font-size: 0.75rem;
        padding: 0.1rem 0.2rem;
        flex-direction: row; /* Horizontal in landscape */
        align-items: center;
        gap: 0.3rem;
        min-height: auto;
    }
    
    .wpgc-product-progress .wpgc-label-text {
        font-size: 0.7em;
        line-height: 1.1;
    }
    
    .wpgc-product-progress .wpgc-amount-value {
        font-size: 0.95em;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .wpgc-product-progress .wpgc-progress-title,
    .wpgc-product-progress .wpgc-progress-text,
    .wpgc-product-progress .wpgc-progress-labels {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Accessibility: High Contrast Mode */
@media (prefers-contrast: high) {
    .wpgc-product-progress .wpgc-current-amount,
    .wpgc-product-progress .wpgc-product-amount,
    .wpgc-product-progress .wpgc-target-amount {
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
    }
}

/* Reduced Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    .wpgc-product-progress .wpgc-progress-fill {
        transition: none;
        animation: none;
    }
}

/* ===== END RESPONSIVE PRODUCT PROGRESS ===== */

/* ===== ERWEITERTE RESPONSIVE FEATURES ===== */

/* Fallback für ältere Browser ohne CSS Grid/Flexbox Support */
@supports not (display: flex) {
    .wpgc-product-progress .wpgc-progress-labels {
        display: block;
        text-align: center;
    }
    
    .wpgc-product-progress .wpgc-current-amount,
    .wpgc-product-progress .wpgc-product-amount,
    .wpgc-product-progress .wpgc-target-amount {
        display: inline-block;
        margin: 0.2rem;
        vertical-align: top;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .wpgc-product-progress .wpgc-current-amount,
    .wpgc-product-progress .wpgc-product-amount,
    .wpgc-product-progress .wpgc-target-amount {
        min-height: 44px; /* Touch-friendly minimum size */
        padding: 0.4rem 0.6rem;
    }
}

/* Print Styles */
@media print {
    .wpgc-product-progress {
        background: white !important;
        border: 1px solid #ccc !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .wpgc-product-progress .wpgc-progress-title,
    .wpgc-product-progress .wpgc-progress-text {
        color: black !important;
        text-shadow: none !important;
    }
    
    .wpgc-product-progress .wpgc-current-amount,
    .wpgc-product-progress .wpgc-product-amount,
    .wpgc-product-progress .wpgc-target-amount {
        background: #f0f0f0 !important;
        color: black !important;
        border: 1px solid #ccc !important;
    }
}

/* Dark Mode Support (wenn Theme es unterstützt) */
@media (prefers-color-scheme: dark) {
    .wpgc-product-progress-wrapper {
        background: #2a2a2a;
        border-left-color: var(--wpgc-virtual-color);
    }
}

/* ===== END ERWEITERTE RESPONSIVE FEATURES ===== */

/* Legacy Responsive Anpassungen für Product Progress Wrapper - ENTFERNT */
/* Diese werden durch die neuen responsive Styles oben ersetzt */

@keyframes wpgcProgressBuildUp {
    from {
        width: 0% !important;
        transform: scaleX(0);
}
    to {
        /* This will be dynamically set by JS/PHP based on actual progress */
        /* For CSS animation, a placeholder width is often used, actual width from JS */
        width: 100% !important; 
        transform: scaleX(1);
    }
}

.wpgc-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
}

.wpgc-current-amount {
    color: white;
    /* text-shadow: 1px 1px 2px rgba(0,0,0,0.3); */
}

.wpgc-product-amount {
    color: white;
    font-weight: 600;
    /* text-shadow: 1px 1px 2px rgba(0,0,0,0.3); */
}

.wpgc-target-amount {
    color: white;
}

/* Geschenkoptionen Grid */
.wpgc-gift-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.wpgc-gift-option-card {
    background: transparent;
    background-image: linear-gradient(225deg, #F6935C 0%, #F47934 100%);
    border: 4px solid #001632;
    border-radius: 10px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: -7px 7px 0px 0px #001632;
    display: flex; /* Karte als Flex-Container */
    flex-direction: column; /* Elemente vertikal anordnen */
}

.wpgc-gift-option-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

/* NEUE ACTIVE STATE LOGIK */
.wpgc-gift-available {
    /* Standard: Leicht ausgegraut */
    background-image: linear-gradient(225deg, #F6935C 0%, #F47934 100%);
    border-color: #001632;
    opacity: 0.7; /* Leicht ausgegraut für nicht-ausgewählte */
}

.wpgc-gift-available.wpgc-selected {
    /* Ausgewählt: Volle Sichtbarkeit */
    opacity: 1;
}

.wpgc-gift-locked {
    /* Inaktiv: Ausgegraut */
    background-image: linear-gradient(225deg, #9E9E9E 0%, #757575 100%);
    border-color: #001632;
    opacity: 0.8;
}

/* GLOE-EFFEKT ENTFERNT - Keine spezielle Behandlung für ausgewählte Geschenke mehr */

.wpgc-gift-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.wpgc-gift-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    border: 2px solid #001632;
    border-radius: 12px;
    box-shadow: -3px 3px 0px 0px #001632;
    overflow: hidden; /* Sicherstellen, dass nichts über den Rand geht */
}

.wpgc-gift-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Bild proportional skalieren */
    display: block; /* Entfernt zusätzlichen Platz unter dem Bild */
}

.wpgc-gift-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    flex: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.wpgc-gift-card-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.wpgc-gift-details {
    flex: 1;
    flex-grow: 1; /* Nimmt verfügbaren Platz ein */
}

.wpgc-gift-threshold {
    font-size: 0.9rem;
    color: #FFD700;
    font-weight: 500;
    margin-bottom: 0.3rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.wpgc-gift-missing {
    font-size: 0.85rem;
    color: #FFE66D;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.wpgc-gift-description {
    font-size: 0.9rem;
    color: #FFE66D;
    font-style: italic;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.wpgc-gift-status {
    text-align: right;
}

.wpgc-status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.wpgc-status-badge.available {
    background: #4CAF50;
    color: white;
}

.wpgc-status-badge.selected {
    background: #FFD700;
    color: #001632;
    font-weight: 700;
}

.wpgc-status-badge.locked {
    background: #ccc;
    color: #666;
}

/* NEUE BUTTON-STYLES basierend auf .lama-cta */
.wpgc-gift-select-btn {
    width: 100%;
    font-weight: 900;
    font-size: 1.25rem;
    color: #001632;
    padding-block-start: 0.75rem;
    padding-block-end: 0.75rem;
    padding-inline-start: 1.75rem;
    padding-inline-end: 1.75rem;
    border-radius: 10px;
    border-width: 4px;
    border-color: #001632;
    border-style: solid;
    box-shadow: -4px 4px 0px 0px #001632;
    background: #FFD700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

form.wpgc-select-gift-form {
    margin-top: auto; /* Schiebt den Button nach unten */
}

.wpgc-gift-select-btn:hover:not(:disabled) {
    background: #FFC107;
    transform: translateY(-2px);
    box-shadow: -6px 6px 0px 0px #001632;
}

.wpgc-gift-select-btn.disabled {
    background: #9E9E9E;
    border-color: #001632;
    color: #666;
    cursor: not-allowed;
    box-shadow: -4px 4px 0px 0px #001632;
}

/* Responsive Design - Mobile First */
@media (min-width: 768px) {
    .wpgc-gift-section {
        padding: 3rem;
    }

    .wpgc-section-title {
        font-size: 3rem;
    }
    
    .wpgc-gift-options-grid {
        grid-template-columns: 1fr; /* Tablet: nur noch 1 pro Reihe */
    }
    
    .wpgc-product-progress {
        margin: 2rem 0;
    }
}

@media (min-width: 1024px) {
    .wpgc-gift-section {
        padding: 3rem 2rem;
}

    .wpgc-section-title {
        font-size: 3rem;
    }
    
    .wpgc-gift-options-grid {
        grid-template-columns: repeat(3, 1fr); /* Desktop */
    }
}

@media (max-width: 767px) {
    .wpgc-section-title {
        font-size: 1.8rem;
}

    .wpgc-gift-section {
        padding: 1rem;
    }
    
    .wpgc-gift-options-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .wpgc-gift-option-card {
        padding: 1rem;
    }
    
    .wpgc-gift-name {
        font-size: 1rem;
}
}

/* Animationen */
@keyframes wpgcSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fokus-Styles für Accessibility */
.wpgc-gift-option-card:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
} 