/* ==========================================================================
   COMPONENTS (The Playful & Animated Edition)
   ========================================================================== */

/* --- 1. GLOBAL BUTTONS & RIPPLE --- */
.m3-button-filled, .m3-button-tonal, .m3-button-text {
    border: none; cursor: pointer; font-family: 'Roboto', sans-serif; 
    font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; transition: all 0.3s var(--md-sys-motion-easing-emphasized);
}

.m3-button-filled { background-color: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); padding: 12px 28px; border-radius: var(--md-sys-shape-corner-full); }
.m3-button-tonal { background-color: var(--md-sys-color-secondary); color: var(--md-sys-color-on-secondary); padding: 12px 28px; border-radius: var(--md-sys-shape-corner-full); }
.m3-button-filled:active, .m3-button-tonal:active { transform: scale(0.95); }

/* Το κλασικό σου Ripple Animation */
.ripple {
    position: absolute; border-radius: 50%; transform: scale(0);
    animation: ripple-animation 600ms cubic-bezier(0.2, 0, 0, 1); pointer-events: none;
    background-color: rgba(255, 255, 255, 0.3);
}
.m3-button-tonal .ripple, .m3-filter-chip .ripple, .m3-card .ripple, .m3-icon-button .ripple { background-color: rgba(0, 0, 0, 0.1); }
body.dark-mode .m3-button-tonal .ripple, body.dark-mode .m3-icon-button .ripple { background-color: rgba(255, 255, 255, 0.1); }

@keyframes ripple-animation {
    to { transform: scale(4); opacity: 0; }
}

/* --- 2. THEME TOGGLE (Elastic Morph) --- */
.m3-icon-button {
    width: 44px; height: 44px; border-radius: 50%; border: none !important;
    background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; text-decoration: none !important;
    transition: background-color 0.4s var(--md-sys-motion-easing-emphasized);
}

.theme-icon {
    font-size: 24px;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    will-change: transform, opacity;
}

.m3-icon-button:active .theme-icon { transform: scale(0.7); }

.theme-animate-sun { animation: sun-to-moon 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.theme-animate-moon { animation: moon-to-sun 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

@keyframes sun-to-moon {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(90deg) scale(0.5); opacity: 0.5; }
    100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

@keyframes moon-to-sun {
    0% { transform: rotate(360deg) scale(1); }
    50% { transform: rotate(180deg) scale(0.5); opacity: 0.5; }
    100% { transform: rotate(0deg) scale(1); opacity: 1; }
}

/* --- 3. M3 LANGUAGE TOGGLE (Bouncy Flags + Globe) --- */
.m3-lang-toggle {
    display: flex; align-items: center; 
    background-color: var(--md-sys-color-surface-container-high);
    border-radius: var(--md-sys-shape-corner-full);
    padding: 4px 6px 4px 12px; gap: 6px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

.m3-lang-toggle:hover {
    transform: scale(1.03); box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.lang-globe {
    font-size: 20px; color: var(--md-sys-color-primary); margin-right: 2px;
    opacity: 0.8; transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
    will-change: transform;
}

.m3-lang-toggle:hover .lang-globe {
    transform: rotate(180deg) scale(1.1); opacity: 1;
}

.lang-btn {
    display: flex !important; align-items: center !important; justify-content: center !important;
    width: 36px !important; height: 36px !important; border-radius: 50% !important;
    text-decoration: none !important; position: relative !important; z-index: 1 !important;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    background: transparent !important; border: none !important; padding: 0 !important;
}

.lang-flag {
    width: 22px !important; height: 22px !important; border-radius: 50% !important; object-fit: cover !important;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    filter: grayscale(80%) opacity(0.6) !important;
    border: none !important; padding: 0 !important; margin: 0 !important;
}

.lang-btn:hover:not(.active) .lang-flag {
    filter: grayscale(0%) opacity(1) !important;
    transform: translateY(-2px) scale(1.15) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important;
}

.lang-btn.active { pointer-events: none !important; }
.lang-btn.active .lang-flag {
    filter: grayscale(0%) opacity(1) !important;
    width: 26px !important; height: 26px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
}

.lang-btn.active::before {
    content: '' !important; position: absolute !important; top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    background-color: var(--md-sys-color-primary-container) !important;
    border-radius: 50% !important; z-index: -1 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
    animation: lang-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards !important;
}

@keyframes lang-pop {
    0% { transform: scale(0.4); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* --- 4. DECHRO AI LOGO - "GEMINI/ASSISTANT" GLOW --- */
.floating-ai-btn {
    position: fixed; bottom: 32px; right: 32px;
    background: #0d1218; color: white; width: 68px; height: 68px; border-radius: 22px; 
    display: flex; align-items: center; justify-content: center; text-decoration: none;
    box-shadow: 0 12px 28px rgba(0,0,0,0.25); z-index: 9999;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); 
}

.floating-ai-btn:hover { transform: translateY(-8px) scale(1.05); box-shadow: 0 16px 32px rgba(0,0,0,0.3); }
.floating-ai-btn:active { transform: translateY(0) scale(0.95); }

.dechro-ai-icon {
    width: 75%; height: 75%; object-fit: contain;
    animation: ai-gemini-glow 5s infinite ease-in-out;
    transition: all 0.4s var(--md-sys-motion-easing-emphasized);
    will-change: filter, transform;
}

/* Το Υγρό πολύχρωμο animation */
@keyframes ai-gemini-glow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(0, 195, 255, 0.3)); transform: scale(1); }
    33% { filter: drop-shadow(0 0 10px rgba(138, 43, 226, 0.5)) brightness(1.2); transform: scale(1.03); } 
    66% { filter: drop-shadow(0 0 12px rgba(0, 255, 255, 0.6)) brightness(1.1); transform: scale(1.02); } 
}

.floating-ai-btn:hover .dechro-ai-icon {
    animation-play-state: paused;
    filter: drop-shadow(0 0 16px rgba(0, 195, 255, 0.8)) brightness(1.3); 
    transform: scale(1.06);
}

/* --- 5. BADGES --- */
.cart-icon-btn { position: relative !important; overflow: visible !important; }
.cart-badge {
    position: absolute; top: -4px; right: -4px; background-color: var(--md-sys-color-secondary); color: #ffffff;
    font-size: 11px; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--md-sys-color-surface); box-sizing: content-box; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); z-index: 2;
}

.beta-badge {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%); color: #ffffff; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 10px;
    vertical-align: text-top; margin-left: 6px; text-transform: uppercase; letter-spacing: 0.5px; box-shadow: 0 2px 6px rgba(236, 72, 153, 0.4); display: inline-block; line-height: 1; border: none;
}