.tp-rt-container {
    width: 100%;
}

.tp-rt-my-orders-wrapper {
    min-width: 290px;
    min-height: 500px;
}

.tp-rt-single-order-wrapper {
    max-width: 800px;
    min-width: 320px;
    min-height: 500px;
    margin: 0 auto;
    /*padding: 20px;*/
}

/* Widget Fluttuante */
#tp-rt-floating-cart {
    position: fixed !important;
    top: 100px !important;    /* Distanza dall'alto - aumentata per evitare la Admin Bar di WP */
    right: 30px !important;  /* Distanza da destra */
    width: 60px !important;
    height: 60px !important;
    background: #ffffff !important;
    border: 2px solid var(--tp-rt-primary-color) !important;
    border-radius: 50% !important;
    z-index: 9999999 !important; /* Valore altissimo per stare sopra a sidebar e menu */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3) !important;
    cursor: pointer !important;
}

input {
    margin-bottom: 5px;
}

.tp-rt-cart-icon-wrapper {
    margin-top: 5px;
}

.tp-rt-cart-icon-wrapper svg {
    color: var(--tp-rt-primary-color);
    width: 30px;
    height: 30px;
}

.tp-rt-cart-icon { font-size: 24px; }
/* Badge contatore */
.tp-rt-cart-count {
    position: absolute !important;
    top: -5px !important;
    right: -5px !important;
    background: #333 !important;
    color: #fff !important;
    border-radius: 50% !important;
    width: 22px !important;
    height: 22px !important;
    font-size: 11px !important;
    display: none; 
    align-items: center;
    justify-content: center;
    border: 2px solid #fff !important;
}
.tp-rt-cart-count.show { display: flex !important; }

/* Animazione di aggiunta */
.tp-rt-cart-bounce { animation: cartBounce 0.5s ease; }
@keyframes cartBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Dropdown che appare al passaggio del mouse */
.tp-rt-cart-dropdown {
    display: none;
    position: absolute !important;
    top: 63px !important; /* Leggermente pił su per avvicinarlo all'icona */
    right: 0 !important;
    width: 400px !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 12px !important;
    padding: 20px !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2) !important;
    cursor: default !important;
    text-align: left !important;
}

#tp-rt-floating-cart::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 20px; /* Area di "ponte" invisibile */
    display: block;
}

.tp-rt-cart-dropdown::before {
    content: "";
    position: absolute;
    top: -20px; /* Si estende verso l'alto per toccare l'icona */
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1; /* Sotto al contenuto */
}

#tp-rt-floating-cart:hover .tp-rt-cart-dropdown,
.tp-rt-cart-dropdown:hover {
    display: block !important;
}

/* Stile lista interna */
.tp-rt-items-ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 15px 0 !important;
    max-height: 200px;
    overflow-y: auto;
}
.tp-rt-items-ul li {
    font-size: 14px !important;
    border-bottom: 1px solid #eee;
    padding: 8px 0 !important;
    color: #333 !important;
}

/*--- Pagina Checkout ---*/
#tp-rt-checkout-container {
    max-width: 800px;
    margin: 0 auto;
    background: #f9f9f9;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

@media (max-width: 600px) {
 #tp-rt-checkout-container {
    max-width: 600px;
    margin: 0 auto;
    background: #f9f9f9;
    padding: 0px;
    border-radius: 10px;
    box-shadow: 0 5px 5px rgba(0,0,0,0.05);
 }
 .tp-rt-checkout-summary {
    padding: 0px !important;
    border-radius: 4px !important;
    margin-bottom: 20px !important;
 }
 #tp-rt-floating-cart {
    top: 70px !important;
    right: 10px !important;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3) !important;
 }
 .tp-rt-cart-dropdown {
    right: 0px !important;
    width: 370px !important;
    border-radius: 8px !important;
    padding: 10px !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2) !important;
 } 
}

#preferred_time {
    max-width:110px; 
    border-radius: 10px;
}

.tp-rt-btn-checkout, .tp-rt-address-link { color: var(--tp-rt-primary-color) !important; }
.tp-rt-btn-checkout:hover, .tp-rt-address-link:hover { color: var(--tpum-hover-color) !important; }

.tp-rt-small-button {
    background-color: var(--tp-rt-primary-color);
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 1em;
    /*font-weight: bold;*/
    transition: background-color 0.3s ease;
    width: auto;
}
.tp-rt-small-button:hover { color: white; background-color: var(--tpum-hover-color) !important; }

.tp-rt-checkout-summary {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
}

#tp-rt-checkout-form h3 {
    margin-top: 25px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.tp-rt-btn-place-order,
.tp-rt-btn-process-payment {
    background: var(--tp-rt-primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 50px;
    cursor: pointer;
    width: 100%;
    margin-top: 30px;
    font-weight: bold;
    transition: background 0.3s;
}

.tp-rt-btn-place-order:hover,
.tp-rt-btn-process-payment:hover {
    background: var(--tpum-hover-color);
}

/* Stile base del pulsante Aggiungi al Carrello (per desktop e generale) */
.tp-rt-add-to-cart-btn {
    padding-top: 10px;
    cursor: pointer;
    margin-left: 10px;
    color: var(--tp-rt-primary-color);
    transition: color 0.3s;
}

.tp-rt-add-to-cart-btn:hover {
    color: var(--tpum-hover-color);
}

/* Div contorno al cart icon */
.tp-rest-menu-cart {
    font-weight: bold;
    color: #e74c3c;
    background-color: #f5f5f5;
    padding: 6px 8px 0px 2px;
    border-radius: 20px;
    display: inline-block;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tpum-cart-icon {
    width: 30px;
    height: 30px;
    display: inline-block;
}

#tp-rt-address-display {
    margin: 15px 0 0 25px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* Stile Responsive: Aggiunge margin-top solo su schermi piccoli */
@media (max-width: 768px) {
 .tp-rt-add-to-cart-btn {
        position: absolute;
        top: -7px;
        right: 7px;
        z-index: 10;         
 }
 .tp-rest-menu-cart {
    position: absolute;
    top: 50px;
    right: 0px;
    width: 40px;
    height: 30px;
    padding: 6px 8px 0px 2px;
    border-radius: 15px;
 }
 .tpum-cart-icon {
    width: 25px;
    height: 25px;
    display: inline-block;
 }
 #tp-rt-address-display {
    margin: 5px 0 0 5px;
    padding: 10px;
    border-radius: 5px;
 }
 #preferred_time {
    max-width:90px; 
    border-radius: 15px;
    padding-right: 0px;
    padding-left: 6px;
 }     
}

/*--- Tasti Gestione Carrello ---*/
.tp-rt-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px dashed #eee;
}

.tp-rt-qty-control {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.tp-rt-qty-btn {
    cursor: pointer;
    font-weight: bold;
    color: var(--tp-rt-primary-color);
    border: 1px solid #D2D2D2;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1;
    user-select: none; /* Impedisce la selezione del testo */
}

.tp-rt-qty-minus {
    margin-right: 5px;
}

.tp-rt-qty-plus {
    margin-left: 5px;
}

.tp-rt-qty-value {
    font-weight: bold;
    min-width: 15px; /* Spazio per numeri a due cifre */
    text-align: center;
}

.tp-rt-item-details {
    flex-grow: 1; /* Permette al nome del piatto di occupare lo spazio centrale */
    font-size: 13px;
    white-space: nowrap; /* Impedisce che il nome del piatto vada a capo */
    overflow: hidden;
    text-overflow: ellipsis; /* Aggiunge i puntini se troppo lungo */
}

.tp-rt-remove-item {
    cursor: pointer;
    margin-left: 10px;
    color: #999;
    transition: color 0.3s;
}

.tp-rt-remove-item:hover {
    color: var(--tp-rt-primary-color);
}

/*--- Icona Profilo nel Flottante ---*/
.tp-rt-cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-top: 1px solid #eee;
    background: #fcfcfc;
}

/* Stile per l'icona profilo (l'abbiamo colorata con fill="currentColor" nell'SVG) */
.tp-rt-btn-profile,
.tp-rt-btn-orders,
.tp-rt-btn-logout {
    color: #333;
    text-decoration: none;
    padding-top: 5px;
    line-height: 1;
}

.tp-rt-btn-profile:hover,
.tp-rt-btn-orders:hover,
.tp-rt-btn-logout:hover {
    color: var(--tpum-hover-color); /* Evidenziazione al passaggio del mouse */
}

/* ==========================================================================
   Responsive Styles for My Orders Pages
   ========================================================================== */

/* Allineamento Colonne */
.tp-rt-orders-table .align-right {
    text-align: right;
}

.tp-rt-orders-table .align-center {
    text-align: center;
}

/* Effetto Hover e Cursore sulla Riga Cliccabile */
.tp-rt-orders-table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.tp-rt-orders-table tbody tr:hover {
    background-color: #f5f5f5; /* Grigio molto chiaro per l'hover */
}

/* Righe Alternate (Zebra Striping) */
.tp-rt-orders-table tbody tr:nth-child(even) {
    background-color: #fafafa; /* Grigio chiarissimo per le righe pari */
}

.tp-rt-orders-table tbody tr:nth-child(even):hover {
    background-color: #f0f0f0; /* Leggermente pił scuro dell'hover standard */
}

/* Assicura che il pulsante "Paga" non erediti stili indesiderati */
.tp-rt-actions-cell .tp-rt-pay-button {
    display: inline-block; /* Assicura che il pulsante non si espanda */
}

.status-badge {
    padding: 3px 6px;
    border-radius: 5px;
    /*font-weight: bold;*/
}

/* --- Stili Base per le Tabelle (rimuove stili inline) --- */
.tp-rt-orders-table,
.tp-rt-order-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
}

.tp-rt-orders-table th,
.tp-rt-orders-table td,
.tp-rt-order-items-table th,
.tp-rt-order-items-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.tp-rt-orders-table thead {
    background-color: #f7f7f7;
    border-bottom: 2px solid #eee;
}

.tp-rt-order-items-table thead {
    border-bottom: 2px solid #eee;
}

/* --- Responsive per la Tabella Dettagli Ordine --- */
@media screen and (max-width: 768px) {
    .tp-rt-order-items-table thead {
        display: none; /* Nasconde l'intestazione su mobile */
    }

    .tp-rt-order-items-table,
    .tp-rt-order-items-table tbody,
    .tp-rt-order-items-table tr,
    .tp-rt-order-items-table td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }

    .tp-rt-order-items-table tr {
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
    }
    
    .tp-rt-order-items-table td {
        text-align: right; /* Allinea il valore a destra */
        padding-left: 50%; /* Spazio per l'etichetta */
        position: relative;
        border: none;
        border-bottom: 1px dashed #eee;
    }

    .tp-rt-order-items-table td:before {
        content: attr(data-label); /* Usa l'attributo data-label come etichetta */
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        text-align: left;
        font-weight: bold;
    }
}

/* --- Responsive per l'Elenco Ordini (Tabella vs Card) --- */
.tp-rt-orders-list-container {
    display: none; /* Nasconde le card su desktop */
}

@media screen and (max-width: 768px) {
    .tp-rt-orders-table-container {
        display: none; /* Nasconde la tabella su mobile */
    }

    .tp-rt-orders-list-container {
        display: block; /* Mostra le card su mobile */
    }

    .tp-rt-order-card {
        background: #fff;
        border: 1px solid #ddd;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 15px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .tp-rt-order-card-header {
        text-align: center;
        border-bottom: 1px solid #eee;
        padding-bottom: 10px;
        margin-bottom: 5px;
    }
    
    .tp-rt-order-card-link {
        display: block;
        font-size: 1.1em;
        font-weight: bold;
        color: var(--tp-rt-primary-color);
        text-decoration: none;
        margin-bottom: 5px;
    }    

    .tp-rt-order-card-header .status-badge {
        font-size: 0.8em;
        padding: 4px 10px;
        border-radius: 12px;
    }

    .tp-rt-order-card-header strong {
        font-size: 1.1em;
    }

    .tp-rt-order-card-header a {
        font-weight: bold;
        color: var(--tp-rt-primary-color);
        text-decoration: none;
    }

    /* --- Body della Card --- */
    .tp-rt-order-card-body {
        display: flex;
        justify-content: space-between; /* Spinge la data a sinistra e il totale a destra */
        align-items: center;
        padding: 5px 0;
        font-size: 0.95em;
    }
    
    .tp-rt-order-total {
        font-weight: bold;
        color: #333;
    }
    
    /* --- Footer della Card (stili esistenti, ma li ripuliamo) --- */
    .tp-rt-order-card-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 5px;
        padding-top: 10px;
        border-top: 1px solid #eee;
    }
}

/* --- Stili Aggiuntivi per il Dettaglio Ordine --- */

.tp-rt-order-info-box,
.tp-rt-order-totals {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.tp-rt-order-payment-section {
    text-align: center;
    margin-top: 30px;
}