﻿
/* Set padding to keep content from hitting the edges */
.body-content {
    padding-left: 15px;
    padding-right: 15px;
}

/* Override the default bootstrap behavior where horizontal description lists 
   will truncate terms that are too long to fit in the left column 
*/
.dl-horizontal dt {
    white-space: normal;
}

/* Set width on the form input elements since they're 100% wide by default */
input,
select,
textarea {
    max-width: 280px;
}



/* FA LNDC Customs */

/* La ricerca conserva la posizione originale senza carrello; :has segue anche lo swap HTMX. */
.navbar .search-form {
    position: absolute;
    right: 75px;
}

.navbar:has(.lndc-basket-link) .search-form {
    right: 125px;
}

/* Indicatore carrello: slot separato fra ricerca e hamburger, senza spostare il toggle. */
.navbar .lndc-basket-header {
    position: absolute;
    right: 75px;
    width: 40px;
    height: 40px;
    z-index: 101;
}

/* Lo slot resta nel DOM per HTMX, ma senza link non copre la ricerca. */
.navbar .lndc-basket-header:not(:has(.lndc-basket-link)) {
    display: none;
}

.navbar .lndc-basket-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--lndc-grigio-light);
    font-size: 22px;
}

.navbar .lndc-basket-badge {
    position: absolute;
    top: -3px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border-radius: 10px;
    background: var(--lndc-arancione);
    color: #fff;
    font: 700 11px/20px Arial, sans-serif;
    text-align: center;
}

/* Azioni del carrello: secondaria prima della prosecuzione, senza sommare i margini dei pulsanti. */
.checkout-donation-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.checkout-donation-actions .lndc-btn,
.checkout-donation-actions .lndc-btn-inverse {
    margin: 0;
    text-align: center;
}

@media (max-width: 767.98px) {
    .checkout-donation-actions {
        flex-direction: column;
    }
}

/* Il margine del bottone non deve sommarsi alla larghezza della colonna su mobile. */
@media (max-width: 767.98px) {
    #confirmationScope button[type="submit"].lndc-btn {
        margin-left: 0;
        margin-right: 0;
    }
}

/* Il riepilogo checkout deve contenere anche email e indirizzi senza spazi. */
@media (max-width: 575.98px) {
    #basketScope .checkout-basket-table,
    #confirmationScope .checkout-confirm-table {
        width: 100%;
        table-layout: fixed;
    }

    #basketScope .checkout-basket-table th,
    #basketScope .checkout-basket-table td,
    #confirmationScope .checkout-confirm-table th,
    #confirmationScope .checkout-confirm-table td {
        padding: 0.25rem 0.125rem;
    }

    #basketScope .checkout-basket-table th,
    #confirmationScope .checkout-confirm-table th {
        white-space: normal;
        word-break: normal;
        overflow-wrap: normal;
        hyphens: none;
        font-size: 0.875rem;
        text-align: center;
    }

    #basketScope .checkout-basket-table td:nth-child(4),
    #confirmationScope .checkout-confirm-table td:last-child,
    #confirmationScope .checkout-amount {
        white-space: nowrap;
    }

    #basketScope .checkout-line-detail,
    #confirmationScope .checkout-line-detail {
        overflow-wrap: anywhere;
    }

    #basketScope .checkout-unit-price {
        display: none;
    }

    #basketScope .checkout-basket-table th:first-child { width: 38%; }
    #basketScope .checkout-basket-table th:nth-child(2) { width: 27%; }
    #basketScope .checkout-basket-table th:nth-child(4) { width: 23%; }
    #basketScope .checkout-basket-table th:nth-child(5) { width: 12%; }

    #basketScope .checkout-basket-table form .mx-2 { margin-left: 0.125rem !important; margin-right: 0.125rem !important; }
    #basketScope .checkout-basket-table form .px-2 { padding-left: 0.25rem !important; padding-right: 0.25rem !important; }
    #basketScope .checkout-basket-table td:last-child .btn { padding: 0.25rem; }
    #basketScope .checkout-basket-table td:first-child .btn {
        max-width: 100%;
        padding-left: 0.125rem;
        padding-right: 0.125rem;
        white-space: nowrap;
    }

    #confirmationScope .checkout-confirm-table th:first-child { width: 51%; }
    #confirmationScope .checkout-confirm-table th:nth-child(2) { width: 19%; }
    #confirmationScope .checkout-confirm-table th:nth-child(3) { width: 30%; }
}
