:root {
    --ro-bg: #1a1a1a;
    --ro-card-bg: #2a2a2a;
    --ro-gold: #c8a374; /* Sabbia/Oro */
    --ro-text: #ffffff;
    --ro-text-muted: #bbbbbb;
    --ro-border-radius: 8px;
    --ro-primary: #c8a374;
    --ro-success: #4caf50;
    --ro-danger: #ffffff; 
    --ro-white-icon: #ffffff;
}

/* SETUP DEL CONTENITORE PRINCIPALE */
.ro-frontend {
    background-color: var(--ro-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ro-text);
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.ro-frontend * {
    box-sizing: border-box;
}

/* --- HEADER --- */
.ro-header {
    background: linear-gradient(to bottom, #000, var(--ro-bg));
    padding: 20px 0;
    text-align: center;
    border-bottom: 1px solid #333;
}

.ro-header h1 {
    color: var(--ro-gold);
    margin: 0;
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ro-table-badge {
    display: inline-block;
    background: #333;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-top: 5px;
    color: #fff;
}

/* --- CONTAINER INTERNO --- */
.ro-container {
    width: 100%;
    padding: 15px;
    padding-bottom: 80px; /* Spazio per la floating bar */
    margin: 0 auto;
}

/* --- MENU GRID --- */
.ro-category-section {
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--ro-gold);
    padding-bottom: 5px;
}

.ro-cat-title {
    color: var(--ro-gold);
    font-size: 1.5rem;
    margin: 0;
    text-transform: uppercase;
}

.ro-category-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ITEM CARD */
.ro-menu-item {
    background: var(--ro-card-bg);
    border-radius: var(--ro-border-radius);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.1s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    border: 1px solid transparent;
}

.ro-menu-item:hover {
    border-color: #444;
}

.ro-menu-item:active {
    transform: scale(0.98);
}

.ro-item-content {
    flex: 1;
    padding-right: 15px;
}

.ro-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.ro-item-name {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
    font-weight: 600;
}

.ro-item-price {
    color: var(--ro-gold);
    font-weight: bold;
    font-size: 1.1rem;
    white-space: nowrap;
}

.ro-item-desc {
    margin: 0;
    font-size: 0.85rem;
    color: var(--ro-text-muted);
    line-height: 1.4;
}

/* Tasto Aggiungi (+) - STILE OUTLINE ELEGANTE */
.ro-add-btn {
    background: transparent !important; /* Sfondo trasparente */
    border: 1px solid #ffffff !important; /* Bordo sottile bianco */
    color: #ffffff !important;      /* Simbolo + Bianco */
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300; /* Più fine ed elegante */
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none !important;
}

.ro-add-btn:hover {
    background: #ffffff !important;
    color: #000000 !important;
    transform: scale(1.05);
}

/* Stato aggiunto (spunta verde) */
.ro-add-btn.added {
    background: var(--ro-success) !important;
    border-color: var(--ro-success) !important;
    color: #fff !important;
}

/* --- FLOATING BAR --- */
#ro-floating-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: var(--ro-gold);
    color: #000;
    padding: 15px 20px;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    z-index: 999;
    cursor: pointer;
    display: none;
    justify-content: center;
}

.ro-float-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.ro-float-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 1.1rem;
}

#ro-float-count {
    background: #000;
    color: var(--ro-gold);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.ro-float-total {
    font-weight: 800;
    font-size: 1.2rem;
}

/* --- MODALS --- */
.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: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.ro-modal-box {
    background: #1e1e1e;
    width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 -5px 30px rgba(0,0,0,0.5);
}

.ro-cart-header {
    padding: 15px 20px;
    background: #252525;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ro-cart-header h2 {
    margin: 0;
    color: var(--ro-gold);
    font-size: 1.4rem;
}

.ro-close-cart {
    font-size: 2rem;
    cursor: pointer;
    color: #fff;
    line-height: 0.8;
}

#ro-cart-content-scroll {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.ro-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2a2a2a;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 8px;
}

.ro-qty-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #333; /* Sfondo leggermente più chiaro del nero */
    padding: 5px;
    border-radius: 20px;
    border: 1px solid #444;
}

/* Tasti + e - nel carrello - STILE OUTLINE */
.ro-qty-control button {
    background: transparent !important;
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    padding: 0;
}

.ro-qty-control button:hover {
    background: #ffffff !important;
    color: #000000 !important;
}

.ro-item-qty {
    color: #fff;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.ro-cart-details {
    flex: 1;
    margin-left: 15px;
    display: flex;
    flex-direction: column;
}

.ro-cart-name {
    font-weight: bold;
    color: #fff;
}

.ro-cart-price {
    color: var(--ro-gold);
    font-size: 0.9rem;
}

/* Tasto Elimina - BIANCO */
.ro-cart-delete {
    background: none;
    border: none;
    color: var(--ro-white-icon) !important;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 10px;
    transition: transform 0.2s;
}
.ro-cart-delete:hover {
    transform: scale(1.2);
}

.ro-cart-summary {
    margin-top: 20px;
    border-top: 1px solid #444;
    padding-top: 15px;
    text-align: right;
    font-size: 1.3rem;
    color: #fff;
}

.ro-form-group {
    margin-bottom: 15px;
}

.ro-form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--ro-text-muted);
}

.ro-form-group input, .ro-form-group textarea {
    width: 100%;
    padding: 10px;
    background: #000;
    border: 1px solid #444;
    color: #fff;
    border-radius: 6px;
    font-size: 1rem;
}

.ro-modal-footer-fixed {
    padding: 15px 20px;
    background: #252525;
    border-top: 1px solid #333;
}

.full-width {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
}

.ro-btn-primary {
    background: var(--ro-gold);
    color: #000;
}

.ro-btn-success {
    background: var(--ro-success);
    color: #fff;
}

/* ERRORI IN ROSSO */
.ro-error {
    color: #ff4444; 
    margin-top: 10px;
    font-weight: bold;
}

/* SUCCESS SCREEN */
.ro-success-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ro-success-card {
    background: #222;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    border: 1px solid #444;
}

.ro-receipt-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    border-bottom: 1px dashed #444;
    padding-bottom: 8px;
    color: #ddd;
}

.ro-receipt-total-row {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--ro-gold);
    margin-top: 15px;
}

/* =========================================
   DESKTOP STYLES (Min-width 768px)
   ========================================= */
@media (min-width: 768px) {
    
    .ro-frontend {
        max-width: 100%; 
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .ro-container {
        max-width: 1200px; 
        padding-top: 40px;
    }

    .ro-category-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .ro-modal-overlay {
        align-items: center;
    }
    
    .ro-modal-box {
        max-width: 500px;
        border-radius: 20px;
        max-height: 80vh;
        margin: 0 auto;
    }
    
    #ro-floating-bar {
        bottom: 30px;
        width: auto;
        padding: 15px 40px;
        transition: transform 0.2s;
    }
    #ro-floating-bar:hover {
        transform: translateX(-50%) scale(1.05);
    }
}

@media (min-width: 1024px) {
    .ro-category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}