/* ============================================================
   SPA Screens CSS — extracted from spa-engine.js
   All Screen 2, Screen 3, Screen 4 styles
   ============================================================ */

/* SPA Screen transitions — visibility managed by Alpine x-show */
.spa-screen.active { display: block; animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ==============================
   Screen 2: Header
   ============================== */
.s2-header { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.s2-back-btn { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: #1c1c1c; padding: 6px; border-radius: 50%; transition: background 0.2s; }
.s2-back-btn:hover { background: #f0f0f0; }
.s2-title { font-size: 1.4rem; font-weight: 800; color: #1c1c1c; margin: 0; }
.s2-subtitle { font-size: 0.85rem; color: #e57373; margin: 2px 0 0; font-weight: 500; }

/* Screen 2: Cards Grid — 3 columns matching Screen 1 layout */
.s2-cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .s2-cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .s2-cards-grid { grid-template-columns: 1fr; } }

/* ==============================
   Screen 3: Modal Panel
   ============================== */
#screen3Modal { display: flex; }
.s3-panel { max-height: 90vh; max-width: 750px !important; width: 95%; padding: 0 !important; border-radius: 14px !important; overflow-y: auto !important; overflow-x: hidden; background: #F8F9FA; }
.s3-hero { width: 100%; height: 200px; object-fit: cover; display: block; }
.s3-title { font-size: 1.5rem; font-weight: 800; color: #1c1c1c; margin: 20px 28px 4px; }
.s3-desc { font-size: 0.88rem; color: #888; margin: 0 28px 18px; line-height: 1.6; }
.s3-section-title { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: #555; margin: 0 28px 16px; }

/* Screen 3: 2-Column Product Grid */
.s3-products-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 0 28px 28px; }

.s3-product-card {
    display: flex; justify-content: space-between; align-items: flex-start;
    border: 1px solid #eee; border-radius: 12px; padding: 16px; padding-bottom: 24px;
    cursor: pointer; transition: box-shadow 0.2s, transform 0.15s; background: #fff;
}
.s3-product-card:hover { transform: translateY(-2px); }
.s3-product-info { flex: 1; min-width: 0; padding-right: 15px; }
.s3-product-title { font-size: 0.95rem; font-weight: 800; color: #1c1c1c; margin: 0 0 6px; line-height: 1.3; }
.s3-product-desc { font-size: 0.8rem; color: #666; margin: 0 0 8px; line-height: 1.4; }
.s3-product-meta { font-size: 0.75rem; color: #888; margin: 0 0 8px; }
.s3-product-price { font-size: 1.05rem; font-weight: 800; color: #1c1c1c; margin: 0; }
.s3-product-action-col { width: 110px; display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.s3-product-img { width: 110px; height: 110px; border-radius: 12px; overflow: hidden; }
.s3-product-img img { width: 100%; height: 100%; object-fit: cover; }
.s3-product-img-placeholder { width: 110px; height: 110px; border-radius: 12px; background: #f5f5f5 url('assets/placeholder.png') center/cover no-repeat; border: none; }
.s3-add-btn {
    background: #fff; border: 1px solid #e0e0e0; color: #1ea050;
    padding: 6px 0; border-radius: 8px; font-weight: 800; font-size: 0.85rem;
    cursor: pointer; transition: all 0.2s; text-transform: uppercase;
    width: 85%; margin-top: 10px;
}
.s3-add-btn:hover { background: #f0fdf4; border-color: #1ea050; }

@media (max-width: 560px) { .s3-products-grid { grid-template-columns: 1fr; padding: 0 16px 20px; } }
@media (max-width: 400px) {
    .s3-product-action-col { width: 85px; }
    .s3-product-img, .s3-product-img-placeholder { width: 85px; height: 85px; }
    .s3-product-card { padding: 12px; }
    .s3-title { font-size: 1.2rem; margin: 14px 16px 4px; }
    .s3-desc { margin: 0 16px 14px; }
    .s3-section-title { margin: 0 16px 12px; }
}

/* ==============================
   Screen 4: Dots
   ============================== */
.s4-dot { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid #1c1c1c; background: transparent; transition: background 0.3s; }
.s4-dot.active { background: #1c1c1c; }

/* Responsive: Screen 4 — tablet gets centered modal */
@media (max-width: 1024px) and (min-width: 801px) {
    .svc-detail-sheet { max-width: 780px !important; }
}

/* ==============================
   MOBILE FULL-SCREEN — Screen 3 & Screen 4
   ============================== */
@media (max-width: 800px) {

    /* Screen 3: Full-screen overlay */
    #screen3Modal {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: #F8F9FA !important;
        flex-direction: column !important;
        overflow-y: auto !important;
        z-index: 2000 !important;
        padding: 0 !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
    }
    .s3-panel {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 0 !important;
        min-height: 100vh !important;
        padding-bottom: 80px !important;
    }
    .s3-hero { height: 220px !important; border-radius: 0 !important; }
    .s3-title { font-size: 1.3rem !important; margin: 16px 16px 4px !important; }
    .s3-desc  { margin: 0 16px 14px !important; }
    .s3-section-title { margin: 0 16px 12px !important; }
    .s3-products-grid { grid-template-columns: 1fr !important; padding: 0 16px 24px !important; gap: 12px !important; }
    .s3-product-card  { padding: 14px !important; }
    .s3-product-img, .s3-product-img-placeholder { width: 90px !important; height: 90px !important; }
    .s3-product-action-col { width: 90px !important; }

    /* Screen 4: Full-screen bottom sheet */
    .svc-detail-sheet {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        max-height: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 0 !important;
    }
    /* Scroll single column on mobile */
    #screen4Overlay [style*="grid-template-columns"] { grid-template-columns: 1fr !important; gap: 16px !important; }
    .s4-right { padding-top: 0 !important; }
}

/* Responsive: Screen 2 header — smaller on mobile */
@media (max-width: 480px) {
    .s2-title { font-size: 1.1rem; }
    .s2-subtitle { font-size: 0.78rem; }
    .s2-cards-grid { gap: 12px; }
}
