/**
 * Maestro Combo Builder Styles
 */

/* Ensure all elements use border-box sizing */
.maestro-combo-builder *,
.maestro-combo-builder *::before,
.maestro-combo-builder *::after {
    box-sizing: border-box;
}

.maestro-combo-builder {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Header */
.combo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 3px solid #c41e3a;
    max-width: 100%;
    flex-wrap: wrap;
}

.combo-title {
    margin: 0;
    font-size: 28px;
    color: #333;
}

.combo-price {
    font-size: 32px;
    font-weight: bold;
    color: #c41e3a;
}

/* Includes list */
.combo-includes {
    background: #f9f9f9;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    max-width: 100%;
}

.combo-includes h4 {
    margin: 0 0 10px;
    font-size: 14px;
    text-transform: uppercase;
    color: #666;
}

.combo-includes ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.combo-includes li {
    padding: 5px 0;
    font-size: 16px;
    color: #333;
}

.combo-includes li::before {
    content: "✓";
    color: #c41e3a;
    font-weight: bold;
    margin-right: 10px;
}

.combo-includes li em {
    color: #666;
    font-style: italic;
}

/* Form */
.combo-form {
    max-width: 100%;
    overflow: hidden;
}

/* Sections */
.combo-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #eee;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}

.combo-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 15px;
    font-size: 18px;
    color: #333;
}

.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #c41e3a;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

.section-note {
    margin: 0 0 15px;
    font-size: 14px;
    color: #666;
}

.topping-counter,
.pop-counter {
    font-size: 14px;
    color: #666;
    font-weight: normal;
}

/* Toppings Grid - Container for Regular and Premium columns */
.toppings-grid {
    display: block;
}

@media (min-width: 768px) {
    .toppings-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }
}

.toppings-column {
    max-width: 100%;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .toppings-column {
        margin-bottom: 0;
    }
}

.toppings-column h4 {
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
    font-size: 14px;
    text-transform: uppercase;
    color: #555;
}

.toppings-premium h4 {
    border-bottom-color: #d4af37;
}

/* Override pizza-builder grid for combo toppings - use single column */
.combo-toppings-section .maestro-topping-list {
    display: block;
}

.combo-toppings-section .maestro-topping-item {
    margin-bottom: 8px;
}

.combo-toppings-section .maestro-topping-item label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f8f8f8;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.combo-toppings-section .maestro-topping-item label:hover {
    border-color: #c41e3a;
    background: #fff5f5;
}

.combo-toppings-section .maestro-topping-item:has(input:checked) label {
    border-color: #c41e3a;
    background: #fff5f5;
}

.combo-toppings-section .maestro-topping-item.premium label {
    border-color: #d4af37;
    background: #fffef5;
}

.combo-toppings-section .maestro-topping-item.premium:has(input:checked) label {
    border-color: #d4af37;
    background: #fff8e1;
}

.combo-toppings-section .maestro-topping-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    accent-color: #c41e3a;
    cursor: pointer;
    flex-shrink: 0;
}

.premium-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #d4af37;
    color: #fff;
    font-size: 10px;
    border-radius: 10px;
    text-transform: none;
    margin-left: auto;
}

/* Legacy topping-item styles removed - now using .maestro-topping-item */

/* Side Choice (Wings or Garlic Bread) */
.side-choice-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.side-choice-option {
    flex: 1;
    max-width: min(200px, 45%);
    cursor: pointer;
}

.side-choice-option input {
    display: none;
}

.side-choice-box {
    display: block;
    padding: 20px;
    text-align: center;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s;
}

.side-choice-option input:checked + .side-choice-box {
    border-color: #c41e3a;
    background: #fff5f5;
}

.side-choice-title {
    display: block;
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

.side-or {
    font-weight: bold;
    color: #999;
    font-size: 14px;
}

/* Wing Flavor Wrapper */
.wing-flavor-wrapper {
    margin-top: 15px;
}

.wing-flavor-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.wing-flavor-select,
.pop-flavor-select {
    width: 100%;
    max-width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s;
}

.wing-flavor-select:focus,
.pop-flavor-select:focus {
    outline: none;
    border-color: #c41e3a;
}

.wing-flavor-wrapper.hidden {
    display: none;
}

/* Pop Selection */
.pop-selection-wrapper {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 100%;
}

.pop-select-item {
    flex: 1;
    min-width: min(200px, 100%);
}

.pop-select-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

/* Grid Layout */
.combo-builder-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 100%;
    overflow: hidden;
}

@media (min-width: 900px) {
    .combo-builder-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.combo-builder-left {
    /* Contains the form sections */
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.combo-builder-right {
    /* Contains the summary panel */
    max-width: 100%;
    box-sizing: border-box;
}

/* Summary Panel */
.combo-summary-panel {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
    position: sticky;
    top: 20px;
    max-width: 100%;
}

@media (max-width: 899px) {
    .combo-summary-panel {
        position: static;
    }
}

.combo-summary-panel h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
    border-bottom: 2px solid #c41e3a;
    padding-bottom: 10px;
}

.summary-section {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.summary-section:last-of-type {
    border-bottom: none;
}

.summary-section h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #555;
    text-transform: uppercase;
}

.summary-section .no-selection {
    color: #999;
    font-style: italic;
    font-size: 13px;
    margin: 0;
}

.summary-section .selected-toppings-list {
    margin: 0;
    padding: 0 0 0 18px;
    list-style: disc;
}

.summary-section .selected-toppings-list li {
    font-size: 13px;
    color: #333;
    padding: 2px 0;
}

.summary-section .premium-tag {
    color: #d4af37;
    font-weight: 600;
    font-size: 11px;
}

.summary-section .toppings-count-summary {
    font-size: 12px;
    color: #666;
    margin: 8px 0 0 0;
    padding: 6px 8px;
    background: #f0f0f0;
    border-radius: 4px;
}

.summary-section .selected-wings,
.summary-section .selected-pop {
    font-size: 14px;
    color: #333;
    margin: 0;
    font-weight: 500;
}

/* Summary Total */
.summary-total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #c41e3a;
}

.summary-total .total-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.summary-total .grand-total {
    font-size: 18px;
    color: #c41e3a;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #ddd;
}

.summary-total .extra-toppings-cost {
    color: #c41e3a;
}

/* Topping Counter Display */
.topping-counter-display {
    background: #fff3e0;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Add to Cart Section - OLD (removed from template but keeping for backwards compatibility) */
.combo-add-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #fff;
    border: 2px solid #c41e3a;
}

.combo-total {
    display: flex;
    align-items: center;
    gap: 10px;
}

.total-label {
    font-size: 18px;
    color: #333;
}

.total-price {
    font-size: 28px;
    font-weight: bold;
    color: #c41e3a;
}

.combo-add-to-cart,
.combo-add-to-cart.button,
.combo-add-to-cart.button.alt,
button.combo-add-to-cart {
    display: block !important;
    width: 100% !important;
    padding: 15px 30px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    background: #c41e3a !important;
    background-color: #c41e3a !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: background 0.3s !important;
    text-align: center !important;
}

.combo-add-to-cart:hover,
.combo-add-to-cart.button:hover,
.combo-add-to-cart.button.alt:hover,
button.combo-add-to-cart:hover {
    background: #a01830 !important;
    background-color: #a01830 !important;
    color: #fff !important;
}

.combo-add-to-cart:disabled,
.combo-add-to-cart.button:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
}

.combo-status {
    width: 100%;
    text-align: center;
    padding: 10px;
    font-size: 14px;
}

.combo-status.success {
    color: #28a745;
}

.combo-status.error {
    color: #dc3545;
}

/* Responsive */
@media (max-width: 768px) {
    .maestro-combo-builder {
        padding: 15px;
    }

    .combo-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .combo-title {
        font-size: 20px;
    }

    .combo-price {
        font-size: 24px;
    }

    .combo-section {
        padding: 15px;
    }

    .toppings-grid {
        grid-template-columns: 1fr;
    }

    .side-choice-wrapper {
        flex-direction: column;
    }

    .side-choice-option {
        max-width: none;
        width: 100%;
    }

    .pop-selection-wrapper {
        flex-direction: column;
    }

    .pop-select-item {
        min-width: auto;
        width: 100%;
    }

    .combo-add-section {
        flex-direction: column;
        text-align: center;
    }

    .combo-add-to-cart {
        width: 100%;
    }
}

/* Error state */
.maestro-error {
    padding: 20px;
    background: #ffebee;
    color: #c41e3a;
    border-radius: 8px;
    text-align: center;
}

/* Crust Selection Styles */
.combo-crust-section .crust-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.combo-crust-section .crust-option {
    flex: 1;
    min-width: 140px;
    cursor: pointer;
}

.combo-crust-section .crust-option input[type="radio"] {
    display: none;
}

.combo-crust-section .crust-choice-box {
    display: block;
    padding: 20px;
    text-align: center;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s;
}

.combo-crust-section .crust-option input:checked + .crust-choice-box {
    border-color: #c41e3a;
    background: #fff5f5;
}

.combo-crust-section .crust-choice-title {
    display: block;
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

/* Crust Summary */
#crust-summary .selected-crust {
    font-size: 14px;
    color: #333;
    margin: 0;
    font-weight: 500;
}

@media (max-width: 768px) {
    .combo-crust-section .crust-options {
        flex-direction: column;
    }

    .combo-crust-section .crust-option {
        min-width: auto;
        width: 100%;
    }
}
