/* ========================================
   Extras Modal - Improved UX/UI
   ======================================== */

.extras-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.extras-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.extras-modal {
    background: #fff;
    border-radius: 24px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.extras-modal-overlay.active .extras-modal {
    transform: scale(1) translateY(0);
}

/* Header */
.extras-modal-header {
    padding: 24px 24px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.extras-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px;
}

.extras-modal-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.extras-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.extras-modal-close:hover {
    background: #e5e5e5;
    color: #333;
}

/* Body */
.extras-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    background: #fafafa;
}

/* Info Banner */
.extras-info-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 12px;
    margin-bottom: 20px;
}

.extras-info-icon {
    width: 36px;
    height: 36px;
    background: #f59e0b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

.extras-info-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.extras-info-content strong {
    font-size: 14px;
    color: #92400e;
}

.extras-info-content span {
    font-size: 13px;
    color: #a16207;
}

/* Categories */
.extras-categories {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.extras-category {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.extras-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.extras-category-header:hover {
    background: #f9f9f9;
}

.extras-category-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.extras-category-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.extras-category-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.extras-category-count {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #22c55e;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 11px;
}

.extras-category-toggle {
    color: #999;
    font-size: 12px;
    transition: transform 0.2s;
}

.extras-category.collapsed .extras-category-toggle {
    transform: rotate(-90deg);
}

.extras-category-items {
    display: flex;
    flex-direction: column;
    padding: 0 8px 8px;
    gap: 4px;
}

.extras-category.collapsed .extras-category-items {
    display: none;
}

/* Ingredient Item */
.extras-ingredient-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    border: 2px solid transparent;
}

.extras-ingredient-item:hover {
    background: #f5f5f5;
}

.extras-ingredient-item.selected {
    background: #f0fdf4;
    border-color: #22c55e;
}

.extras-ingredient-item input[type="checkbox"] {
    display: none;
}

.extras-ingredient-check {
    width: 24px;
    height: 24px;
    border: 2px solid #ddd;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 12px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.extras-ingredient-item.selected .extras-ingredient-check {
    background: var(--accent, #22c55e);
    border-color: var(--accent, #22c55e);
    color: #fff;
}

.extras-ingredient-name {
    flex: 1;
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.extras-ingredient-price {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    padding: 4px 10px;
    background: #f5f5f5;
    border-radius: 6px;
}

.extras-ingredient-item.selected .extras-ingredient-price {
    background: #dcfce7;
    color: #16a34a;
}

/* Notes Section */
.extras-notes-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.extras-notes-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.extras-notes-label i {
    color: #999;
}

.extras-notes-textarea {
    width: 100%;
    min-height: 80px;
    padding: 14px;
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 14px;
    color: #333;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
    background: #fff;
}

.extras-notes-textarea:focus {
    outline: none;
    border-color: #22c55e;
}

.extras-notes-textarea::placeholder {
    color: #aaa;
}

/* Footer */
.extras-modal-footer {
    padding: 20px 24px 24px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
    border-radius: 0 0 24px 24px;
}

.extras-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 12px;
}

.extras-summary-label {
    font-size: 13px;
    color: #888;
    margin: 0 0 2px;
}

.extras-summary-count {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.extras-summary-price {
    text-align: right;
}

.extras-summary-extra {
    font-size: 13px;
    color: #22c55e;
    margin: 0 0 2px;
    font-weight: 600;
}

.extras-summary-total {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

/* Action Buttons */
.extras-modal-actions {
    display: flex;
    gap: 12px;
}

.extras-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.extras-btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.extras-btn-cancel:hover {
    background: #eee;
}

.extras-btn-confirm {
    background: #22c55e;
    color: #fff;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.extras-btn-confirm:hover {
    background: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

/* Empty State */
.extras-empty-state {
    text-align: center;
    padding: 48px 20px;
    background: #fff;
    border-radius: 16px;
}

.extras-empty-icon {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.extras-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px;
}

.extras-empty-text {
    font-size: 14px;
    color: #888;
    margin: 0;
}

/* Scrollbar */
.extras-modal-body::-webkit-scrollbar {
    width: 6px;
}

.extras-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.extras-modal-body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.extras-modal-body::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Responsive */
@media (max-width: 600px) {
    .extras-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .extras-modal {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 24px 24px 0 0;
    }

    .extras-modal-header {
        padding: 20px 20px 16px;
    }

    .extras-modal-title {
        font-size: 20px;
    }

    .extras-modal-body {
        padding: 16px 20px;
    }

    .extras-modal-footer {
        padding: 16px 20px 20px;
    }

    .extras-ingredient-item {
        padding: 10px 12px;
    }

    .extras-ingredient-name {
        font-size: 14px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .extras-modal-overlay,
    .extras-modal,
    .extras-ingredient-item,
    .extras-btn {
        transition: none !important;
    }
}

/* Default Ingredients Section */
.extras-default-ingredients {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 16px;
}

.extras-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.extras-section-title i {
    color: #FDB913;
}

.extras-default-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.extras-default-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.extras-default-item.removed {
    background: #fee2e2;
    border-color: #fca5a5;
    text-decoration: line-through;
    opacity: 0.7;
}

.extras-default-name {
    font-size: 13px;
    color: #333;
}

.extras-remove-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 11px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.extras-remove-btn:hover {
    background: #dc3545;
    color: #fff;
}

.extras-default-item.removed .extras-remove-btn {
    color: #22c55e;
}

.extras-default-item.removed .extras-remove-btn:hover {
    background: #22c55e;
    color: #fff;
}

/* Simple Ingredients List (non-pizza) */
.extras-simple-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 0;
}

.extras-simple-list .extras-ingredient-item {
    margin: 0;
}
