/**
 * Countertop Calculator Styles
 * Sage & Cream editorial theme — Version 2.0.0
 */

/* ── Piece Cards (Step 1 dimension entry) ────────────────────── */
.countertop-piece-card {
    background: var(--ct-surface);
    border: 1.5px solid var(--ct-primary);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 14px;
    transition: box-shadow 0.2s;
}

.countertop-piece-card:hover {
    box-shadow: 0 4px 14px rgba(88, 129, 87, 0.12);
}

.countertop-piece-card.editing {
    border-color: var(--ct-primary-dark);
    box-shadow: 0 4px 14px rgba(88, 129, 87, 0.18);
}

.countertop-piece-card h4 {
    margin: 0 0 10px;
    font-size: 15px;
    color: var(--ct-primary);
    font-weight: 700;
}

.countertop-piece-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: var(--ct-muted);
}

.countertop-piece-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Piece Management Buttons ─────────────────────────────────── */
#btn-add-piece {
    background: var(--ct-primary-tint) !important;
    border: 1.5px dashed var(--ct-primary) !important;
    color: var(--ct-primary) !important;
    border-radius: 10px;
    transition: background 0.2s, transform 0.15s;
}

#btn-add-piece:hover {
    background: #deeddc !important;
    transform: translateY(-1px);
    border-style: solid !important;
}

#btn-remove-piece:hover {
    background: #fef2f2 !important;
    transform: translateY(-1px);
}

/* ── Material Style Grid (Step 3) ────────────────────────────── */
#style-options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    max-height: 520px;
    overflow-y: auto;
    padding: 4px 2px 10px;
    margin-bottom: 20px;
}

#style-options-container::-webkit-scrollbar {
    width: 6px;
}

#style-options-container::-webkit-scrollbar-track {
    background: var(--ct-surface-alt);
    border-radius: 4px;
}

#style-options-container::-webkit-scrollbar-thumb {
    background: var(--ct-primary-light);
    border-radius: 4px;
}

/* ── Material Option Cards ────────────────────────────────────── */
.material-option-card {
    display: block;
    background: var(--ct-surface);
    border: 1.5px solid var(--ct-border);
    border-radius: 14px;
    padding: 0;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    overflow: hidden;
    position: relative;
}

.material-option-card:hover {
    border-color: var(--ct-primary-light);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(88, 129, 87, 0.18);
}

.material-option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Selected state */
.material-option-card:has(input:checked) {
    border-color: var(--ct-primary) !important;
    box-shadow: 0 6px 20px rgba(88, 129, 87, 0.22) !important;
}

/* Green checkmark badge on selected card */
.material-option-card input[type="radio"]:checked + .material-content::before {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    background: var(--ct-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    z-index: 10;
    line-height: 26px;
    text-align: center;
}

.material-content {
    display: flex;
    flex-direction: column;
    position: relative;
}

.material-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    transition: transform 0.35s;
}

.material-option-card:hover .material-image {
    transform: scale(1.04);
}

.material-info {
    padding: 12px 14px 14px;
}

.material-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--ct-text);
    margin: 0 0 5px;
    line-height: 1.3;
}

.material-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--ct-gold);
    margin: 0;
}

.material-price-label {
    font-size: 11px;
    color: var(--ct-muted);
    font-weight: 400;
    display: block;
    margin-top: 2px;
}

.material-zoom-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(28, 25, 23, 0.6);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    z-index: 5;
    letter-spacing: 0.02em;
}

.material-zoom-btn:hover {
    background: rgba(28, 25, 23, 0.85);
    transform: scale(1.05);
}

/* ── Material Zoom Modal ──────────────────────────────────────── */
.material-zoom-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28, 25, 23, 0.88);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.material-zoom-modal.active {
    display: flex;
}

.material-zoom-content {
    background: var(--ct-surface);
    border-radius: 18px;
    max-width: 780px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: zoomIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes zoomIn {
    from { transform: scale(0.86); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.material-zoom-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.material-zoom-close:hover {
    background: var(--ct-surface-alt);
    transform: rotate(90deg);
}

.material-zoom-image {
    width: 100%;
    height: 380px;
    object-fit: cover;
    border-radius: 18px 18px 0 0;
    display: block;
}

.material-zoom-details {
    padding: 28px;
}

.material-zoom-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 20px;
}

.material-zoom-name {
    font-size: 26px;
    font-weight: 700;
    color: var(--ct-text);
    margin: 0;
    letter-spacing: -0.01em;
}

.material-zoom-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--ct-gold);
    white-space: nowrap;
}

.material-zoom-description {
    font-size: 15px;
    color: var(--ct-muted);
    line-height: 1.65;
    margin-bottom: 28px;
}

.material-zoom-select-btn {
    width: 100%;
    padding: 15px;
    background: var(--ct-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.material-zoom-select-btn:hover {
    background: var(--ct-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(88, 129, 87, 0.3);
}

.material-zoom-select-btn.selected {
    background: var(--ct-success);
}

/* ── Step 1: Model Home Cards ─────────────────────────────────── */
.model-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.model-option-card {
    border: 1.5px solid var(--ct-border);
    border-radius: 16px;
    padding: 0;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    background: var(--ct-surface);
    position: relative;
    text-align: left;
    overflow: hidden;
}

.model-option-card:hover {
    border-color: var(--ct-primary-light);
    box-shadow: 0 6px 20px rgba(88, 129, 87, 0.14);
    transform: translateY(-3px);
}

.model-option-card.is-selected {
    border-color: var(--ct-primary);
    background: var(--ct-surface);
    box-shadow: 0 6px 22px rgba(88, 129, 87, 0.22);
}

.model-card-check {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: var(--ct-primary);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 13px;
    font-weight: 700;
    z-index: 5;
}

.model-option-card.is-selected .model-card-check {
    display: flex;
}

.model-card-body {
    padding: 14px 16px 16px;
}

.model-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--ct-text);
    margin-bottom: 6px;
}

.model-card-meta {
    font-size: 12px;
    color: var(--ct-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 3px 6px;
    margin-bottom: 8px;
}

.meta-sep {
    color: var(--ct-border);
}

.model-card-ct {
    font-size: 12px;
    font-weight: 600;
    color: var(--ct-primary);
    border-top: 1px solid var(--ct-border);
    padding-top: 8px;
    margin-top: 4px;
}

.model-cards-loading,
.model-cards-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--ct-muted);
    font-size: 15px;
}

.model-cards-error {
    color: var(--ct-danger);
}

/* ── Model card hero image ────────────────────────────────────── */
.model-option-card { overflow: hidden; }

.model-card-img-wrap {
    position: relative;
    overflow: hidden;
    margin: 0;
}

.model-card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    transition: transform 0.35s;
}

.model-option-card:hover .model-card-img { transform: scale(1.05); }

.model-card-zoom-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(28, 25, 23, 0.58);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 0;
}

.model-option-card:hover .model-card-zoom-btn,
.model-card-zoom-btn:focus-visible { opacity: 1; }

/* ── Gallery Lightbox ─────────────────────────────────────────── */
#silva-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(28, 25, 23, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#silva-gallery-lightbox.is-open { opacity: 1; pointer-events: auto; }

.sgl-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 92vw;
}

.sgl-img {
    max-width: 88vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    transition: opacity 0.15s;
}

.sgl-close {
    position: fixed;
    top: 20px;
    right: 24px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 42px;
    cursor: pointer;
    line-height: 1;
    padding: 0 8px;
    z-index: 2;
    transition: color 0.2s;
}

.sgl-close:hover { color: white; }

.sgl-prev, .sgl-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: 1.5px solid rgba(255,255,255,0.18);
    color: white;
    font-size: 36px;
    cursor: pointer;
    padding: 10px 18px;
    border-radius: 10px;
    line-height: 1;
    transition: background 0.2s;
    z-index: 2;
    display: none;
    opacity: 0.8;
}

.sgl-prev { left: 16px; }
.sgl-next { right: 16px; }

.sgl-prev:hover, .sgl-next:hover { background: rgba(255,255,255,0.22); opacity: 1; }

#silva-gallery-lightbox.has-multiple .sgl-prev,
#silva-gallery-lightbox.has-multiple .sgl-next { display: block; }

.sgl-caption {
    margin-top: 12px;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    text-align: center;
    max-width: 640px;
}

.sgl-dots { display: flex; gap: 8px; margin-top: 12px; justify-content: center; }

.sgl-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.28);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}

.sgl-dot.is-active { background: white; transform: scale(1.4); }

/* ── Success Screen ───────────────────────────────────────────── */
#calculator-success-screen {
    padding: 16px 0;
    font-family: 'DM Sans', sans-serif;
}

.ct-success-header {
    text-align: center;
    padding: 36px 24px 28px;
}

.ct-success-header h2 {
    font-size: clamp(22px, 3.5vw, 28px);
    font-weight: 700;
    color: var(--ct-text);
    margin: 14px 0 10px;
    letter-spacing: -0.01em;
}

.ct-booking-cta {
    background: var(--ct-primary);
    border-radius: 16px;
    padding: 30px 28px;
    margin-bottom: 18px;
    text-align: center;
}

.ct-booking-cta h3 {
    color: white;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
}

.ct-booking-cta p {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    margin: 0 0 22px;
    line-height: 1.55;
}

.ct-booking-cta a.ct-book-btn {
    display: inline-block;
    background: white;
    color: var(--ct-primary);
    font-size: 15px;
    font-weight: 700;
    padding: 14px 32px;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    letter-spacing: 0.01em;
}

.ct-booking-cta a.ct-book-btn:hover {
    background: var(--ct-primary-tint);
    transform: translateY(-2px);
}

.ct-coming-soon-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ct-coming-soon-card {
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.5;
}

.ct-coming-soon-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ct-text);
}

.ct-coming-soon-badge {
    font-size: 10px;
    font-weight: 700;
    color: var(--ct-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .silva-calculator-root .calculator-step {
        padding: 20px 16px;
    }

    #style-options-container {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        max-height: 420px;
    }

    .material-image {
        height: 120px;
    }

    .material-info {
        padding: 10px 12px;
    }

    .material-name {
        font-size: 13px;
    }

    .material-price {
        font-size: 14px;
    }

    .model-cards-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .ct-coming-soon-grid {
        grid-template-columns: 1fr 1fr;
    }

    .silva-calculator-root .step-navigation {
        flex-direction: column-reverse;
    }

    .silva-calculator-root .btn-next,
    .silva-calculator-root .btn-submit,
    .silva-calculator-root .btn-prev {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .sgl-prev { left: 4px;  padding: 8px 12px; font-size: 28px; }
    .sgl-next { right: 4px; padding: 8px 12px; font-size: 28px; }
}

/* Countertop Piece Cards */
.countertop-piece-card {
    background: white;
    border: 3px solid var(--silva-primary, #014385);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.countertop-piece-card:hover {
    box-shadow: 0 4px 12px rgba(1, 67, 133, 0.15);
}

.countertop-piece-card.editing {
    border-color: var(--silva-secondary, #2f67b7);
    box-shadow: 0 4px 12px rgba(47, 103, 183, 0.2);
}

.countertop-piece-card h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: var(--silva-primary, #014385);
    font-weight: 700;
}

.countertop-piece-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    color: var(--silva-gray-700, #374151);
}

.countertop-piece-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Piece Management Buttons */
#btn-add-piece {
    background: var(--silva-light-blue, #f3f7ff) !important;
    border: 2px dashed var(--silva-primary, #014385) !important;
    color: var(--silva-primary, #014385) !important;
}

#btn-add-piece:hover {
    background: var(--silva-lighter-blue, #e6f0ff) !important;
    transform: translateY(-1px);
    border-style: solid !important;
}

#btn-remove-piece:hover {
    background: #fef2f2 !important;
    transform: translateY(-1px);
}

/* Material Selection Grid - Double Column Layout */
#style-options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
    margin-bottom: 20px;
}

#style-options-container::-webkit-scrollbar {
    width: 8px;
}

#style-options-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#style-options-container::-webkit-scrollbar-thumb {
    background: var(--silva-primary, #014385);
    border-radius: 4px;
}

/* Material Option Cards */
.material-option-card {
    display: block;
    background: white;
    border: 3px solid var(--silva-gray-200, #e5e7eb);
    border-radius: 10px;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    position: relative;
}

.material-option-card:hover {
    border-color: var(--silva-primary, #014385);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(1, 67, 133, 0.2);
}

.material-option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.material-option-card input[type="radio"]:checked + .material-content {
    background: linear-gradient(to bottom, #f0f7ff 0%, #ffffff 100%);
}

.material-option-card input[type="radio"]:checked + .material-content::before {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: var(--silva-primary, #014385);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    z-index: 10;
}

.material-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.material-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.material-info {
    padding: 12px;
}

.material-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--silva-gray-900, #111827);
    margin: 0 0 6px 0;
    line-height: 1.2;
}

.material-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--silva-primary, #014385);
    margin: 0;
}

.material-price-label {
    font-size: 11px;
    color: var(--silva-gray-500, #6b7280);
    font-weight: 400;
    display: block;
    margin-top: 2px;
}

.material-zoom-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(1, 67, 133, 0.9);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 5;
}

.material-zoom-btn:hover {
    background: var(--silva-primary, #014385);
    transform: scale(1.05);
}

/* Material Zoom Modal/Lightbox */
.material-zoom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.material-zoom-modal.active {
    display: flex;
}

.material-zoom-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.material-zoom-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s;
}

.material-zoom-close:hover {
    background: var(--silva-gray-100, #f3f4f6);
    transform: rotate(90deg);
}

.material-zoom-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
}

.material-zoom-details {
    padding: 30px;
}

.material-zoom-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 20px;
    gap: 20px;
}

.material-zoom-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--silva-gray-900, #111827);
    margin: 0;
}

.material-zoom-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--silva-primary, #014385);
    white-space: nowrap;
}

.material-zoom-description {
    font-size: 16px;
    color: var(--silva-gray-500, #6b7280);
    line-height: 1.6;
    margin-bottom: 30px;
}

.material-zoom-select-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--silva-primary, #014385) 0%, var(--silva-secondary, #2f67b7) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.material-zoom-select-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(1, 67, 133, 0.3);
}

.material-zoom-select-btn.selected {
    background: var(--silva-success, #10b981);
}

/* ── Step 1: Model Home Selection ─────────────────────────── */
.model-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.model-option-card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px 16px 16px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    background: #ffffff;
    position: relative;
    text-align: left;
}

.model-option-card:hover {
    border-color: var(--silva-primary, #4f46e5);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.12);
    transform: translateY(-2px);
}

.model-option-card.is-selected {
    border-color: var(--silva-primary, #4f46e5);
    background: #f5f3ff;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.2);
}

.model-card-check {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    background: var(--silva-primary, #4f46e5);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.model-option-card.is-selected .model-card-check {
    display: flex;
}

.model-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 10px;
}

.model-card-meta {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-bottom: 8px;
}

.meta-sep {
    color: #d1d5db;
}

.model-card-ct {
    font-size: 13px;
    font-weight: 600;
    color: var(--silva-primary, #4f46e5);
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
    margin-top: 4px;
}

.model-cards-loading,
.model-cards-error {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 15px;
}

.model-cards-error {
    color: #ef4444;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #style-options-container {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        max-height: 400px;
    }
    
    .material-image {
        height: 120px;
    }
    
    .material-info {
        padding: 10px;
    }
    
    .material-name {
        font-size: 13px;
    }
    
    .material-price {
        font-size: 14px;
    }

    .model-cards-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .model-option-card {
        padding: 14px 12px 12px;
    }
}

/* ── Model card hero image ───────────────────────────────────────────── */
.model-option-card { overflow: hidden; }

.model-card-img-wrap {
    position: relative;
    margin: -20px -16px 12px;
    overflow: hidden;
}

.model-card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    transition: transform .35s;
}

.model-option-card:hover .model-card-img { transform: scale(1.04); }

.model-card-zoom-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0,0,0,.6);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
    padding: 0;
    line-height: 1;
}

.model-option-card:hover .model-card-zoom-btn,
.model-card-zoom-btn:focus-visible { opacity: 1; }

/* ── Gallery Lightbox ────────────────────────────────────────────────── */
#silva-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}

#silva-gallery-lightbox.is-open { opacity: 1; pointer-events: auto; }

.sgl-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 92vw;
}

.sgl-img {
    max-width: 88vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    transition: opacity .15s;
}

.sgl-close {
    position: fixed;
    top: 20px;
    right: 24px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 42px;
    cursor: pointer;
    line-height: 1;
    padding: 0 8px;
    z-index: 2;
    opacity: .75;
    transition: opacity .2s;
}

.sgl-close:hover { opacity: 1; }

.sgl-prev, .sgl-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.12);
    border: 2px solid rgba(255,255,255,.2);
    color: #fff;
    font-size: 42px;
    cursor: pointer;
    padding: 10px 18px;
    border-radius: 8px;
    line-height: 1;
    transition: background .2s, opacity .2s;
    z-index: 2;
    display: none;
    opacity: .75;
}

.sgl-prev { left: 16px; }
.sgl-next { right: 16px; }

.sgl-prev:hover, .sgl-next:hover { background: rgba(255,255,255,.28); opacity: 1; }

#silva-gallery-lightbox.has-multiple .sgl-prev,
#silva-gallery-lightbox.has-multiple .sgl-next { display: block; }

/* ── Hide duplicate sidebar on countertop wizard ─────────────── */
.silva-calculator-root[data-calculator-type="countertop"] .silva-calculator-summary {
    display: none;
}

/* ─────────────────────────────────────────────────────────────── *
 *  Countertop — Inline Category Pills + Item Grid                 *
 * ─────────────────────────────────────────────────────────────── */

/* Category pills row */
.ct-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 16px;
}

.ct-pill {
    padding: 8px 18px;
    border-radius: 24px;
    border: 1.5px solid var(--ct-border, #e5e7eb);
    background: var(--ct-surface, #fff);
    color: var(--ct-text, #111827);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.ct-pill:hover {
    border-color: var(--ct-primary-light, #a8c5a5);
    color: var(--ct-primary, #588157);
}

.ct-pill-active {
    border-color: var(--ct-primary, #588157) !important;
    background: var(--ct-primary-tint, #eff4ee) !important;
    color: var(--ct-primary-dark, #3e5e3a) !important;
}

/* Inline item grid */
#ct-style-grid {
    margin-bottom: 16px;
}

.ct-item-inner-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    max-height: 520px;
    overflow-y: auto;
    padding: 2px 2px 10px;
}

.ct-item-inner-grid::-webkit-scrollbar { width: 5px; }
.ct-item-inner-grid::-webkit-scrollbar-track { background: var(--ct-surface-alt, #f5f5f3); border-radius: 4px; }
.ct-item-inner-grid::-webkit-scrollbar-thumb { background: var(--ct-primary-light, #a8c5a5); border-radius: 4px; }

/* Item cards */
.ct-item-card {
    background: var(--ct-surface, #fff);
    border: 1.5px solid var(--ct-border, #e5e7eb);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.18s, transform 0.15s, box-shadow 0.18s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.ct-item-card:hover {
    border-color: var(--ct-primary-light, #a8c5a5);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(88, 129, 87, 0.16);
}

.ct-item-card.ct-item-selected {
    border-color: var(--ct-primary, #588157) !important;
    box-shadow: 0 6px 20px rgba(88, 129, 87, 0.22) !important;
}

/* Checkmark badge on selected */
.ct-item-card.ct-item-selected::after {
    content: "\2713";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    background: var(--ct-primary, #588157);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    line-height: 26px;
    text-align: center;
    z-index: 6;
}

/* Image wrap */
.ct-item-img-wrap {
    position: relative;
    overflow: hidden;
}

.ct-item-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    transition: transform 0.35s;
}

.ct-item-card:hover .ct-item-img {
    transform: scale(1.04);
}

.ct-item-img-placeholder {
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, var(--ct-primary-tint, #eff4ee), var(--ct-border, #e5e7eb));
}

/* Card info  */
.ct-item-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ct-item-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--ct-text, #111827);
    line-height: 1.3;
    margin: 0;
}

.ct-item-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--ct-gold, #b5903a);
    margin: 0;
}

.ct-item-price-label {
    font-size: 11px;
    color: var(--ct-muted, #6b7280);
    font-weight: 400;
}

/* ── Selection summary bar ──────────────────────────────────── */
.ct-material-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 18px;
    background: var(--ct-primary-tint, #eff4ee);
    border: 1px solid var(--ct-primary-light, #a8c5a5);
    border-radius: 12px;
    margin-bottom: 16px;
}

.ct-summary-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.ct-summary-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ct-text, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-summary-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--ct-primary, #588157);
    white-space: nowrap;
}

.ct-change-btn {
    padding: 7px 16px;
    border-radius: 24px;
    border: 1.5px solid var(--ct-primary, #588157);
    background: #fff;
    color: var(--ct-primary, #588157);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.ct-change-btn:hover {
    background: var(--ct-primary, #588157);
    color: #fff;
}

@media (max-width: 600px) {
    .ct-item-inner-grid {
        grid-template-columns: 1fr;
        max-height: none;
    }
    .ct-material-summary-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ── Contact Modal ───────────────────────────────────────────── */
#ct-contact-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

#ct-contact-modal.is-open {
    display: flex;
}

#ct-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
}

#ct-modal-panel {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    margin: 16px;
}

#ct-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s;
}

#ct-modal-close:hover {
    color: #111827;
}

@media (max-width: 520px) {
    #ct-modal-panel {
        padding: 24px 20px;
        border-radius: 12px;
    }
}

.sgl-caption {
    margin-top: 12px;
    color: #d1d5db;
    font-size: 14px;
    text-align: center;
    max-width: 640px;
}

.sgl-dots { display: flex; gap: 8px; margin-top: 12px; justify-content: center; }

.sgl-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background .2s, transform .2s;
}

.sgl-dot.is-active { background: #fff; transform: scale(1.35); }

@media (max-width: 600px) {
    .sgl-prev { left: 4px;  padding: 8px 12px; font-size: 30px; }
    .sgl-next { right: 4px; padding: 8px 12px; font-size: 30px; }
}
