/* =========================================
   PALETTE: FIERA DEL FUNGO 🍄
   ========================================= */

:root {
    /* COLORE PRIMARIO (Bottoni "Avanti", "Ordina", Titoli principali)
       Uso un Marrone Ruggine caldo, molto invitante per il cibo */
    --bs-primary: #a0522d;
    --bs-primary-rgb: 160, 82, 45; /* Necessario per le ombre di Bootstrap */

    /* COLORE SUCCESSO (Bottoni "Aggiungi", Prezzi)
       Uso un Verde Bosco profondo, non brillante/artificiale */
    --bs-success: #3a6b35;

    /* COLORE ACCENTO (Bordi card, dettagli)
       Uso un Giallo Ocra/Senape (simile ai finferli) */
    --bs-yellow: #e3b448;

    /* COLORE TITOLI SECONDARI
       Uso un Marrone scuro quasi nero per il testo importante */
    --bs-red: #5d4037;

    /* SFONDO PAGINA
       Un color crema/avorio molto leggero per non stancare gli occhi */
    --bs-body-bg: #fcfbf8;
    --bs-body-color: #3e3e3e; /* Testo grigio scuro, più morbido del nero */
}

/* =========================================
   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: #8a4524; /* Darker shade of primary */
    border-color: #8a4524;
    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: #2e5429; /* Darker shade of success */
    border-color: #2e5429;
    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 #f0deac !important;
}

.sold-out-overlay {
    position: absolute;
    top: 19%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(
        160,
        82,
        45,
        0.9
    ); /* Use primary color (Rust) for consistency or keep red? */
    /* Using Rust for now to match theme, or could be a specific 'danger' var */
    background: rgba(var(--bs-primary-rgb), 0.9);
    color: white;
    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: #3e2723 !important; /* Marrone scuro "caffè/terra" */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

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

.nav-tabs .nav-link {
    color: #5d4037; /* Marrone 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 #e0e0d0; /* Bordo sottile grigio caldo */
    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;
}
