/**
 * Frontend combos styles.
 *
 * @package RestaurantOrderingSystem
 */

.ros-combos-section {
    margin-bottom: 30px;
    padding: 18px;
    border: 1px solid color-mix(in srgb, var(--ros-muted, #687078) 14%, transparent);
    border-radius: 16px;
    background: var(--ros-surface-soft, #f8f9fa);
}

.ros-combos-title {
    margin: 0 0 18px;
    color: var(--ros-text, #333);
    font-size: clamp(21px, 2.5vw, 28px);
    line-height: 1.2;
    text-align: start;
}

.ros-combos-subtitle {
    display: block;
    margin-top: 4px;
    color: var(--ros-primary, #28a745);
    font-size: 13px;
    font-weight: 650;
}

.ros-combos-grid {
    display: grid;
    grid-template-columns: repeat(var(--ros-combo-columns-desktop, 2), minmax(0, 1fr));
    grid-auto-rows: 1fr;
    align-items: stretch;
    gap: 20px;
}

.ros-combo-card {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
    width: 100%;
    height: 100%;
    min-height: 192px;
    gap: 0 14px;
    align-items: start;
    padding: 14px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--ros-muted, #687078) 22%, transparent);
    border-radius: 14px;
    background: var(--ros-surface, #fff);
    word-break: normal;
    overflow-wrap: break-word;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.ros-combo-card:hover {
    border-color: #c8cdd2;
    background: var(--ros-surface, #fff);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .09);
    transform: translateY(-2px);
}

.ros-combo-image {
    grid-column: 1;
    grid-row: 1 / span 6;
    width: 104px;
    height: 104px;
    align-self: start;
    justify-self: center;
    aspect-ratio: 1;
    margin: 0;
    overflow: hidden;
    border-radius: 12px;
    background: var(--ros-surface-soft, #eef0f2);
}

.ros-combo-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}

.ros-combo-card:hover .ros-combo-image img {
    transform: scale(1.025);
}

.ros-combo-header {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    margin: 0 0 7px;
    padding: 0;
    border: 0;
}

.ros-combo-name {
    min-width: 0;
    flex: 1;
    margin: 0;
    color: var(--ros-text, #333);
    font-size: 16px;
    font-weight: 780;
    line-height: 1.3;
    word-break: normal;
    overflow-wrap: break-word;
}

.ros-combo-price {
    flex: 0 0 auto;
    margin: 0;
    color: var(--ros-price, var(--ros-text, #20252a));
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.ros-combo-price del {
    display: block;
    color: #777;
    font-size: 14px;
    font-weight: 400;
}

.ros-combo-price ins {
    color: var(--ros-danger, #b32d2e);
    text-decoration: none;
}

.ros-combo-description {
    grid-column: 2;
    grid-row: 3;
    min-width: 0;
    margin: 0 0 7px;
    color: var(--ros-muted, #666);
    font-size: 12.5px;
    line-height: 1.45;
    word-break: normal;
    overflow-wrap: break-word;
}

.ros-combo-description > :first-child {
    margin-top: 0;
}

.ros-combo-description > :last-child {
    margin-bottom: 0;
}

.ros-combo-items {
    grid-column: 2;
    grid-row: 4;
    min-width: 0;
    margin: 0 0 10px;
}

.ros-combo-items strong {
    display: block;
    margin-bottom: 4px;
    color: var(--ros-text, #333);
    font-size: 12px;
}

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

.ros-combo-items li {
    padding: 2px 0;
    border: 0;
    color: var(--ros-muted, #555);
    font-size: 12px;
    line-height: 1.4;
    word-break: normal;
    overflow-wrap: break-word;
}

.ros-combo-items li:last-child {
    border-bottom: none;
}

.ros-add-combo-to-cart {
    grid-column: 2;
    grid-row: 5;
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    background: var(--ros-primary, #0073aa);
    color: var(--ros-button-text, #fff);
    border: none;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.ros-add-combo-to-cart:hover {
    background: #20252a;
}

.ros-open-combo-builder:hover,
.ros-open-combo-builder:focus-visible,
.ros-submit-combo-builder:hover,
.ros-submit-combo-builder:focus-visible {
    background: #20252a !important;
}

.ros-combo-unavailable {
    opacity: .72;
}

.ros-combo-unavailable .ros-add-combo-to-cart,
.ros-combo-unavailable .ros-add-combo-to-cart:hover {
    background: #dfe3e6;
    color: #687078;
    cursor: not-allowed;
}

.ros-combo-message { grid-column: 2; grid-row: 6; min-height: 1.5em; margin-top: 6px; font-size: 12px; color: #1f7a3f; }
.ros-combo-message.ros-error { color: #b32d2e; }
.ros-locked-quantity { display: inline-block; min-width: 2em; text-align: center; font-weight: 600; }

.ros-lunch-package-card {
    position: relative;
    border-color: color-mix(in srgb, var(--ros-accent, #e8b95c) 55%, #e0e0e0);
}

.ros-lunch-package-badge {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    display: inline-flex;
    margin: 0 0 8px;
    padding: 5px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ros-accent, #e8b95c) 20%, #fff);
    color: var(--ros-price, var(--ros-primary-dark, #005a87));
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.ros-open-combo-builder,
.ros-submit-combo-builder {
    width: 100%;
    min-height: 44px;
    border: 0 !important;
    border-radius: 8px !important;
    background: var(--ros-primary, #0073aa) !important;
    color: var(--ros-button-text, #fff) !important;
    font-weight: 700 !important;
}

.ros-combo-card > .ros-open-combo-builder {
    grid-column: 2;
    grid-row: 5;
    min-height: 40px;
    padding: 9px 12px;
    font-size: 13px;
}

.ros-combo-modal {
    position: fixed;
    z-index: 100030;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.ros-combo-modal[hidden] {
    display: none !important;
}

.ros-combo-modal-backdrop {
    position: absolute !important;
    z-index: 0 !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: rgba(var(--ros-popup-overlay-rgb, 18, 22, 26), var(--ros-popup-overlay-opacity, .62)) !important;
    box-shadow: none !important;
    opacity: 1 !important;
    transform: none !important;
    backdrop-filter: blur(2px);
}

.ros-combo-dialog {
    --ros-surface: #fff;
    --ros-surface-soft: #f7f8f9;
    position: relative;
    z-index: 1;
    display: flex;
    width: min(720px, 100%);
    max-height: min(860px, calc(100dvh - 40px));
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    background: #fff !important;
    color: var(--ros-text, #20252a);
    box-shadow: 0 28px 90px rgba(0, 0, 0, .38);
}

.ros-combo-dialog > header,
.ros-combo-dialog > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 18px 22px;
    background: #fff !important;
}

.ros-combo-dialog > header {
    border-bottom: 1px solid color-mix(in srgb, var(--ros-muted, #687078) 22%, transparent);
}

.ros-combo-dialog > header span {
    color: var(--ros-primary, #0073aa);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.ros-combo-dialog > header h3 {
    margin: 2px 0;
    font-size: 23px;
}

.ros-combo-modal-close {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--ros-text, #20252a);
    color: var(--ros-button-text, #fff);
    cursor: pointer;
}

.ros-combo-dialog-body {
    overflow-y: auto;
    padding: 20px 22px;
    background: #fff !important;
}

.ros-combo-choice-group {
    margin: 0 0 20px;
    padding: 0;
    border: 0;
}

.ros-combo-choice-group legend {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.ros-combo-choice-group legend small {
    color: var(--ros-muted, #687078);
}

.ros-combo-choice-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.ros-combo-choice {
    display: grid;
    grid-template-columns: 22px 54px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-width: 0;
    padding: 9px;
    border: 1px solid color-mix(in srgb, var(--ros-muted, #687078) 24%, transparent);
    border-radius: 10px;
    cursor: pointer;
}

.ros-combo-choice.is-selected {
    border-color: var(--ros-primary, #0073aa);
    background: color-mix(in srgb, var(--ros-primary, #0073aa) 7%, #fff);
}

.ros-combo-choice.is-unavailable {
    cursor: not-allowed;
    opacity: .55;
}

.ros-combo-choice input {
    accent-color: var(--ros-primary, #0073aa);
}

.ros-combo-choice-image,
.ros-combo-choice-image img {
    display: block;
    width: 54px;
    height: 54px;
    overflow: hidden;
    border-radius: 8px;
    object-fit: cover;
}

.ros-combo-choice > span:last-child {
    display: grid;
    min-width: 0;
}

.ros-combo-choice > span:last-child strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ros-combo-choice-ingredients{display:-webkit-box;overflow:hidden;margin-top:3px;color:var(--ros-muted,#687078);font-size:11px;font-weight:400;line-height:1.35;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal}

.ros-combo-group-feedback,
.ros-combo-builder-message {
    display: block;
    min-height: 18px;
    margin-top: 6px;
    color: #b32d2e;
    font-size: 12px;
}

.ros-combo-dialog > footer {
    border-top: 1px solid color-mix(in srgb, var(--ros-muted, #687078) 22%, transparent);
}

.ros-combo-dialog > footer .ros-submit-combo-builder {
    width: auto;
    min-width: 190px;
}

@media screen and (max-width: 782px) {
    .ros-combos-section {
        padding: 12px;
    }

    .ros-combos-grid {
        grid-template-columns: repeat(var(--ros-combo-columns-mobile, 1), minmax(0, 1fr));
        gap: 12px;
    }

    .ros-combo-card {
        grid-template-columns: 66px minmax(0, 1fr);
        min-height: 158px;
        gap: 0 8px;
        padding: 9px;
    }

    .ros-combo-image {
        width: 58px;
        height: 58px;
        border-radius: 9px;
    }

    .ros-combo-name {
        font-size: 12.5px;
    }

    .ros-combo-price {
        font-size: 10.5px;
    }

    .ros-combo-description,
    .ros-combo-items li,
    .ros-combo-items strong {
        font-size: 10.5px;
        line-height: 1.35;
    }

    .ros-lunch-package-badge {
        padding: 4px 7px;
        font-size: 9px;
    }

    .ros-combo-card > .ros-open-combo-builder,
    .ros-add-combo-to-cart {
        min-height: 34px;
        padding: 7px 8px;
        font-size: 10.5px;
    }

    .ros-combo-modal {
        align-items: end;
        padding: 0;
    }

    .ros-combo-dialog {
        width: 100%;
        max-height: 91dvh;
        border-radius: 18px 18px 0 0;
    }

    .ros-combo-choice-options {
        grid-template-columns: 1fr;
    }

    .ros-combo-dialog > footer {
        align-items: stretch;
        flex-direction: column;
    }

    .ros-combo-dialog > footer .ros-submit-combo-builder {
        width: 100%;
    }
}
