/* ==========================================================================
   PIZZA CUSTOM ADDONS - MODERN FOOD ORDERING MODAL (SIMONE'S STYLE)
   Brand Color: #35c800
   ========================================================================== */

/* Modal Overlay with Smooth Backdrop */
.pca-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    animation: pcaFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body.pca-modal-open {
    overflow: hidden !important;
}

@keyframes pcaFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pcaSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal Container (2-Column Desktop Card) */
.pca-modal {
    background: #ffffff;
    width: 100%;
    max-width: 940px;
    height: auto;
    max-height: 88vh;
    border-radius: 24px;
    display: flex;
    flex-direction: row;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35), 0 10px 25px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    position: relative;
    overflow: hidden;
    animation: pcaSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Floating Sleek Close Button */
.pca-modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 20;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e293b;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.pca-modal-close:hover {
    background: #ffffff;
    color: #e11d48;
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.pca-modal-close svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* Left Column: Food Image */
.pca-modal-img-col {
    flex: 0 0 42%;
    min-width: 320px;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pca-modal-img-col img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.pca-modal:hover .pca-modal-img-col img {
    transform: scale(1.02);
}

/* Right Column: Content, Dietary Info, Options & Footer */
.pca-modal-content-col {
    flex: 1 1 58%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: #ffffff;
}

/* Modal Header */
.pca-modal-header {
    padding: 24px 28px 16px 28px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.pca-modal-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.pca-modal-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    letter-spacing: -0.01em;
    flex: 1;
}

.pca-modal-base-price {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
}

.pca-modal-desc {
    margin: 8px 0 0 0;
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.5;
}

/* Dietary & Nutritional Information Card */
.pca-dietary-card {
    margin-top: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 16px;
}

.pca-dietary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.pca-dietary-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.pca-dietary-cal-badge {
    font-size: 12px;
    font-weight: 700;
    color: #ea580c;
    background: #fff7ed;
    border: 1px solid #ffedd5;
    padding: 2px 9px;
    border-radius: 12px;
}

.pca-dietary-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pca-dietary-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    line-height: 1.4;
}

.pca-dietary-label {
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    padding-top: 2px;
}

.pca-pills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.pca-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 14px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.3;
}

.pca-pill-flavor {
    background: #eefbe8;
    color: #228b00;
    border: 1px solid #d4f5c6;
}

.pca-pill-allergen {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* Scrollable Modal Body */
.pca-modal-body {
    padding: 16px 28px;
    overflow-y: auto;
    flex-grow: 1;
    min-height: 0;
}

.pca-modal-body::-webkit-scrollbar {
    width: 6px;
}

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

/* Option Groups */
.pca-modal-group {
    padding: 18px 0;
    border-bottom: 1px solid #f1f5f9;
}

.pca-modal-group:last-child {
    border-bottom: none;
}

.pca-group-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

.pca-group-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.pca-req-badge {
    font-size: 12px;
    font-weight: 700;
}

.pca-req-badge.required {
    color: #e63946;
}

.pca-req-badge.optional {
    color: #94a3b8;
    font-weight: 600;
}

.pca-group-sub {
    font-size: 12.5px;
    color: #64748b;
    margin-bottom: 12px;
}

/* Options List & Card Wrappers */
.pca-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pca-modal-option-wrapper {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s ease;
    overflow: hidden;
}

.pca-modal-option-wrapper:hover {
    border-color: #cbd5e1;
    background: #fafafa;
}

/* Active State when selected (Green Accent #35c800) */
.pca-modal-option-wrapper.pca-option-active {
    border-color: #35c800;
    background: rgba(53, 200, 0, 0.04);
    box-shadow: 0 0 0 1px #35c800;
}

.pca-modal-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    user-select: none;
    margin: 0;
}

/* Hide native browser radio/checkbox */
.pca-modal-option input[type="radio"],
.pca-modal-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

/* Custom Radio / Checkbox Indicator */
.pca-control-indicator {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: #ffffff;
    box-sizing: border-box;
}

.pca-control-radio {
    border-radius: 50%;
}

.pca-control-checkbox {
    border-radius: 5px;
}

/* Checked State on Indicator */
.pca-option-active .pca-control-radio {
    border-color: #35c800;
}

.pca-option-active .pca-control-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    background: #35c800;
    border-radius: 50%;
    display: block;
}

.pca-option-active .pca-control-checkbox {
    border-color: #35c800;
    background: #35c800;
}

.pca-option-active .pca-control-checkbox::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    display: block;
    margin-bottom: 2px;
}

.pca-opt-label-text {
    font-size: 14.5px;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}

.pca-right-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.pca-opt-cal {
    font-size: 12px;
    font-weight: 600;
    color: #ea580c;
    background: #fff7ed;
    padding: 2px 7px;
    border-radius: 6px;
}

.pca-price-right {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

/* Suboptions Toggle (Half / Left / Right / Whole) */
.pca-suboptions-toggle {
    display: none;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 10px 16px;
    gap: 10px;
    align-items: center;
}

.pca-suboption-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    transition: all 0.2s ease;
}

.pca-suboption-label input {
    margin: 0;
    accent-color: #35c800;
}

.pca-suboption-label:hover {
    border-color: #35c800;
    color: #0f172a;
}

/* Half Icons */
.pca-half-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid #64748b;
    position: relative;
    overflow: hidden;
}

.pca-half-icon.left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: #35c800;
}

.pca-half-icon.right::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: #35c800;
}

.pca-half-icon.whole {
    background: #35c800;
    border-color: #35c800;
}

/* Validation Alert Banner */
.pca-validation-alert {
    background: #fff1f0;
    color: #cf1322;
    border: 1px solid #ffccc7;
    border-radius: 10px;
    padding: 10px 16px;
    margin: 0 28px 12px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: pcaFadeIn 0.2s ease;
}

.pca-alert-icon {
    font-size: 15px;
}

/* Allergen Warning Alert Banner */
.pca-allergen-alert {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 10px 16px;
    margin: 0 28px 8px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: pcaFadeIn 0.2s ease;
}

.pca-allergen-icon {
    font-size: 15px;
}

/* Sticky Modal Footer */
.pca-modal-footer {
    padding: 16px 28px;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.pca-footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Quantity Stepper (Dark Rounded Stepper) */
.pca-qty-stepper {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    gap: 2px;
}

.pca-qty-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: #334155;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.pca-qty-btn:hover {
    background: #0f172a;
    transform: scale(1.05);
}

.pca-qty-btn:active {
    transform: scale(0.95);
}

.pca-qty-input {
    width: 32px;
    height: 34px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    padding: 0;
    pointer-events: none;
}

.pca-modal-total-cal-display {
    font-size: 13px;
    font-weight: 700;
    color: #ea580c;
    background: #fff7ed;
    border: 1px solid #ffedd5;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Main Action Button - User Brand Color #35c800 */
.pca-add-to-order-btn {
    background: #35c800 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 14px 28px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 4px 14px rgba(53, 200, 0, 0.35) !important;
    flex: 1;
    max-width: 280px;
    text-decoration: none !important;
    line-height: 1 !important;
}

.pca-add-to-order-btn:hover:not(.pca-btn-disabled) {
    background: #2ea800 !important;
    box-shadow: 0 6px 18px rgba(53, 200, 0, 0.45) !important;
    transform: translateY(-1px);
}

.pca-add-to-order-btn:active:not(.pca-btn-disabled) {
    transform: translateY(0);
}

.pca-btn-separator {
    opacity: 0.7;
    font-size: 14px;
}

/* Disabled State */
.pca-add-to-order-btn.pca-btn-disabled {
    background: #cbd5e1 !important;
    color: #94a3b8 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    transform: none !important;
    opacity: 0.8 !important;
}

/* ==========================================================================
   DIRECT MODE (Single Product Page Integration)
   ========================================================================== */
#pca-direct-wrapper {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.pca-direct-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    gap: 16px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Mobile & Tablet)
   ========================================================================== */
@media (max-width: 768px) {
    .pca-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .pca-modal {
        flex-direction: column;
        max-height: 92vh;
        border-radius: 24px 24px 0 0;
        animation: pcaSlideUpMobile 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes pcaSlideUpMobile {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .pca-modal-img-col {
        flex: 0 0 200px;
        min-height: 200px;
        max-height: 220px;
        min-width: 100%;
    }

    .pca-modal-header {
        padding: 18px 20px 14px 20px;
    }

    .pca-modal-title {
        font-size: 19px;
    }

    .pca-modal-base-price {
        font-size: 18px;
    }

    .pca-modal-body {
        padding: 12px 20px;
    }

    .pca-validation-alert {
        margin: 0 20px 12px;
    }

    .pca-allergen-alert {
        margin: 0 20px 8px;
    }

    .pca-modal-footer {
        padding: 14px 20px;
        flex-direction: column;
        gap: 12px;
    }

    .pca-footer-left {
        width: 100%;
        justify-content: space-between;
    }

    .pca-add-to-order-btn {
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px 20px !important;
    }
}