/* ==================== ELABONTA CASSA RAPIDA ==================== */

* { box-sizing: border-box; }

/* FORZA FULLSCREEN: nasconde tutto il chrome del tema */
body.page-cassa-rapida {
    background: #1a1d23 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    height: 100vh !important;
    width: 100vw !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

body.page-cassa-rapida #page,
body.page-cassa-rapida #content,
body.page-cassa-rapida .site-content,
body.page-cassa-rapida .ast-container,
body.page-cassa-rapida #primary,
body.page-cassa-rapida main,
body.page-cassa-rapida article,
body.page-cassa-rapida .single-page-article,
body.page-cassa-rapida .entry-content {
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

body.page-cassa-rapida .entry-header,
body.page-cassa-rapida .entry-title,
body.page-cassa-rapida .ast-archive-description,
body.page-cassa-rapida .post-thumb-img-content,
body.page-cassa-rapida .ast-single-post-order,
body.page-cassa-rapida .post-navigation,
body.page-cassa-rapida .nav-links,
body.page-cassa-rapida .comments-area {
    display: none !important;
}

#cassa-rapida-app {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: #e8eaed;
    z-index: 99999;
    background: #1a1d23;
}

/* HEADER */
.cr-header {
    height: 60px;
    background: #2c3036;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 2px solid #3d4148;
    flex-shrink: 0;
}
.cr-header h1 {
    margin: 0;
    font-size: 22px;
    color: #fff;
}
.cr-status {
    padding: 8px 16px;
    background: #1e8e3e;
    color: #fff;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}
.cr-status.error { background: #c5221f; }
.cr-status.busy { background: #f9ab00; color: #000; }

/* MAIN: 3 colonne */
.cr-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    padding: 16px;
    overflow: hidden;
    min-height: 0;
}

/* === COLONNA SINISTRA === */
.cr-left { display: flex; flex-direction: column; gap: 12px; min-height: 0; }

.cr-display {
    background: #0f1115;
    border: 2px solid #3d4148;
    border-radius: 12px;
    padding: 20px;
    text-align: right;
    flex-shrink: 0;
}
.cr-display-label {
    font-size: 14px;
    color: #9aa0a6;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.cr-display-value {
    font-size: 56px;
    font-weight: 700;
    color: #8ab4f8;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.cr-dept-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex-shrink: 0; }
.cr-dept-btn {
    height: 60px;
    background: #34373d;
    color: #fff;
    border: 2px solid #4a4d52;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s;
}
.cr-dept-btn:active { transform: scale(0.97); background: #1e8e3e; }

.cr-cart {
    flex: 1;
    background: #0f1115;
    border: 2px solid #3d4148;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.cr-cart-header {
    padding: 12px 16px;
    border-bottom: 1px solid #3d4148;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}
.cr-cart-header button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #fff;
}
#cr-cart-list {
    flex: 1;
    margin: 0;
    padding: 8px;
    list-style: none;
    overflow-y: auto;
}
#cr-cart-list li {
    background: #1a1d23;
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}
#cr-cart-list li .cr-item-rm {
    background: #c5221f;
    color: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
}
.cr-cart-total {
    padding: 16px;
    border-top: 2px solid #3d4148;
    display: flex;
    justify-content: space-between;
    font-size: 24px;
    font-weight: 700;
    color: #fbbc04;
}

/* === COLONNA CENTRO: tastierino === */
.cr-center { display: flex; flex-direction: column; gap: 10px; min-height: 0; }

.cr-keypad {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    min-height: 0;
}
.cr-key {
    background: #34373d;
    color: #fff;
    border: 2px solid #4a4d52;
    border-radius: 12px;
    font-size: 32px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.05s;
    min-height: 0;
}
.cr-key:active { transform: scale(0.95); background: #5f6368; }
.cr-key-clear { background: #5f6368; color: #fff; }

.cr-pay-btn {
    height: 70px;
    border: none;
    border-radius: 12px;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.1s;
    flex-shrink: 0;
}
.cr-pay-btn:active { transform: scale(0.98); }
.cr-pay-cash { background: #1e8e3e; }
.cr-pay-cash:active { background: #137030; }
.cr-pay-card { background: #1a73e8; }
.cr-pay-card:active { background: #1557b0; }

/* === COLONNA DESTRA: funzioni === */
.cr-right {
    background: #0f1115;
    border: 2px solid #3d4148;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    min-height: 0;
}
.cr-right h3 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #9aa0a6;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.cr-right hr {
    border: none;
    border-top: 1px solid #3d4148;
    margin: 4px 0;
}
.cr-fn-btn {
    background: #34373d;
    color: #fff;
    border: 2px solid #4a4d52;
    border-radius: 10px;
    padding: 14px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: all 0.1s;
    flex-shrink: 0;
}
.cr-fn-btn small {
    font-size: 12px;
    color: #9aa0a6;
    font-weight: normal;
}
.cr-fn-btn:active { transform: scale(0.98); }
.cr-fn-x { border-color: #1a73e8; }
.cr-fn-x:active { background: #1a73e8; }
.cr-fn-z { border-color: #f9ab00; }
.cr-fn-z:active { background: #f9ab00; color: #000; }
.cr-fn-refund { border-color: #f9ab00; }
.cr-fn-refund:active { background: #f9ab00; color: #000; }
.cr-fn-void { border-color: #c5221f; }
.cr-fn-void:active { background: #c5221f; }

/* === MODAL === */
.cr-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}
.cr-modal-content {
    background: #2c3036;
    padding: 32px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
}
.cr-modal-content h2 { margin: 0 0 16px 0; }
.cr-modal-content label {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    color: #9aa0a6;
}
.cr-modal-content input {
    width: 100%;
    padding: 12px;
    margin-top: 4px;
    background: #0f1115;
    border: 2px solid #3d4148;
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
}
.cr-modal-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}
.cr-modal-actions button {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    background: #5f6368;
    color: #fff;
}
.cr-modal-actions .cr-danger { background: #c5221f; }
