/**
 * Crave Smash - Additional CSS
 * Cart, Toast, and Extra Components
 */

/* ========================================
   Cart Button in Header
   ======================================== */
.cart-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #FFFFFF;
    cursor: pointer;
    transition: all 0.3s ease;
}

.site-header.scrolled .cart-button {
    background-color: #FFD700;
    color: #0A0A0A;
}

.cart-button:hover {
    background-color: #FFD700;
    color: #0A0A0A;
    transform: scale(1.05);
}

.site-header.scrolled .cart-button:hover {
    background-color: #E31837;
    color: #FFFFFF;
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background-color: #E31837;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (min-width: 768px) {
    .mobile-nav-buttons {
        display: none;
    }
    .mobile-cart {
        display: none;
    }
}

/* ========================================
   Cart Drawer
   ======================================== */
.cart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-overlay.open {
    display: block;
    opacity: 1;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background-color: #FFFFFF;
    z-index: 1101;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-drawer.open {
    transform: translateX(0);
}

/* Su mobile usa l'altezza dinamica del viewport (esclude la barra del browser) */
@media (max-width: 767px) {
    .cart-drawer {
        height: 100dvh;
    }
}

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    background-color: #0A0A0A;
    color: #FFFFFF;
}

.cart-drawer-header h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Anton', sans-serif;
    font-size: 24px;
    text-transform: uppercase;
}

.cart-drawer-header h3 svg {
    color: #FFD700;
}

.cart-close {
    background: transparent;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
}

.cart-close:hover {
    color: #FFD700;
}

/* Empty State */
.cart-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-align: center;
    color: #999999;
}

.cart-empty svg {
    margin-bottom: 16px;
    color: #CCCCCC;
}

.cart-empty h4 {
    font-family: 'Anton', sans-serif;
    font-size: 20px;
    text-transform: uppercase;
    color: #666666;
    margin-bottom: 8px;
}

/* Cart Content */
.cart-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    padding: 16px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background-color: #F5F5F5;
    border-radius: 12px;
    margin-bottom: 12px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    font-weight: 700;
    color: #0A0A0A;
    margin-bottom: 4px;
}

.cart-item-price {
    color: #E31837;
    font-weight: 600;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background-color: #E0E0E0;
    color: #0A0A0A;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.qty-btn:hover {
    background-color: #CCCCCC;
}

.qty-btn-add {
    background-color: #FFD700;
}

.qty-btn-add:hover {
    background-color: #E31837;
    color: #FFFFFF;
}

.qty-value {
    width: 32px;
    text-align: center;
    font-weight: 700;
}

.cart-item-remove {
    background: transparent;
    border: none;
    color: #999999;
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
}

.cart-item-remove:hover {
    color: #E31837;
}

/* Cart Footer */
.cart-footer {
    padding: 24px;
    background-color: #F5F5F5;
    border-top: 1px solid #E0E0E0;
}

.cart-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.cart-total-row span:first-child {
    font-family: 'Anton', sans-serif;
    font-size: 20px;
    text-transform: uppercase;
}

.cart-total-amount {
    font-family: 'Anton', sans-serif;
    font-size: 24px;
    color: #E31837;
}

.cart-clear-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    background: transparent;
    border: none;
    color: #666666;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.cart-clear-btn:hover {
    color: #E31837;
}

/* Cart Form */
.cart-form {
    flex: 1;
    min-height: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.cart-form-fields {
    flex: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #0A0A0A;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #FFD700;
}

.cart-form-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: #FFFFFF;
    border-radius: 8px;
    margin-bottom: 16px;
}

.cart-form-total span:first-child {
    font-family: 'Anton', sans-serif;
    font-size: 18px;
    text-transform: uppercase;
}

#cart-form-total-amount {
    font-family: 'Anton', sans-serif;
    font-size: 20px;
    color: #E31837;
}

.cart-back-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    background: transparent;
    border: none;
    color: #666666;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.cart-back-btn:hover {
    color: #0A0A0A;
}

/* ========================================
   Add to Cart Button
   ======================================== */
.menu-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.add-to-cart-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: #FFD700;
    color: #0A0A0A;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
    background-color: #E31837;
    color: #FFFFFF;
    transform: scale(1.1);
}

.add-to-cart-btn:active {
    transform: scale(0.95);
}

/* ========================================
   Toast Notification
   ======================================== */
.toast-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background-color: #0A0A0A;
    color: #FFFFFF;
    padding: 16px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1200;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-btn {
    background-color: #FFD700;
    color: #0A0A0A;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.toast-btn:hover {
    background-color: #FFFFFF;
}

/* ========================================
   Menu Item with Actions
   ======================================== */
.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background-color: #fafafa;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
    border-radius: 8px;
}

.menu-item-info {
    flex: 1;
    min-width: 0;
}

.menu-item-name {
    font-weight: 700;
    font-size: 18px;
    color: #0A0A0A;
    transition: color 0.3s ease;
}

.menu-item:hover .menu-item-name {
    color: #E31837;
}

.menu-item-description {
    color: #666666;
    font-size: 14px;
    margin-top: 4px;
}

.menu-item-price {
    font-family: 'Anton', sans-serif;
    font-size: 20px;
    color: #E31837;
    white-space: nowrap;
}

/* ========================================
   Cart item customization notes
   ======================================== */
.cart-item-notes {
    margin: 4px 0 6px;
    font-size: 13px;
    line-height: 1.4;
    color: #777777;
}

/* ========================================
   Burger Configurator (McDonald's style)
   ======================================== */
.menu-section-hint {
    color: #666666;
    font-size: 14px;
    margin-bottom: 16px;
}

.menu-item--configurable .menu-item-price {
    font-size: 16px;
    color: #666666;
}

.configure-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background-color: #E31837;
    color: #FFFFFF;
    border: none;
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.configure-btn:hover {
    background-color: #0A0A0A;
    transform: translateY(-1px);
}

@media (max-width: 639px) {
    .configure-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Overlay + dialog */
.burger-config-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1200;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.burger-config-overlay.open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.bc-dialog {
    background-color: #FFFFFF;
    width: 100%;
    max-width: 520px;
    margin: auto;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.bc-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background-color: #0A0A0A;
    color: #FFFFFF;
    flex-shrink: 0;
}

.bc-title {
    font-family: 'Anton', sans-serif;
    font-size: 26px;
    text-transform: uppercase;
    line-height: 1;
}

.bc-close {
    background: transparent;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 4px;
    transition: color 0.25s ease;
}

.bc-close:hover {
    color: #FFD700;
}

.bc-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.bc-step {
    margin-bottom: 24px;
}

.bc-step:last-child {
    margin-bottom: 0;
}

.bc-step-title {
    font-family: 'Anton', sans-serif;
    font-size: 17px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #0A0A0A;
    margin-bottom: 10px;
}

.bc-hint {
    font-size: 13px;
    color: #888888;
    margin: -4px 0 10px;
}

/* Radio "card" options */
.bc-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bc-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 2px solid #ECECEC;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.bc-option:hover {
    border-color: #E31837;
}

.bc-option input {
    accent-color: #E31837;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.bc-option-label {
    flex: 1;
    font-weight: 600;
    color: #1A1A1A;
    display: flex;
    flex-direction: column;
}

.bc-option-label small {
    font-weight: 400;
    font-size: 12px;
    color: #888888;
}

.bc-option-price {
    font-family: 'Anton', sans-serif;
    font-size: 18px;
    color: #E31837;
}

.bc-option:has(input:checked) {
    border-color: #E31837;
    background-color: #FFF5F6;
}

/* Checkbox rows (ingredients / extra) */
.bc-checks {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bc-check {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #ECECEC;
    border-radius: 10px;
    cursor: pointer;
}

.bc-check input {
    accent-color: #E31837;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.bc-check-label {
    flex: 1;
    color: #1A1A1A;
    text-transform: capitalize;
}

/* Unchecked ingredient = will be removed */
.bc-check:has(input[name="bc-ing"]:not(:checked)) .bc-check-label {
    text-decoration: line-through;
    color: #BBBBBB;
}

.bc-add-price {
    font-weight: 700;
    color: #E31837;
    font-size: 14px;
}

.bc-footer {
    padding: 18px 24px;
    border-top: 1px solid #EEEEEE;
    background-color: #FAFAFA;
    flex-shrink: 0;
}

.bc-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-family: 'Anton', sans-serif;
    font-size: 18px;
    text-transform: uppercase;
}

.bc-total {
    font-size: 26px;
    color: #E31837;
}

.bc-confirm {
    width: 100%;
}
