/*
 * Cabinets wizard — scoped styles
 *
 * Inherits visual language from:
 *   - modular-home-app.typography.css (global title standardization)
 *   - modular-home-app.carousel.css (global carousel arrows)
 *   - modular-home-app.step-countertops.css (backsplash card pattern)
 *
 * This file adds Cabinets-specific overrides and the Island Upgrade decision UI.
 */

/* =========================================================
   Root
   ========================================================= */

#sha-cabinets-selector {
    padding: 0 0 28px;
}

/* =========================================================
   Panel switching
   ========================================================= */

.sha-cabinets-panel {
    display: none;
}

.sha-cabinets-panel:not([hidden]) {
    display: block;
}

/* =========================================================
   Panel 1: Cabinet Finish
   ========================================================= */

#sha-cabinets-panel-finish .sha-floors-selector__hero {
    padding: 0 18px 12px;
    margin: 4px 0 0;
}

#sha-cabinets-panel-finish .sha-floors-selector__title {
    margin: 4px 0 8px;
}

.sha-cabinets-subtitle {
    max-width: 520px;
    margin: 0 auto 8px;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.55;
    text-align: center;
}

/* Browser wrapper (mirrors countertops) */
#sha-embla-cabinets-finish-container {
    position: relative;
    padding: 18px 18px 0;
}

#sha-embla-cabinets-finish {
    position: relative;
}

#sha-embla-cabinets-finish-viewport {
    overflow: hidden;
    min-height: 0;
}

#sha-embla-cabinets-finish .sha-embla__slide {
    position: relative;
    flex: 0 0 49%;
    min-width: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0 14px;
}

@media (max-width: 768px) {
    #sha-embla-cabinets-finish .sha-embla__slide {
        flex-basis: 56%;
        padding: 0 10px;
    }

    #sha-embla-cabinets-finish-container {
        padding: 16px 0 0;
    }
}

/* =========================================================
   Panel 2: Island Upgrade Decision
   ========================================================= */

#sha-cabinets-panel-island-choice {
    padding: 0 18px;
}

#sha-cabinets-panel-island-choice .sha-hero-copy {
    max-width: 520px;
    margin: 0 auto 18px;
    text-align: center;
}

#sha-cabinets-panel-island-choice .sha-hero-title {
    margin: 8px 0 10px;
}

#sha-cabinets-panel-island-choice .sha-cabinets-subtitle {
    max-width: 480px;
    margin: 0 auto 14px;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.55;
    text-align: center;
}

/* Island choice cards - using backsplash card pattern */
.sha-island-choice-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 760px !important;
    margin: 0 auto !important;
    padding: 0 0 14px !important;
}

.sha-island-choice-card {
    position: relative;
    display: grid;
    grid-template-columns: 46% minmax(0, 1fr);
    gap: 9px;
    align-items: stretch;
    width: 100%;
    min-height: 118px;
    padding: 7px;
    border-radius: 18px;
    border: 1.5px solid rgba(82, 108, 67, 0.22);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 247, 241, 0.96) 100%);
    box-shadow: 0 12px 28px rgba(28, 25, 23, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.78);
    cursor: pointer;
    text-align: left;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.sha-island-choice-card:hover {
    border-color: rgba(82, 108, 67, 0.38);
    box-shadow: 0 16px 34px rgba(28, 25, 23, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.sha-island-choice-card:active {
    transform: scale(0.985);
}

.sha-island-choice-card:focus-visible {
    outline: 2px solid rgba(47, 109, 57, 0.42);
    outline-offset: 2px;
}

.sha-island-choice-card.is-selected {
    border-color: rgba(47, 109, 57, 0.9);
    background: linear-gradient(180deg, rgba(247, 251, 245, 0.98) 0%, rgba(255, 255, 255, 0.96) 100%);
    box-shadow: 0 16px 34px rgba(47, 109, 57, 0.14), 0 0 0 2px rgba(47, 109, 57, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.sha-island-choice-card__visual {
    position: relative;
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    width: 100%;
    min-height: 104px;
    height: 104px;
    border-radius: 16px;
    overflow: hidden;
    background: #f5f2ed;
    border: 1px solid rgba(82, 108, 67, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 6px 14px rgba(28, 25, 23, 0.05);
}

.sha-island-choice-card__image {
    display: block;
    width: 100%;
    height: 104px;
    min-height: 104px;
    object-fit: cover;
    object-position: center;
}

.sha-island-choice-card__image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 104px;
    height: 104px;
    padding: 16px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.8), transparent 46%), linear-gradient(180deg, #f7f3eb 0%, #ebe5dc 100%);
}

.sha-island-choice-card__content {
    position: relative;
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    padding: 6px 4px 6px 0;
}

.sha-island-choice-card__title {
    display: block;
    color: #18181b;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin: 0;
}

.sha-island-choice-card__desc {
    display: -webkit-box;
    color: #5f625b;
    font-size: 12px;
    line-height: 1.28;
    margin: 0;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sha-island-choice-card__check {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 40;
    width: 24px;
    height: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #ffffff;
    background: #2f6d39;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(47, 109, 57, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.sha-island-choice-card__check::before {
    content: "✓";
}

.sha-island-choice-card.is-selected .sha-island-choice-card__check {
    display: flex;
}

/* Continue button */
.sha-island-choice-continue-wrap {
    width: 100%;
    max-width: 760px;
    margin: 2px auto 14px;
    padding: 0;
}

@media (min-width: 768px) {
    .sha-island-choice-list {
        max-width: 820px !important;
        gap: 16px !important;
        padding-bottom: 24px !important;
    }

    .sha-island-choice-card {
        grid-template-columns: 44% minmax(0, 1fr);
        min-height: 140px;
        padding: 10px;
    }

    .sha-island-choice-card__visual,
    .sha-island-choice-card__image,
    .sha-island-choice-card__image-placeholder {
        min-height: 120px;
        height: 120px;
    }

    .sha-island-choice-card__title {
        font-size: 20px;
    }

    .sha-island-choice-card__desc {
        font-size: 14px;
    }
}

@media (max-width: 520px) {
    #sha-cabinets-panel-island-choice .sha-cabinets-subtitle {
        font-size: 14px;
    }

    .sha-island-choice-list {
        gap: 10px !important;
        padding: 0 0 14px !important;
    }

    .sha-island-choice-card {
        grid-template-columns: 45% minmax(0, 1fr);
        min-height: 118px;
        gap: 10px;
        padding: 7px;
        border-radius: 18px;
    }

    .sha-island-choice-card__visual,
    .sha-island-choice-card__image,
    .sha-island-choice-card__image-placeholder {
        min-height: 104px;
        height: 104px;
        border-radius: 14px;
    }

    .sha-island-choice-card__content {
        padding: 4px 2px 4px 0;
    }
}

@media (max-width: 390px) {
    .sha-island-choice-card {
        grid-template-columns: 44% minmax(0, 1fr);
        gap: 8px;
        padding: 6px;
    }

    .sha-island-choice-card__title {
        font-size: 16px;
    }

    .sha-island-choice-card__desc {
        font-size: 11px;
        line-height: 1.34;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sha-island-choice-card {
        transition: none;
    }
}

/* =========================================================
   Panel 3: Island Products Carousel
   ========================================================= */

#sha-cabinets-panel-island-products .sha-floors-selector__hero {
    padding: 0 18px 12px;
    margin: 4px 0 0;
}

#sha-cabinets-panel-island-products .sha-floors-selector__title {
    margin: 4px 0 8px;
}

#sha-cabinets-panel-island-products .sha-cabinets-subtitle {
    max-width: 520px;
    margin: 0 auto 8px;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.55;
    text-align: center;
}

#sha-embla-cabinets-island-container {
    position: relative;
    padding: 18px 18px 0;
}

#sha-embla-cabinets-island {
    position: relative;
}

#sha-embla-cabinets-island-viewport {
    overflow: hidden;
    min-height: 0;
}

#sha-embla-cabinets-island .sha-embla__slide {
    position: relative;
    flex: 0 0 49%;
    min-width: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0 14px;
}

@media (max-width: 768px) {
    #sha-embla-cabinets-island .sha-embla__slide {
        flex-basis: 56%;
        padding: 0 10px;
    }

    #sha-embla-cabinets-island-container {
        padding: 16px 0 0;
    }
}

/* =========================================================
   Panel 4: Hardware Carousel
   ========================================================= */

#sha-cabinets-panel-hardware .sha-floors-selector__hero {
    padding: 0 18px 12px;
    margin: 4px 0 0;
}

#sha-cabinets-panel-hardware .sha-floors-selector__title {
    margin: 4px 0 8px;
}

#sha-cabinets-panel-hardware .sha-cabinets-subtitle {
    max-width: 520px;
    margin: 0 auto 8px;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.55;
    text-align: center;
}

#sha-embla-cabinets-hardware-container {
    position: relative;
    padding: 18px 18px 0;
}

#sha-embla-cabinets-hardware {
    position: relative;
}

#sha-embla-cabinets-hardware-viewport {
    overflow: hidden;
    min-height: 0;
}

#sha-embla-cabinets-hardware .sha-embla__slide {
    position: relative;
    flex: 0 0 49%;
    min-width: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0 14px;
}

@media (max-width: 768px) {
    #sha-embla-cabinets-hardware .sha-embla__slide {
        flex-basis: 56%;
        padding: 0 10px;
    }

    #sha-embla-cabinets-hardware-container {
        padding: 16px 0 0;
    }
}
