/**
 * SMG BENTO GRID WIDGET - PROFESSIONAL ARCHITECTURE
 * Verwendet das neue CSS-Architektur-System für konsistente Styles
 * Keine CSS-Konflikte mehr durch klare Spezifitäts-Hierarchie
 */

/* ========================================
   WIDGET BASE CLASS (Spezifität: 0,0,2,0)
   ======================================== */
.smg-widget.smg-bento-grid {
    /* Erbt von .smg-widget Base-Klasse */
    background: linear-gradient(135deg,
        rgba(248, 250, 252, 0.8) 0%,
        rgba(241, 245, 249, 0.9) 50%,
        rgba(248, 250, 252, 0.8) 100%);
    position: relative;
    overflow: hidden;
}

/* Widget Container */
.smg-widget.smg-bento-grid .smg-widget-container {
    /* Erbt von .smg-widget-container Base-Klasse */
    position: relative;
    z-index: 1;
}

/* ========================================
   GRID LAYOUT SYSTEM (Spezifität: 0,0,3,0)
   ======================================== */
.smg-widget.smg-bento-grid .smg-bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: var(--bento-grid-gap, clamp(20px, 4vw, 32px));
    max-width: var(--widget-max-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Grid Layout Variations */
.smg-widget.smg-bento-grid .grid-style-asymmetric {
    grid-template-areas:
        "shops shops shops opening"
        "dining dining gifts gifts";
}

.smg-widget.smg-bento-grid .grid-style-balanced {
    grid-template-areas:
        "shops shops opening opening"
        "dining dining gifts gifts";
}

.smg-widget.smg-bento-grid .grid-style-compact {
    grid-template-areas:
        "shops shops opening gifts"
        "dining dining dining gifts";
}

/* ========================================
   CARD COMPONENTS (Spezifität: 0,0,3,0)
   ======================================== */
.smg-widget.smg-bento-grid .smg-card {
    /* Überschreibt Base .smg-card für Bento-Kontext */
    background: var(--bento-card-background);
    backdrop-filter: var(--bento-card-backdrop-filter);
    border: var(--bento-card-border);
    border-radius: var(--bento-card-border-radius);
    box-shadow: var(--bento-card-shadow);
    transition: var(--button-transition);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    transform-style: preserve-3d;
    overflow: hidden;
}

/* Card Hover State */
.smg-widget.smg-bento-grid .smg-card:hover {
    transform: var(--bento-card-hover-transform);
    box-shadow: var(--bento-card-hover-shadow);
}

/* ========================================
   CARD POSITIONING (Spezifität: 0,0,4,0)
   ======================================== */
.smg-widget.smg-bento-grid .smg-card.bento-opening-hours {
    grid-area: opening;
}

.smg-widget.smg-bento-grid .smg-card.bento-shops {
    grid-area: shops;
    /* Shops Card - Wichtigste Info */
    background: var(--bento-shops-background) !important;
    border: var(--bento-shops-border) !important;
    box-shadow: var(--bento-shops-shadow) !important;
    position: relative;
}

.smg-widget.smg-bento-grid .smg-card.bento-gifts {
    grid-area: gifts;
    background: linear-gradient(135deg,
        rgba(255, 193, 7, 0.15) 0%,
        rgba(255, 152, 0, 0.1) 100%) !important;
    border: 1px solid rgba(255, 193, 7, 0.2) !important;
}

.smg-widget.smg-bento-grid .smg-card.bento-dining {
    grid-area: dining;
    background: linear-gradient(135deg,
        rgba(255, 152, 0, 0.08) 0%,
        rgba(255, 87, 34, 0.05) 100%) !important;
    border: 1px solid rgba(255, 152, 0, 0.15) !important;
}

/* ========================================
   CARD CONTENT (Spezifität: 0,0,4,0)
   ======================================== */
.smg-widget.smg-bento-grid .smg-card .bento-card-content {
    position: relative;
    z-index: 3;
    padding: var(--bento-card-padding);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: transparent;
    gap: var(--bento-card-gap);
    min-height: fit-content;
}

/* ========================================
   GLASSMORPHISM CONTENT OVERLAY (Spezifität: 0,0,5,0)
   ======================================== */
/* Mit Hintergrundbild - SMG Glassmorphism */
.smg-widget.smg-bento-grid .smg-card:has(.bento-card-image) .bento-card-content {
    background: var(--bento-glassmorphism-background) !important;
    backdrop-filter: var(--bento-glassmorphism-backdrop-filter) !important;
    border-radius: var(--bento-glassmorphism-border-radius) !important;
    border: var(--bento-glassmorphism-border) !important;
    box-shadow: var(--bento-glassmorphism-shadow) !important;
    margin: var(--bento-glassmorphism-margin) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Ohne Hintergrundbild - Normale Card */
.smg-widget.smg-bento-grid .smg-card:not(:has(.bento-card-image)) .bento-card-content {
    background: transparent !important;
    margin: 0 !important;
}

/* Glassmorphism Hover-Effekt */
.smg-widget.smg-bento-grid .smg-card:has(.bento-card-image):hover .bento-card-content {
    background: var(--bento-glassmorphism-background-hover) !important;
    backdrop-filter: var(--bento-glassmorphism-backdrop-filter-hover) !important;
    transform: translateY(-2px) !important;
    box-shadow: var(--bento-glassmorphism-shadow-hover) !important;
}

/* ========================================
   FALLBACK FÜR ÄLTERE BROWSER (ohne :has() Support)
   ======================================== */
/* Glassmorphism für alle Cards mit Bildern - Fallback */
.smg-widget.smg-bento-grid .smg-card .bento-card-image + .bento-card-content {
    background: var(--bento-glassmorphism-background) !important;
    backdrop-filter: var(--bento-glassmorphism-backdrop-filter) !important;
    border-radius: var(--bento-glassmorphism-border-radius) !important;
    border: var(--bento-glassmorphism-border) !important;
    box-shadow: var(--bento-glassmorphism-shadow) !important;
    margin: var(--bento-glassmorphism-margin) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.smg-widget.smg-bento-grid .smg-card:hover .bento-card-image + .bento-card-content {
    background: var(--bento-glassmorphism-background-hover) !important;
    backdrop-filter: var(--bento-glassmorphism-backdrop-filter-hover) !important;
    transform: translateY(-2px) !important;
    box-shadow: var(--bento-glassmorphism-shadow-hover) !important;
}

/* Card Background Image */
.smg-widget.smg-bento-grid .smg-card .bento-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    border-radius: inherit;
}

.smg-widget.smg-bento-grid .smg-card .bento-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: var(--transition-normal);
}

/* Z-Index Layering für Glassmorphism */
.smg-widget.smg-bento-grid .smg-card .bento-card-image {
    z-index: 1; /* Hintergrundbild */
}

.smg-widget.smg-bento-grid .smg-card .bento-card-content {
    z-index: 3; /* Content über Bild */
    position: relative;
}

/* Overlay für besseren Kontrast (optional) */
.smg-widget.smg-bento-grid .smg-card .bento-card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.05) 50%,
        transparent 100%);
    z-index: 2;
    pointer-events: none;
}

/* ========================================
   CARD ELEMENTS (Spezifität: 0,0,4,0)
   ======================================== */
/* Icons - EINHEITLICHE KREISE */
.smg-widget.smg-bento-grid .smg-card .bento-card-icon {
    width: clamp(48px, 5vw, 56px); /* ✅ EINHEITLICHE GRÖSSE */
    height: clamp(48px, 5vw, 56px);
    color: white; /* ✅ ALLE ICONS WEISS */
    background: linear-gradient(135deg, var(--smg-500) 0%, var(--smg-500) 100%); /* ✅ STANDARD SMG-ROT */
    border-radius: 50%; /* ✅ PERFEKTE KREISE */
    display: flex;
    align-items: center; /* ✅ VERTIKAL ZENTRIERT */
    justify-content: center; /* ✅ HORIZONTAL ZENTRIERT */
    transition: var(--button-transition);
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(227, 30, 36, 0.25); /* ✅ EINHEITLICHER SCHATTEN */
    padding: clamp(8px, 1.5vw, 12px); /* ✅ PADDING FÜR ICON-ABSTAND */
}

/* SVG Icons innerhalb der Kreise */
.smg-widget.smg-bento-grid .smg-card .bento-card-icon svg {
    width: clamp(20px, 3vw, 24px); /* ✅ FESTE ICON-GRÖSSE */
    height: clamp(20px, 3vw, 24px);
    stroke-width: 2; /* ✅ EINHEITLICHE LINIENSTÄRKE */
    transition: all 0.3s ease;
}

/* Titles */
.smg-widget.smg-bento-grid .smg-card .bento-card-title {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-bold);
    color: var(--smg-gray-900);
    margin: 0;
    line-height: var(--line-height-tight);
    text-align: center;
    letter-spacing: -0.02em;
    transition: color var(--transition-normal);
}

/* Subtitles */
.smg-widget.smg-bento-grid .smg-card .bento-card-subtitle {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--smg-gray-900);
    margin: 0;
    line-height: var(--line-height-normal);
    text-align: center;
    opacity: 1;
}

/* ========================================
   BENTO CARD BUTTONS (Spezifität: 0,0,4,0)
   ======================================== */
.smg-widget.smg-bento-grid .smg-card .bento-card-button {
    background: var(--button-background);
    color: var(--button-color);
    border: var(--button-border);
    border-radius: var(--button-border-radius);
    padding: var(--button-padding);
    font-weight: var(--button-font-weight);
    font-size: var(--text-sm);
    transition: var(--button-transition);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    margin-top: var(--space-2);
}

.smg-widget.smg-bento-grid .smg-card .bento-card-button:hover {
    background: var(--button-hover-background);
    transform: var(--button-hover-transform);
}

.smg-widget.smg-bento-grid .smg-card .button-icon {
    width: 16px;
    height: 16px;
    transition: var(--transition-normal);
}

/* ========================================
   SHOPS CARD SPECIFIC (Spezifität: 0,0,5,0)
   ======================================== */
.smg-widget.smg-bento-grid .smg-card.bento-shops .bento-card-content {
    padding: clamp(1rem, 3vw, 1.5rem) !important;
    gap: clamp(0.75rem, 2vw, 1rem) !important;
}

/* ✅ SHOPS: SMG-Rot (verwendet Standard-Stil) */

/* ✅ ÖFFNUNGSZEITEN: Grüner Kreis + HORIZONTAL ZENTRIERT */
.smg-widget.smg-bento-grid .smg-card.bento-opening-hours .bento-card-content {
    align-items: center !important; /* ✅ HORIZONTAL ZENTRIERT */
    text-align: center !important; /* ✅ TEXT ZENTRIERT */
}

.smg-widget.smg-bento-grid .smg-card.bento-opening-hours .bento-card-icon {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%) !important;
    box-shadow: 0 4px 16px rgba(39, 174, 96, 0.25) !important;
    margin: 0 auto !important; /* ✅ ICON HORIZONTAL ZENTRIERT */
}

/* ✅ GESCHENKE: Gelber Kreis */
.smg-widget.smg-bento-grid .smg-card.bento-gifts .bento-card-icon {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%) !important;
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.25) !important;
}

/* ✅ GENISSEN: Oranger Kreis */
.smg-widget.smg-bento-grid .smg-card.bento-dining .bento-card-icon {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
    box-shadow: 0 4px 16px rgba(243, 156, 18, 0.25) !important;
}

.smg-widget.smg-bento-grid .smg-card.bento-shops .bento-card-title {
    font-size: clamp(1rem, 2.5vw, 1.25rem) !important;
    font-weight: var(--font-weight-extrabold) !important;
    background: linear-gradient(135deg, var(--smg-500) 0%, var(--smg-500) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.smg-widget.smg-bento-grid .smg-card.bento-shops .bento-card-subtitle {
    font-size: clamp(0.8rem, 2vw, 0.9rem) !important;
    font-weight: var(--font-weight-bold) !important;
    color: var(--smg-gray-900) !important;
    opacity: 1 !important;
}

/* Alte Shops Button-Styles entfernt - Verwendet jetzt einheitliche .bento-card-action */

/* ✅ EINHEITLICHE HOVER-EFFEKTE FÜR ALLE ICONS */
.smg-widget.smg-bento-grid .smg-card:hover .bento-card-icon {
    transform: scale(1.1) rotate(5deg);
}

.smg-widget.smg-bento-grid .smg-card.bento-shops:hover .bento-card-icon {
    box-shadow: 0 6px 20px rgba(227, 30, 36, 0.4) !important;
}

.smg-widget.smg-bento-grid .smg-card.bento-opening-hours:hover .bento-card-icon {
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4) !important;
}

.smg-widget.smg-bento-grid .smg-card.bento-gifts:hover .bento-card-icon {
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4) !important;
}

.smg-widget.smg-bento-grid .smg-card.bento-dining:hover .bento-card-icon {
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4) !important;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1024px) {
    .smg-widget.smg-bento-grid .smg-bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(4, auto);
        gap: clamp(16px, 3vw, 24px);
    }
    
    .smg-widget.smg-bento-grid .grid-style-asymmetric,
    .smg-widget.smg-bento-grid .grid-style-balanced,
    .smg-widget.smg-bento-grid .grid-style-compact {
        grid-template-areas:
            "shops shops"
            "opening opening"
            "dining dining"
            "gifts gifts";
    }
}

@media (max-width: 768px) {
    .smg-widget.smg-bento-grid .smg-bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, auto);
        gap: var(--space-4);
    }
    
    .smg-widget.smg-bento-grid .grid-style-asymmetric,
    .smg-widget.smg-bento-grid .grid-style-balanced,
    .smg-widget.smg-bento-grid .grid-style-compact {
        grid-template-areas:
            "shops"
            "opening"
            "dining"
            "gifts";
    }
}
