/* =========================================
   PALETTE: FIERA DEL FUNGO ðŸ„
   ========================================= */

:root {
    /* PALETTE ESTIVA (Fresh Sea Food - Venice)
       Primary: azzurro mare
       Accent: giallo sole
       Success: verde fresco
       Red: accento ruggine/mediterraneo */

    --bs-primary: #0B6E93;
    --bs-primary-rgb: 11, 110, 147; /* Necessario per le ombre di Bootstrap */

    --bs-success: #2FA36A;

    --bs-yellow: #F3C34A;

    --bs-red: #9B4A2E;

    --bs-body-bg: #F6FBFF;
    --bs-body-color: #22323A; /* grigio/verde scuro per leggibilità */
}


/* =========================================
   SEMANTIC UTILITIES (APP THEME)
   ========================================= */

/* Typography */
.text-app-primary {
    color: var(--bs-primary) !important;
}
.text-app-success {
    color: var(--bs-success) !important;
}
.text-app-accent {
    color: var(--bs-yellow) !important;
}
.text-app-dark {
    color: var(--bs-red) !important;
}

/* Buttons */
.btn-app-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}
.btn-app-primary:hover,
.btn-app-primary:active,
.btn-app-primary:focus {
    background-color: #102450; /* Darker shade of primary */
    border-color: #102450;
    color: #fff;
}

.btn-app-success {
    background-color: var(--bs-success);
    border-color: var(--bs-success);
    color: #fff;
}
.btn-app-success:hover,
.btn-app-success:active,
.btn-app-success:focus {
    background-color: #3b8755; /* Darker shade of success */
    border-color: #3b8755;
    color: #fff;
}

.btn-app-outline-primary {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
    background-color: transparent;
}
.btn-app-outline-primary:hover {
    background-color: var(--bs-primary);
    color: #fff;
}

.btn-app-outline-danger {
    color: var(--bs-red);
    border-color: var(--bs-red);
    background-color: transparent;
}
.btn-app-outline-danger:hover {
    background-color: var(--bs-red);
    color: #fff;
}

/* Inputs & Forms */
.input-app {
    /* border: none; Removed to prevent deformation - user wants only color logic */
    border-bottom: 3px solid var(--bs-red);
    border-radius: 0;
}
.input-app:focus {
    box-shadow: none;
    border-bottom-color: var(--bs-primary);
}

.input-group-text-app {
    border: none;
    border-bottom: 3px solid var(--bs-red);
    background-color: transparent;
    font-weight: bold;
    color: var(--bs-red);
}

/* Badges & Backgrounds */
.bg-app-accent {
    background-color: var(--bs-yellow) !important;
    color: #000;
}

/* Custom Badges for + / - */
.badge-app-plus {
    background-color: var(--bs-success) !important;
    color: #fff;
}
.badge-app-minus {
    background-color: var(--bs-red) !important;
    color: #fff;
}

/* =========================================
   COMPONENT STYLES (STEP 3 & OTHERS)
   ========================================= */

img {
    opacity: 1;
    transition: opacity 0.3s;
}

img[data-src] {
    opacity: 0;
}

@keyframes pulse {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 0.1;
    }
    100% {
        opacity: 0;
    }
}

/* Blur-up Image Loading */
.blur-load {
    position: relative;
    overflow: hidden;
    /* No filter on container to avoid blurring text/child images */
}

.blur-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(10px);
    transform: scale(1.1); /* Prevent white edges from blur */
    z-index: 1;
}

/* Optional: Pulse effect on the placeholder */
.blur-placeholder {
    animation: pulse 2.5s infinite;
}
.blur-load.loaded .blur-placeholder {
    animation: none;
}

.blur-main {
    position: relative;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: block;
    width: 100%;
}

.blur-main.loaded {
    opacity: 1;
}

.card-app-outline {
    border-top: 3px solid var(--bs-yellow) !important;
}


.sold-out-overlay {
    position: absolute;
    top: 19%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(var(--bs-primary-rgb), 0.9);
    color: #fff;
    padding: 5px 10px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    border-radius: 5px;
}


.attributes-corner {
    position: absolute;
    top: -15px;
    right: -15px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    z-index: 10;
    justify-content: flex-end;
    pointer-events: none;
}

.allergens-container {
    gap: 0.2rem;
    /* Spaziatura tra le immagini */
}

.allergen-icon {
    width: 2rem;
    /* Larghezza predefinita per tutte le immagini degli allergeni */
    height: auto;
    max-height: 50px;
}

.item-finished {
    filter: grayscale(1);
    opacity: 0.7;
}

.item-image-bg {
    text-align: center;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 1) 0%,
        var(--web-items-images-bg-color, #ffffff) 100%
    );
}

/* SweetAlert2 Customizations */
.swal2-success {
    border-color: var(--bs-success) !important;
    color: var(--bs-success) !important;
}

.swal2-success-line-long {
    background-color: var(--bs-success) !important;
}

.swal2-success-line-tip {
    background-color: var(--bs-success) !important;
}

.swal2-success-ring {
    border: 0.25em solid rgba(58, 107, 53, 0.3) !important; /* Forest Green with opacity */
}

/* =========================================
   CUSTOMIZZAZIONE HEADER
   ========================================= */

/* Sovrascrive lo sfondo nero di default dell'header */
header.fixed-top {
    background-color: var(--bs-primary) !important; /* Blu scuro brand aligned */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}


/* =========================================
   ELEMENTI DI NAVIGAZIONE (TABS)
   ========================================= */

.nav-tabs .nav-link {
    color: var(--bs-red); /* Blu scuro testo non attivo */
}

.nav-tabs .nav-link.active {
    color: var(--bs-primary); /* Ruggine quando attivo */
    border-color: var(--bs-primary) var(--bs-primary) var(--bs-body-bg);
    background-color: var(--bs-body-bg);
    font-weight: 700;
}


/* =========================================
   CARD PRODOTTI
   ========================================= */

.card {
    border: 1px solid var(--bs-yellow); /* Bordo sottile azzurro pallido */
    background-color: #fff;
}


body {
    font-family: "Rubik", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
}

/* Sticky footer styles-------------------------------------------------- */
html {
    position: relative;
    min-height: 100%;
}

body {
    /* Margin bottom by footer height */
    margin-bottom: 60px;
    margin-top: 4.5rem;
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    /* Set the fixed height of the footer here */
    height: 60px;
    line-height: 60px;
    /* Vertically center the text there */
}

/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */

body > .container {
    padding: 60px 15px 0;
}

.footer > .container {
    padding-right: 15px;
    padding-left: 15px;
}

h3 {
    font-size: 48px;
    font-weight: 700;
    --bs-text-opacity: 1;
    color: rgba(var(--bs-primary), var(--bs-text-opacity)) !important;
}

code {
    font-size: 80%;
}

h3 em {
    font-style: normal;
    position: relative;
    --bs-text-opacity: 1;
    color: rgba(var(--bs-primary-rgb), var(--bs-text-opacity)) !important;
}

h3 em:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    height: 10px;
    z-index: -1;
}

/* =========================================================
   Widget quantitÃ  articolo â€” pattern "morph" (Uber Eats / Glovo)
   Stato vuoto: CTA "Aggiungi" a tutta larghezza
   Stato pieno: stepper [-] qta [+]
   ========================================================= */
.qta-widget {
    position: relative;
    min-height: 46px;
    clear: both;
}

.qta-widget .qta-add-btn,
.qta-widget .qta-stepper {
    transition:
        opacity 0.22s ease,
        transform 0.22s ease;
    will-change: opacity, transform;
}

/* CTA "Aggiungi" */
.qta-widget .qta-add-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
    opacity: 1;
    transform: scale(1);
}

.qta-widget .qta-add-btn:active {
    transform: scale(0.97);
}

.qta-widget .qta-add-btn i {
    font-size: 0.9rem;
}

/* Stepper (sovrapposto, nascosto di default) */
.qta-widget .qta-stepper.input-group {
    position: absolute;
    inset: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    opacity: 0;
    transform: scale(0.94);
    pointer-events: none;
    margin-bottom: 0;
    background: transparent;
}

.qta-widget .qta-stepper .decrement,
.qta-widget .qta-stepper .increment {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 50% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1rem;
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease;
}

.qta-widget .qta-stepper .decrement:active,
.qta-widget .qta-stepper .increment:active {
    transform: scale(0.92);
}

.qta-widget .qta-stepper .quantity {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    text-align: center;
    font-weight: 700;
    font-size: 1.2rem;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
    color: var(--bs-body-color, #212529);
}

.qta-widget .qta-stepper .quantity:disabled {
    background: transparent;
    color: inherit;
    opacity: 1;
}

.qta-widget .qta-stepper .quantity:focus {
    outline: none;
    box-shadow: none;
}

/* Swap degli stati */
.qta-widget.has-qty .qta-add-btn {
    opacity: 0;
    transform: scale(0.94);
    pointer-events: none;
}

.qta-widget.has-qty .qta-stepper.input-group {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Bump sul numero quando cambia la quantitÃ  */
.qta-widget .quantity.qty-bump {
    animation: qtyBump 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes qtyBump {
    0% {
        transform: scale(1);
    }
    45% {
        transform: scale(1.28);
    }
    100% {
        transform: scale(1);
    }
}