/* ==========================================================================
   One-Page Storefront (/w/{slug}) & Frontend Inline Editor + Camera Cropper
   ========================================================================== */

.sf-page {
    background: var(--bg-main, #f8fafc);
    color: var(--text-main, #0f172a);
    min-height: 100vh;
    padding-bottom: 64px;
}

.sf-owner-bar {
    position: sticky;
    top: 0;
    z-index: 950;
    background: #0f172a;
    color: #fff;
    padding: 10px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.sf-owner-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.sf-owner-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sf-btn-sm {
    border: none;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.sf-btn-edit-toggle {
    background: #f97316;
    color: #fff;
}
.sf-btn-edit-toggle.active {
    background: #10b981;
}
.sf-btn-save {
    background: #10b981;
    color: #fff;
}
.sf-btn-ghost {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* Hero 5-Slide Banner */
.sf-hero {
    position: relative;
    width: 100%;
    height: min(62vh, 480px);
    min-height: 320px;
    overflow: hidden;
    background: #1e293b;
}

.sf-hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.7s ease-in-out;
}
.sf-hero-slide.active {
    opacity: 1;
}

.sf-hero-overlay {
    position: relative;
    z-index: 2;
    height: 100%;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.35) 55%, rgba(15, 23, 42, 0.2) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    padding: 32px 20px;
    color: #fff;
}

.sf-hero-title {
    font-size: clamp(1.65rem, 4vw, 2.5rem);
    font-weight: 800;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}

.sf-hero-sub {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.9);
    max-width: 600px;
    margin: 0 0 18px 0;
}

.sf-hero-cta-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.sf-hero-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 6px;
}

.sf-hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.45);
    border: none;
    padding: 0;
    cursor: pointer;
}
.sf-hero-dot.active {
    width: 22px;
    background: #f97316;
}

/* Container & Sections */
.sf-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

.sf-section {
    background: var(--bg-surface, #fff);
    border-radius: 16px;
    padding: 24px 20px;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    border: 1px solid var(--border-color, #e2e8f0);
    position: relative;
}

.sf-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.sf-section-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-main, #0f172a);
}

.sf-story-text {
    font-size: 0.96rem;
    line-height: 1.7;
    color: var(--text-muted, #475569);
    white-space: pre-line;
    margin: 0;
}

/* Menu Showcase (Read-only Catalog) */
.sf-cat-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 18px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(249, 115, 22, 0.25);
    color: #ea580c;
}

.sf-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.sf-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-main, #f8fafc);
}

.sf-menu-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e2e8f0;
}

.sf-menu-info {
    flex: 1;
    min-width: 0;
}

.sf-menu-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-main, #0f172a);
}

.sf-menu-price {
    font-weight: 700;
    font-size: 0.92rem;
    color: #ea580c;
    flex-shrink: 0;
}

/* Gallery Grid */
.sf-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.sf-gallery-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #e2e8f0;
}

.sf-gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sf-remove-img-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.92);
    color: #fff;
    border: none;
    font-weight: 700;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.sf-editing .sf-remove-img-btn {
    display: inline-flex;
}

/* Inline Editor Controls */
.sf-edit-panel {
    display: none;
    background: rgba(249, 115, 22, 0.06);
    border: 1px dashed #f97316;
    border-radius: 12px;
    padding: 12px;
    margin-top: 12px;
}

.sf-editing .sf-edit-panel {
    display: block;
}

.sf-editable-input {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 0.92rem;
    margin-bottom: 8px;
}

/* Booking & Contact */
.sf-booking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.sf-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 680px) {
    .sf-contact-grid {
        grid-template-columns: 1fr;
    }
}

.sf-map-frame {
    width: 100%;
    height: 240px;
    border: 0;
    border-radius: 12px;
    background: #e2e8f0;
}

/* Camera & Cropper Modal */
.cc-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.cc-modal-backdrop.open {
    display: flex;
}

.cc-modal-card {
    background: #fff;
    color: #0f172a;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    padding: 18px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}

.cc-canvas-wrap {
    position: relative;
    width: 100%;
    background: #0f172a;
    border-radius: 12px;
    overflow: hidden;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px 0;
}

.cc-canvas-wrap canvas {
    max-width: 100%;
    display: block;
    cursor: grab;
}

.cc-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.cc-controls input[type="range"] {
    flex: 1;
}

.cc-btn-row {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
