/* --- RESET FORZATO & VARIABILI --- */
#ro-order-app {
    --ro-gold: #C8A374;
    --ro-bg-dark: #202020;
    --ro-bg-light: #303030;
    --ro-text: #ffffff;
    --ro-text-muted: #aaaaaa;
    --ro-border: #444444;
    
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--ro-text);
    width: 100%;
    box-sizing: border-box;
    /* Spazio extra in fondo alla pagina principale per non coprire i prodotti col bottone */
    padding-bottom: 120px; 
}
#ro-order-app * { box-sizing: border-box; }

/* --- HEADER SITO --- */
#ro-order-app .ro-header { text-align: center; padding: 30px 0; margin-bottom: 30px; border-bottom: 1px solid var(--ro-border); }
#ro-order-app .ro-header h1 { color: var(--ro-gold) !important; font-size: 2.5rem !important; margin: 0 !important; text-transform: uppercase; }
#ro-order-app .ro-table-badge { background: var(--ro-gold); color: #000; padding: 6px 15px; border-radius: 4px; font-weight: bold; display: inline-block; margin-top: 10px; }

/* --- MENU --- */
#ro-order-app .ro-category h3 { color: var(--ro-gold) !important; font-size: 1.8rem !important; border-bottom: 1px solid var(--ro-gold); padding-bottom: 5px; margin-top: 30px; }
#ro-order-app .ro-category-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

/* CARD PRODOTTO */
#ro-order-app .ro-menu-item { background: var(--ro-bg-light); border: 1px solid var(--ro-border); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; position: relative; height: 100%; }
#ro-order-app .ro-menu-item img { width: 100%; height: 180px; object-fit: cover; }
#ro-order-app .ro-item-info { padding: 15px; flex-grow: 1; }
#ro-order-app .ro-item-info h4 { color: #fff; margin: 0 0 5px 0; font-size: 1.1rem; }
#ro-order-app .ro-item-price { color: var(--ro-gold); font-weight: bold; font-size: 1.2rem; margin-top: 10px; }

/* Bottone + */
#ro-order-app .ro-add-btn { position: absolute; bottom: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; background: transparent; border: 2px solid var(--ro-gold); color: var(--ro-gold); font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
#ro-order-app .ro-add-btn.added { background: var(--ro-gold); color: #000; }

/* MOBILE CARD LAYOUT */
@media (max-width: 768px) {
    #ro-order-app .ro-menu-item { flex-direction: row; height: 120px; }
    #ro-order-app .ro-menu-item img { width: 120px; height: 100%; }
}

/* ============================================================
   1. BOTTONE GALLEGGIANTE (STICKY BOTTOM BAR)
   ============================================================ */
#ro-floating-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: var(--ro-gold);
    color: #000;
    border-radius: 50px;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    z-index: 99990;
    cursor: pointer;
    transition: transform 0.2s;
}
#ro-floating-bar:active { transform: translateX(-50%) scale(0.98); }

/* ============================================================
   2. POPUP CARRELLO (MODAL)
   ============================================================ */
/* Overlay generale (Sfondo scuro) */
.ro-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Su desktop diamo padding per non toccare i bordi */
    padding: 20px; 
}

/* Scatola Bianca (Il Carrello vero e proprio) */
.ro-modal-box {
    background: var(--ro-bg-dark);
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    border: 1px solid var(--ro-gold);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* Desktop: non tocca mai cima e fondo */
    position: relative;
}

/* --- TRASFORMAZIONE MOBILE (FULL SCREEN) --- */
@media (max-width: 768px) {
    .ro-modal-overlay {
        padding: 0 !important; /* Rimuovi spazi ai bordi */
        background: var(--ro-bg-dark) !important; /* Niente trasparenza, full immersion */
    }
    
    .ro-modal-box {
        width: 100% !important;
        height: 100% !important; /* Occupa tutto lo schermo */
        max-height: none !important;
        max-width: none !important;
        border-radius: 0 !important; /* Niente angoli tondi */
        border: none !important;
    }
}

/* Header del Popup */
.ro-cart-header {
    padding: 20px;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--ro-bg-light);
    flex-shrink: 0; /* Non si schiaccia mai */
}
/* Angoli tondi solo su desktop */
@media (min-width: 769px) { .ro-cart-header { border-radius: 12px 12px 0 0; } }

.ro-cart-header h2 { margin: 0 !important; color: var(--ro-gold); font-size: 1.5rem; }
.ro-close-cart { font-size: 2.5rem; cursor: pointer; color: #fff; line-height: 0.5; padding: 10px; }

/* Area Scrollabile Interna */
#ro-cart-content-scroll {
    overflow-y: auto;
    padding: 20px;
    flex-grow: 1; /* Occupa tutto lo spazio centrale */
    -webkit-overflow-scrolling: touch; /* Scroll fluido iPhone */
}

/* Footer Fisso del Popup (Bottone Paga) */
.ro-modal-footer-fixed {
    padding: 20px;
    border-top: 1px solid #444;
    background: var(--ro-bg-light);
    flex-shrink: 0;
    /* Cuscinetto di sicurezza per iPhone (barra in basso) */
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}
/* Angoli tondi solo su desktop */
@media (min-width: 769px) { .ro-modal-footer-fixed { border-radius: 0 0 12px 12px; } }

/* Elementi carrello */
.ro-cart-item { display: flex; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid #333; }
.ro-cart-item-info { color: #fff; font-size: 1.1rem; }
.ro-cart-actions { display: flex; align-items: center; gap: 15px; color: var(--ro-gold); font-weight: bold; }
.ro-cart-remove { background: #444; color: #fff; border: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 20px; }

/* Form e Input */
.ro-form-group { margin-bottom: 15px; }
.ro-form-group label { display: block; color: #aaa; margin-bottom: 5px; font-size: 0.9rem; }
.ro-form-group input, .ro-form-group textarea { 
    width: 100%; padding: 15px; 
    background: #111; border: 1px solid #444; 
    color: #fff; border-radius: 6px; 
    font-size: 16px; /* Evita zoom su iPhone */
}

/* Bottone Checkout */
#ro-submit-order { width: 100%; padding: 18px; background: var(--ro-gold); border: none; font-weight: bold; font-size: 1.2rem; cursor: pointer; border-radius: 6px; text-transform: uppercase; color: #000; }