/* Pizza Builder Styles */
:root {
    --modal-padding-vertical: 20px;
    --modal-padding-horizontal: 40px;
}

.pizza-builder-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 20px;
}

.pizza-builder-content {
    background-color: #fff;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.pizza-builder-header {
    background: linear-gradient(135deg, rgb(41, 98, 66), rgba(69, 98, 74, 0.9));
    color: white;
    padding: var(--modal-padding-vertical) var(--modal-padding-horizontal);
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.pizza-builder-header h2 {
    margin: 0;
    font-size: 2rem;
    font-family: 'Playfair Display', serif;
}

.pizza-builder-header p {
    margin: 10px 0 0;
    opacity: 0.9;
}

.pizza-builder-close {
    position: absolute;
    top: calc(var(--modal-padding-vertical) - 5px);
    right: calc(var(--modal-padding-horizontal) - 5px);
    color: white;
    font-size: 28px;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 1;
}

.pizza-builder-body {
    padding: var(--modal-padding-horizontal);
}

.pizza-builder-section {
    margin-bottom: 30px;
    padding: 0 10px;
}

.pizza-builder-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-family: 'Playfair Display', serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pizza-builder-section h3 i {
    color: #45624a;
}

.pizza-ingredients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.pizza-ingredient-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fff;
    position: relative;
}

.pizza-ingredient-card:hover {
    border-color: #45624a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(69, 98, 74, 0.15);
}

.pizza-ingredient-card.selected {
    border-color: #45624a;
    background-color: rgba(69, 98, 74, 0.1);
}

.pizza-ingredient-card input[type="radio"],
.pizza-ingredient-card input[type="checkbox"] {
    position: absolute;
    top: 10px;
    right: 10px;
    transform: scale(1.2);
}

.pizza-ingredient-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

.pizza-ingredient-price {
    color: #45624a;
    font-weight: bold;
    font-size: 1.1rem;
}

.pizza-builder-footer {
    background-color: #f8f9fa;
    padding: var(--modal-padding-vertical) var(--modal-padding-horizontal);
    border-radius: 0 0 12px 12px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    bottom: 0;
}

.pizza-total-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.pizza-builder-actions {
    display: flex;
    gap: 15px;
}

.pizza-builder-actions .btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-family: var(--body-font);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.pizza-builder-actions .btn-primary {
    background-color: #45624a;
    color: white;
}

.pizza-builder-actions .btn-primary:hover {
    background-color: #6e8b74;
}

.pizza-builder-actions .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.pizza-builder-actions .btn-secondary:hover {
    background-color: #5a6268;
}

.pizza-builder-modal .btn,
.pizza-builder-modal .btn-primary,
.pizza-builder-modal .btn-secondary {
    font-family: var(--body-font);
}

/* RTL Support */
html[dir="rtl"] .pizza-builder-close {
    right: auto;
    left: calc(var(--modal-padding-horizontal) - 5px);
}

html[dir="rtl"] .pizza-ingredient-card input[type="radio"],
html[dir="rtl"] .pizza-ingredient-card input[type="checkbox"] {
    right: auto;
    left: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pizza-builder-content {
        margin: 10px;
        max-height: 95vh;
    }

    .pizza-ingredients-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .pizza-builder-footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .pizza-builder-actions {
        width: 100%;
        justify-content: center;
    }

    .pizza-builder-actions .btn {
        flex: 1;
        min-width: 120px;
    }
}

/* Pizza preview section */
.pizza-preview {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pizza-preview-icon {
    font-size: 3rem;
    color: #45624a;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    max-height: 60px;
    opacity: 1;
    overflow: hidden;
}

.pizza-preview.scrolled .pizza-preview-icon {
    max-height: 0;
    margin-bottom: 0;
    opacity: 0;
}

.pizza-preview-text {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.pizza-preview-ingredients {
    color: #2c3e50;
    font-weight: bold;
    min-height: 20px;
}

/* Animation for card selection */
@keyframes selectCard {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.pizza-ingredient-card.selected {
    animation: selectCard 0.3s ease;
}