/* ===== Digital Engine Design System - Base Styles ===== */

/* Material Symbols */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Base Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-surface);
    color: var(--color-on-surface);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
    background: rgba(var(--rgb-primary), 0.3);
    color: var(--color-on-surface);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--color-surface-container-highest);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-outline-variant);
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-surface-container-high);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-surface-container-high);
    border-top: 2px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fade in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

/* Mozgás-érzékenység: a beúszó animáció kimarad, a tartalom azonnal a helyén van.
   A guard a definíció mellett áll, így minden .animate-fadeIn használatra érvényes —
   a MainLayout mobil-fiókja és a CartHoverPreview korábban védtelen volt. */
@media (prefers-reduced-motion: reduce) {
    .animate-fadeIn {
        animation: none;
    }
}

/* Hero carousel slide animation */
@keyframes heroSlideIn {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes heroImageIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateX(40px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

.hero-slide-text {
    animation: heroSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-slide-image {
    animation: heroImageIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

/* Pulse glow for primary elements */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--rgb-primary), 0.2); }
    50% { box-shadow: 0 0 16px 4px rgba(var(--rgb-primary), 0.15); }
}

/* Cart notification animation */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cart-notification-animate {
    animation: slideDown 0.3s ease-out;
}

/* Cart toast (kosárba helyezés visszajelzése) – jobb oldali becsúszás */
@keyframes cartToastSlide {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.cart-toast-slide {
    animation: cartToastSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Kosár ikon "ugrás" amikor új tétel kerül bele */
@keyframes cartIconBump {
    0%   { transform: scale(1); }
    25%  { transform: scale(1.25) rotate(-8deg); }
    50%  { transform: scale(1.15) rotate(6deg); }
    75%  { transform: scale(1.1)  rotate(-3deg); }
    100% { transform: scale(1) rotate(0); }
}

.cart-icon-bump {
    animation: cartIconBump 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
    display: inline-block;
}

/* Blazor error UI */
#blazor-error-ui {
    background: var(--color-error-container);
    color: var(--color-on-error-container);
    bottom: 0;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
    display: none;
    left: 0;
    padding: 12px 24px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 16px;
    top: 8px;
    color: var(--color-on-error-container);
}

#blazor-error-ui .reload {
    color: var(--color-primary);
    margin-left: 8px;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(var(--rgb-surface-container-lowest), 0.95);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: var(--color-outline);
    cursor: pointer;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: var(--color-primary);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(var(--rgb-surface-container), 0.8);
    border: 1px solid rgba(var(--rgb-outline-variant), 0.3);
    color: var(--color-on-surface);
    cursor: pointer;
    padding: 12px;
    transition: all 0.2s;
}

.lightbox-nav:hover {
    background: rgba(var(--rgb-primary), 0.1);
    border-color: rgba(var(--rgb-primary), 0.3);
}

.lightbox-prev {
    left: -60px;
}

.lightbox-next {
    right: -60px;
}

.lightbox-counter {
    text-align: center;
    margin-top: 12px;
    color: var(--color-outline);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Mobil navigációs fiók (MobilMenuKeret.razor): nyitva a háttér-oldal nem görget.
   Csak md alatt (a keret md:hidden), hogy egy nyitva felejtett fiók asztali szélességre
   váltva se zárolja a görgetést. */
@media (max-width: 767.98px) {
    html:has([data-mobil-menu]),
    body:has([data-mobil-menu]) {
        overflow: hidden;
    }
}

@keyframes mobil-menu-be {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.mobil-menu-panel {
    animation: mobil-menu-be 0.2s ease-out;
}

.mobil-menu-hatter {
    animation: mobil-menu-halvanyul 0.2s ease-out;
}

@keyframes mobil-menu-halvanyul {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .mobil-menu-panel,
    .mobil-menu-hatter {
        animation: none;
    }
}

/* Product description HTML content styling */
.description-html-content h1,
.description-html-content h2,
.description-html-content h3,
.description-html-content h4 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--color-on-surface);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
    font-weight: 600;
}

.description-html-content p {
    color: var(--color-on-surface-variant);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.description-html-content ul, .description-html-content ol {
    color: var(--color-on-surface-variant);
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.description-html-content li {
    margin-bottom: 0.5rem;
}

.description-html-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.description-html-content td, .description-html-content th {
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-surface-container-high);
    text-align: left;
}

.description-html-content img {
    border-radius: 4px;
    margin: 1rem 0;
}

/* Form inputs default styling for dark theme */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="password"],
input[type="search"],
textarea,
select {
    background-color: var(--color-surface-container-low);
    color: var(--color-on-surface);
    border: 1px solid var(--color-outline-variant);
    font-family: 'Inter', sans-serif;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(var(--rgb-primary), 0.15);
}

input[type="checkbox"] {
    accent-color: var(--color-primary);
}

/* Number input - hide spin buttons */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Dual range slider */
.dual-range-wrap {
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
}

.dual-range-wrap input[type="range"] {
    position: absolute;
    left: 0;
    width: 100%;
    height: 4px;
    margin: 0;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    z-index: 1;
}

.dual-range-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 2px solid var(--color-surface);
    cursor: pointer;
    pointer-events: all;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 6px rgba(var(--rgb-primary), 0.3);
    transition: box-shadow 0.2s, transform 0.15s;
}

.dual-range-wrap input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(var(--rgb-primary), 0.5);
}

.dual-range-wrap input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 2px solid var(--color-surface);
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 0 6px rgba(var(--rgb-primary), 0.3);
}

.dual-range-track {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-surface-container-highest);
    border-radius: 2px;
}

.dual-range-fill {
    position: absolute;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary-container), var(--color-primary));
    border-radius: 2px;
}

/* Product images - mix-blend-mode to handle white backgrounds */
.product-img-wrap {
    background: #f3f4f6;
    border-radius: 4px;
}

.product-img-blend {
    mix-blend-mode: multiply;
}

/* ===== Kapcsolat-vesztési doboz (UjracsatlakozasModal.razor) =====
   A blazor.web.js az állapotot osztályokkal jelzi a #components-reconnect-modal elemen; alapból
   rejtett. A színek a bolt témájából jönnek, fallbackkel arra az esetre, ha a téma nem töltött be. */
.ujracsatlakozas {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000; /* a teszt-környezet szalagja (99999) fölött */
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}
.ujracsatlakozas.components-reconnect-show,
.ujracsatlakozas.components-reconnect-failed,
.ujracsatlakozas.components-reconnect-rejected {
    display: flex;
}
.ujracsatlakozas-doboz {
    width: 100%;
    max-width: 380px;
    padding: 28px 24px;
    text-align: center;
    background: var(--color-surface-bright, #ffffff);
    color: var(--color-on-surface, #1c2b35);
    border-top: 4px solid var(--color-primary, #1d4ed8);
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.45);
}
.ujracsatlakozas-allapot {
    display: none;
}
.ujracsatlakozas.components-reconnect-show .ujracsatlakozas-allapot--show,
.ujracsatlakozas.components-reconnect-failed .ujracsatlakozas-allapot--failed,
.ujracsatlakozas.components-reconnect-rejected .ujracsatlakozas-allapot--rejected {
    display: block;
}
.ujracsatlakozas-cim {
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 6px;
}
.ujracsatlakozas-leiras {
    font-size: 0.875rem;
    opacity: 0.8;
}
.ujracsatlakozas-gomb {
    margin-top: 18px;
    padding: 10px 22px;
    font-weight: 700;
    cursor: pointer;
    border: 0;
    background: var(--color-primary, #1d4ed8);
    color: var(--color-on-primary, #ffffff);
}
.ujracsatlakozas-gomb:disabled {
    opacity: 0.6;
    cursor: wait;
}
.ujracsatlakozas-porgo {
    display: inline-block;
    width: 32px;
    height: 32px;
    margin-bottom: 12px;
    border: 3px solid var(--color-outline-variant, #cbd5e1);
    border-top-color: var(--color-primary, #1d4ed8);
    border-radius: 9999px;
    animation: ujracsatlakozas-forgas 0.9s linear infinite;
}
@keyframes ujracsatlakozas-forgas {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .ujracsatlakozas-porgo { animation-duration: 2.5s; }
}

/* Termékkép-tartó háttere (a kép körüli üres tér). Alapból a téma eddigi színe; a horgász
   sablon stíluslapja fehérre írja felül. */
.termek-kep-hatter {
    background: var(--color-surface-container-highest);
}

.termek-kep-hatter-halvany {
    background: var(--color-surface-container-low);
}

/* Prémium kereső: a keresett szórész kiemelése (javaslat, kereső-kártya). */
mark {
    background-color: rgba(250, 204, 21, 0.35);
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

/* Előrendelés jelvény (termékoldal, kártya, kosár). Saját, a Készleten/Megrendelhető
   színeitől eltérő indigó, hogy a vevő ne keverje össze a beszállítótól rendelhető áruval:
   előrendelésnél a darab már úton van hozzánk, csak még nem érkezett meg. */
.stock-preorder {
    background-color: #4f46e5;
    color: #ffffff;
}
