/* ── Quaderno scolastico — righe, margine rosso e fori ── */

:root {
    --nb-row: 32px;
    --nb-margin-w: 44px;
    --nb-blue: #4E64AC;
    --nb-red: #AD3731;
    --nb-paper: #FEFEFE;
    --nb-line: rgba(78, 100, 172, 0.42);
    --nb-hole: radial-gradient(
        circle at 50% 50%,
        #0e0e0e 0px,
        #2a2a2a 3.5px,
        #555 4.5px,
        #999 5px,
        transparent 5.5px
    );
}

/* Foglio interno (menu swipe) */
.notebook-sheet {
    display: flex;
    min-height: 100%;
    background: var(--nb-paper);
}

/* Colonna sinistra: margine rosso + fori infiniti */
.notebook-margin {
    flex-shrink: 0;
    width: var(--nb-margin-w);
    border-right: 2px solid var(--nb-red);
    background-color: var(--nb-paper);
    background-image: var(--nb-hole);
    background-size: 100% calc(var(--nb-row) * 4);
    background-position: center calc(var(--nb-row) * 2);
    background-repeat: repeat-y;
}

/* Area rigata — il testo segue la griglia */
.notebook-body {
    flex: 1;
    min-width: 0;
    padding: calc(var(--nb-row) * 0.25) 20px calc(var(--nb-row) * 2) 14px;
    line-height: var(--nb-row);
    background-color: var(--nb-paper);
    background-image: repeating-linear-gradient(
        to bottom,
        var(--nb-paper) 0,
        var(--nb-paper) calc(var(--nb-row) - 1px),
        var(--nb-line) calc(var(--nb-row) - 1px),
        var(--nb-line) var(--nb-row)
    );
    background-size: 100% var(--nb-row);
}

/* Card quaderno (table-menu) */
.notebook-page {
    display: flex;
    background: var(--nb-paper);
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    margin-bottom: 20px;
}

.notebook-page > .notebook-margin {
    border-right: 2px solid var(--nb-red);
}

.notebook-page > .notebook-body {
    padding: calc(var(--nb-row) * 0.5) 18px calc(var(--nb-row) * 1.5) 12px;
}

/* Titoli di sezione — occupano righe intere */
.notebook-body .section-title {
    color: var(--nb-red);
    font-size: clamp(22px, 5.5vw, 30px);
    margin: 0 0 var(--nb-row) 0;
    text-align: center;
    font-weight: normal;
    line-height: var(--nb-row);
    min-height: calc(var(--nb-row) * 2);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1px;
    border-bottom: 2px solid var(--nb-blue);
}

/* Voci menù allineate alle righe */
.notebook-body .item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    padding: 0;
    margin: 0;
    border-bottom: none;
    min-height: var(--nb-row);
}

.notebook-body .item + .item {
    margin-top: 0;
}

.notebook-body .item-left {
    flex: 1;
    min-width: 0;
    line-height: var(--nb-row);
}

.notebook-body .item-left h3 {
    margin: 0;
    padding: 0;
    font-size: clamp(17px, 4.2vw, 21px);
    color: var(--nb-blue);
    font-weight: normal;
    line-height: var(--nb-row);
    min-height: var(--nb-row);
}

.notebook-body .item-left p {
    margin: 0;
    padding: 0;
    font-size: clamp(13px, 3.2vw, 15px);
    color: #555;
    text-transform: none;
    line-height: var(--nb-row);
    min-height: var(--nb-row);
}

.notebook-body .allergen-codes {
    font-size: clamp(11px, 2.8vw, 13px);
    color: var(--nb-red);
    margin-left: 4px;
    letter-spacing: 0.5px;
    line-height: var(--nb-row);
}

.notebook-body .item-right {
    flex-shrink: 0;
    line-height: var(--nb-row);
}

.notebook-body .price {
    font-size: clamp(17px, 4.2vw, 21px);
    font-weight: bold;
    color: var(--nb-red);
    white-space: nowrap;
    line-height: var(--nb-row);
    margin: 0;
}

/* Allergeni */
.notebook-body .allergen-item {
    margin: 0 0 var(--nb-row) 0;
    padding: 0;
    line-height: var(--nb-row);
    font-size: clamp(13px, 3.2vw, 15px);
    text-transform: none;
}

.notebook-body .allergen-item strong {
    color: var(--nb-red);
    display: block;
    line-height: var(--nb-row);
}

.notebook-body .menu-footer {
    text-align: center;
    margin-top: calc(var(--nb-row) * 2);
    line-height: var(--nb-row);
    color: #333;
}

/* Table-menu: card items */
.notebook-body .item-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 12px 0;
    margin: 0;
    min-height: unset;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.12);
}

.notebook-body .item-card:last-child {
    border-bottom: none;
}

.notebook-body .item-row-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.notebook-body .item-row-head h3 {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: clamp(17px, 4vw, 20px);
    color: var(--nb-blue);
    line-height: 1.35;
    min-height: unset;
    font-weight: normal;
}

.notebook-body .item-desc {
    margin: 4px 0 0 0;
    padding: 0;
    font-size: clamp(13px, 3vw, 14px);
    color: #666;
    text-transform: none;
    line-height: 1.4;
    min-height: unset;
}

.notebook-body .item-allergens {
    font-size: 12px;
    color: var(--nb-red);
    margin-left: 4px;
}

.notebook-body .item-row-head .item-price {
    flex-shrink: 0;
    font-size: clamp(16px, 4vw, 19px);
    font-weight: bold;
    color: var(--nb-red);
    line-height: 1.35;
    white-space: nowrap;
    min-height: unset;
    padding-top: 1px;
}

.notebook-body .item-row-action {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 10px;
    min-height: 40px;
}

.notebook-body .item-details h3 {
    margin: 0;
    font-size: clamp(17px, 4vw, 20px);
    color: var(--nb-blue);
    line-height: 1.35;
    min-height: unset;
}

.notebook-body .item-details p {
    margin: 0;
    font-size: clamp(13px, 3vw, 14px);
    color: #666;
    text-transform: none;
    line-height: 1.4;
    min-height: unset;
}

.notebook-body .item-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 90px;
    line-height: var(--nb-row);
}

.notebook-body .item-price {
    font-size: clamp(16px, 4vw, 19px);
    font-weight: bold;
    color: var(--nb-red);
    line-height: 1.35;
    min-height: unset;
}

/* Copertine scelta menù */
.notebook-cover {
    flex: 1;
    display: flex;
    background: var(--nb-paper);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: #222;
    position: relative;
    min-height: 180px;
}

.notebook-cover .notebook-margin {
    border-right: 2px solid var(--nb-red);
    background-size: 100% calc(var(--nb-row) * 3);
    background-position: center calc(var(--nb-row) * 1.5);
}

.notebook-cover .notebook-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px 24px;
    background-image: repeating-linear-gradient(
        to bottom,
        var(--nb-paper) 0,
        var(--nb-paper) calc(var(--nb-row) - 1px),
        rgba(78, 100, 172, 0.18) calc(var(--nb-row) - 1px),
        rgba(78, 100, 172, 0.18) var(--nb-row)
    );
}

.notebook-cover.food { border-left: 6px solid var(--nb-red); }
.notebook-cover.drink { border-left: 6px solid var(--nb-blue); }

.notebook-cover h2 {
    font-size: clamp(32px, 8vw, 46px);
    margin: 0 0 6px 0;
    letter-spacing: 2px;
    line-height: calc(var(--nb-row) * 1.5);
}

.notebook-cover p {
    margin: 0;
    font-size: 16px;
    color: #666;
    text-transform: none;
    line-height: var(--nb-row);
}

.notebook-cover .badge {
    position: absolute;
    right: 14px;
    top: 14px;
    background: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    font-size: 12px;
    z-index: 1;
}

@media (max-width: 768px) {
    :root {
        --nb-margin-w: 36px;
    }
}

@media (max-width: 600px) {
    .notebook-cover {
        min-height: 140px;
    }
    .notebook-cover .notebook-body {
        padding: 20px 16px;
    }
}
