/* Base Material Container Structure - Side-by-side Top Aligned */
.egc-material-wrapper {
    display: flex;
    gap: 24px;
    width: 100%;
    align-items: flex-start !important;
    margin-bottom: 40px;
}

/* Two-Column Layout */
.egc-material-wrapper.has-sub-cards .egc-sub-cards-container {
    flex: 1 1 65%;
    border: 1px solid #e0e0e0;
    padding: 24px;
    border-radius: 6px;
    background: #ffffff;
    min-height: 380px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.egc-material-wrapper.has-sub-cards .egc-main-cards-container {
    flex: 0 0 320px;
}

/* Section Titles */
.egc-material-wrapper .egc-step-title {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

.egc-sub-cards-content .egc-placeholder-text {
    font-size: 14px;
    color: #666666;
    margin-top: 20px;
    font-style: italic;
    line-height: 1.5;
}

/* FULL-WIDTH LAYOUT (When no Sub-Brands exist) */
.egc-material-wrapper.no-sub-cards,
.egc-material-wrapper.full-width-layout {
    display: block;
    width: 100%;
}

.egc-material-wrapper.no-sub-cards .egc-sub-cards-container,
.egc-material-wrapper.full-width-layout .egc-sub-cards-container {
    display: none !important;
}

.egc-material-wrapper.no-sub-cards .egc-main-cards-container,
.egc-material-wrapper.full-width-layout .egc-main-cards-container {
    width: 100% !important;
    max-width: 800px;
    margin: 0 auto;
}

/* Material Card Styling (Right Sidebar) */
.egc-material-card {
    position: relative;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    padding: 24px 16px 18px 16px;
    margin-top: 14px;
    margin-bottom: 16px;
    background: #ffffff;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    overflow: visible !important;
    transition: all 0.25s ease;
}

.egc-material-card:hover,
.egc-material-card.is-active,
.egc-material-card.is-selected {
    border-color: #800080;
    box-shadow: 0 4px 12px rgba(128, 0, 128, 0.12);
}

/* Badge Positioning */
.egc-material-card .egc-card-badge {
    position: absolute;
    top: -12px;
    right: 14px;
    background: #fca311;
    color: #000000;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
}

.egc-material-card-content {
    flex: 1 1 auto;
    min-width: 0;
}

/* Compact Button */
.egc-material-card .egc-select-btn {
    height: auto !important;
    min-height: 38px !important;
    max-height: 42px !important;
    padding: 8px 18px !important;
    align-self: center !important;
    margin: auto 0 !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    background: #1a1a1a;
    color: #ffffff;
    border: none;
    cursor: pointer;
}

.egc-material-card .egc-select-btn:hover {
    background: #333333;
}

/* Price Breakdown Summary Styling */
.egc-main-cards-container .egc-step-price-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid #eeeeee;
    text-align: right;
}

.egc-main-cards-container .egc-step-price-summary .egc-summary-row {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    font-size: 13px;
    color: #444444;
    margin-bottom: 4px;
}

.egc-main-cards-container .egc-step-price-summary .egc-summary-value {
    font-weight: 700;
    color: #111111;
}

.egc-main-cards-container .egc-step-price-summary .egc-grand-total {
    font-weight: 700;
    font-size: 15px;
    color: #000000;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #dddddd;
}

/* CENTER SUB CARD ITEM BOX - 3 COLUMN FLEX LAYOUT */
.egc-sub-card-item {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    padding: 24px 20px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #ffffff;
    gap: 20px;
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
    position: relative;
}

.egc-sub-card-item:hover,
.egc-sub-card-item.is-selected {
    border-color: #800080;
    box-shadow: 0 4px 14px rgba(128, 0, 128, 0.12);
    transform: translateY(-1px);
}

/* Left Column: Image + Title */
.egc-sub-card-col-left {
    flex: 0 0 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-right: 15px;
    border-right: 1px solid #f0f0f0;
}

.egc-sub-card-image {
    max-width: 120px;
    margin-bottom: 10px;
}

.egc-sub-card-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.egc-sub-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #111111;
    margin: 0;
    line-height: 1.3;
}

/* Middle Column: Text Content & Price */
.egc-sub-card-col-middle {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 13px;
    color: #444444;
    line-height: 1.5;
}

.egc-sub-card-col-middle p {
    margin: 0 0 8px 0;
}

.egc-sub-card-col-middle ul {
    margin: 6px 0;
    padding-left: 18px;
}

.egc-sub-card-col-middle li {
    margin-bottom: 3px;
}

.egc-sub-card-price {
    font-size: 16px;
    font-weight: 700;
    color: #111111;
    margin-top: 8px;
}

/* Right Column: Badge Tag + Select Button */
.egc-sub-card-col-right {
    flex: 0 0 130px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
}

.egc-sub-card-badge-tag {
    background: #f4f4f4;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #222222;
    text-align: center;
    white-space: nowrap;
}

.egc-sub-card-col-right .egc-select-btn {
    background: #000000;
    color: #ffffff;
    border: none;
    padding: 8px 22px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    margin-top: auto;
}

.egc-sub-card-col-right .egc-select-btn:hover {
    background: #333333;
}

/* ACCORDION SECTION */
.egc-material-notes-wrap {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eaeaea;
}

.lenses-note-item {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    margin-bottom: 12px;
    background: #ffffff;
    overflow: hidden;
}

.lenses-note-title {
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #333333;
    cursor: pointer !important;
    pointer-events: auto !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
    user-select: none;
}

.lenses-note-title * {
    pointer-events: none;
}

.lenses-note-item .collapse {
    display: none;
    padding: 16px 18px;
    font-size: 14px;
    color: #555;
    border-top: 1px solid #f0f0f0;
    background: #ffffff;
}

/* ==========================================================================
   MOBILE RESPONSIVE STYLES (Step 3 Material)
   ========================================================================== */
@media (max-width: 768px) {
    .egc-material-wrapper {
        flex-direction: column !important;
        gap: 16px !important;
    }

    .egc-material-wrapper.has-sub-cards .egc-sub-cards-container,
    .egc-material-wrapper.has-sub-cards .egc-main-cards-container {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    /* Sub Card Item Responsive Stack */
    .egc-sub-card-item {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 16px !important;
        gap: 14px !important;
    }

    .egc-sub-card-col-left {
        flex: 1 1 auto !important;
        padding-right: 0 !important;
        border-right: none !important;
        border-bottom: 1px solid #f0f0f0 !important;
        padding-bottom: 12px !important;
        width: 100% !important;
    }

    .egc-sub-card-col-right {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        padding-top: 10px !important;
        border-top: 1px solid #f0f0f0 !important;
    }

    .egc-main-cards-container .egc-step-price-summary {
        align-items: center !important;
        text-align: center !important;
    }

    .egc-main-cards-container .egc-step-price-summary .egc-summary-row {
        justify-content: space-between !important;
        width: 100% !important;
        max-width: 280px !important;
    }
}