/* =========================================================
   Aparência: editor + live preview of the storefront
   ========================================================= */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.appearance-editor { overflow: hidden; }
.appearance-editor .mud-tabs-tabbar { border-bottom: 1px solid #e2e8f0; }
.appearance-editor .mud-tab { text-transform: none; font-weight: 600; letter-spacing: 0; min-height: 48px; padding: 6px 14px; }
/* 8 tabs: wrap onto two rows instead of a sideways-scrolling bar that hides tabs. */
.appearance-editor .mud-tabs-tabbar-content, .appearance-editor .mud-tabs-tabbar-inner { overflow: visible; }
.appearance-editor .mud-tabs-tabbar-wrapper { flex-wrap: wrap; transform: none !important; width: 100%; }
.appearance-editor .mud-tabs-scroll-button, .appearance-editor .mud-tab-slider { display: none; }
.appearance-editor .mud-tab.mud-tab-active { box-shadow: inset 0 -2px 0 var(--mud-palette-primary); color: var(--mud-palette-primary); }

.form-section { display: grid; gap: 14px; padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid #eef2f7; }
.form-section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.form-section-title { font-weight: 700 !important; }
.form-section-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inline-option { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.inline-option .mud-input-control { max-width: 220px; }

/* Segmented choices */
.choice { display: grid; gap: 6px; }
.choice-label { font-size: .85rem; font-weight: 600; color: #475569; }
.choice-group { flex-wrap: wrap; width: fit-content; max-width: 100%; }
.choice-group .mud-toggle-item { text-transform: none; font-weight: 500; }

/* Ready-made themes */
.preset-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.preset-card {
    position: relative; display: grid; gap: 0; padding: 0; text-align: left; cursor: pointer; overflow: hidden;
    border: 2px solid #e2e8f0; border-radius: 14px; background: #fff; font: inherit; color: inherit;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.preset-card:hover { border-color: #a5b4fc; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 23, 42, .08); }
.preset-card.selected { border-color: var(--mud-palette-primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); }
.preset-sample { display: grid; height: 120px; grid-template-rows: 28px 1fr auto; }
.preset-sample-header { display: flex; align-items: center; padding: 0 12px; font-size: .8rem; font-weight: 700; border-bottom: 1px solid rgba(0, 0, 0, .06); }
.preset-sample-body { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; }
.preset-aa { font-size: 2rem; line-height: 1; }
.preset-btn { width: 64px; height: 18px; }
.preset-swatches { display: flex; gap: 0; height: 10px; }
.preset-swatches span { flex: 1; }
.preset-info { display: grid; gap: 2px; padding: 12px 14px 14px; }
.preset-info strong { font-size: .98rem; }
.preset-info span { font-size: .8rem; color: #64748b; line-height: 1.4; }
.preset-check { position: absolute; top: 34px; right: 10px; background: #fff; border-radius: 50%; }

/* Colors */
.color-groups { display: grid; gap: 20px 28px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.color-group { display: grid; gap: 10px; align-content: start; }
.color-field { display: flex; align-items: center; gap: 12px; padding: 6px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.color-field input[type=color] { width: 42px; height: 42px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; flex: none; }
.color-field input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type=color]::-webkit-color-swatch { border: 1px solid rgba(0, 0, 0, .12); border-radius: 8px; }
.color-field-text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.color-field-label { font-size: .82rem; font-weight: 600; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.color-field-hex { border: 0; padding: 0; font: 500 .85rem ui-monospace, SFMono-Regular, Menlo, monospace; color: #64748b; background: transparent; width: 100%; text-transform: lowercase; }
.color-field-hex:focus { outline: none; color: #0f172a; }

/* Fonts */
.font-sample { padding: 16px 18px; border-radius: 12px; border: 1px solid #e2e8f0; }
.font-sample div { font-size: 1.6rem; line-height: 1.2; margin-bottom: 4px; }
.font-sample p { margin: 0; opacity: .85; }

/* Header layouts */
.layout-choices { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) { .layout-choices { grid-template-columns: 1fr; } }
.layout-choice {
    display: grid; gap: 8px; padding: 12px; border: 2px solid #e2e8f0; border-radius: 12px; background: #fff; cursor: pointer;
    font: inherit; font-size: .88rem; font-weight: 600; color: #334155; transition: border-color .15s;
}
.layout-choice:hover { border-color: #a5b4fc; }
.layout-choice.selected { border-color: var(--mud-palette-primary); color: var(--mud-palette-primary); }
.layout-pic { position: relative; height: 54px; border-radius: 8px; background: #f1f5f9; display: block; }
.layout-pic i { position: absolute; display: block; border-radius: 3px; background: #94a3b8; }
.layout-choice.selected .layout-pic i { background: var(--mud-palette-primary); }
.layout-pic .lp-logo { width: 26px; height: 9px; top: 10px; }
.layout-pic .lp-search { width: 40px; height: 9px; top: 10px; opacity: .45; }
.layout-pic .lp-icons { width: 14px; height: 9px; top: 10px; right: 8px; }
.layout-pic .lp-menu { height: 5px; bottom: 11px; opacity: .6; }
.layout-pic-classic .lp-logo { left: 8px; }
.layout-pic-classic .lp-search { left: 40%; }
.layout-pic-classic .lp-menu { left: 8px; width: 60%; }
.layout-pic-centered .lp-logo { left: calc(50% - 13px); }
.layout-pic-centered .lp-search { left: 8px; width: 28px; }
.layout-pic-centered .lp-menu { left: 20%; width: 60%; }
.layout-pic-inline .lp-logo { left: 8px; }
.layout-pic-inline .lp-menu { left: 40px; top: 12px; bottom: auto; width: 44px; }
.layout-pic-inline .lp-search { left: auto; right: 26px; width: 22px; }

/* Home sections */
.section-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.section-list li {
    display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px;
    padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; transition: opacity .15s;
}
.section-list li.off { background: #f8fafc; }
.section-list li.off .section-name strong { color: #94a3b8; }
.section-order { display: flex; flex-direction: column; }
.section-name { display: grid; gap: 0; min-width: 0; }
.section-name strong { font-size: .92rem; }
.section-name .mud-input-control { margin-top: 0; }
.section-limit { width: 84px; }
@media (max-width: 600px) { .section-list li { grid-template-columns: auto 1fr auto; } .section-limit { grid-column: 2; } }
/* Extra settings of a section (products of "Mais pedidos", banners of the middle carousel), under its row. */
.section-list li.section-extra { display: block; margin: -4px 0 0 34px; padding: 10px 12px; background: #f8fafc; }
.section-extra-body { display: grid; gap: 10px; }

.benefit-row { display: grid; grid-template-columns: 170px 1fr 1fr auto; gap: 10px; align-items: center; }
@media (max-width: 700px) { .benefit-row { grid-template-columns: 1fr auto; } .benefit-row > .mud-input-control { grid-column: 1; } }

/* Preview panel */
.preview-panel { position: sticky; top: 80px; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }

.sp-frame { border-radius: 14px; overflow: hidden; border: 1px solid #dbe2ea; background: #fff; box-shadow: 0 18px 40px rgba(15, 23, 42, .12); transition: max-width .25s; }
.sp-frame.sp-mobile { max-width: 300px; margin: 0 auto; border-radius: 26px; border-width: 6px; border-color: #0f172a; }
.sp-browser { display: flex; align-items: center; gap: 5px; padding: 8px 10px; background: #f1f5f9; border-bottom: 1px solid #e2e8f0; }
.sp-browser > span { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.sp-browser > span:nth-child(1) { background: #f87171; }
.sp-browser > span:nth-child(2) { background: #fbbf24; }
.sp-browser > span:nth-child(3) { background: #34d399; }
.sp-url { margin-left: 8px; flex: 1; font-size: 10px; color: #64748b; background: #fff; border-radius: 6px; padding: 3px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-mobile .sp-browser > span { display: none; }
.sp-mobile .sp-url { margin: 0; text-align: center; }

.sp-store {
    position: relative; max-height: 640px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin;
    background: var(--bg); color: var(--tx); font-family: var(--font); line-height: 1.45;
}
.sp-mobile .sp-store { max-height: 560px; }
.sp-store img { display: block; max-width: 100%; }
.sp-h1, .sp-h2, .sp-brand, .sp-tile span { font-family: var(--hfont); font-weight: var(--hw); line-height: 1.15; }
.sp-upper .sp-h1, .sp-upper .sp-h2, .sp-upper .sp-brand span, .sp-upper .sp-tile span { text-transform: uppercase; letter-spacing: .04em; }

.sp-announcement { background: var(--abg); color: var(--atx); text-align: center; font-size: .8em; padding: 5px 8px; font-weight: 500; }
.sp-header { background: var(--hbg); color: var(--htx); border-bottom: 1px solid color-mix(in srgb, var(--htx) 10%, transparent); }
.sp-header-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.sp-brand { font-size: 1.35em; flex: none; }
.sp-brand img { width: auto; max-width: 110px; object-fit: contain; }
.sp-search { flex: 1; max-width: 180px; margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: .78em; padding: 5px 8px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--htx) 18%, transparent); opacity: .8; white-space: nowrap; overflow: hidden; }
.sp-actions { display: flex; gap: 6px; margin-left: auto; flex: none; }
.sp-search + .sp-actions { margin-left: 0; }
.sp-menu { display: flex; gap: 14px; padding: 7px 14px; font-size: .82em; font-weight: 500; border-top: 1px solid color-mix(in srgb, var(--htx) 8%, transparent); white-space: nowrap; overflow: hidden; }
.sp-menu.inline { border: 0; padding: 0; flex: 1; min-width: 0; }
.sp-header-centered .sp-header-row { display: grid; grid-template-columns: 1fr auto 1fr; }
.sp-header-centered .sp-brand { grid-column: 2; grid-row: 1; justify-self: center; }
.sp-header-centered .sp-search { grid-column: 1; grid-row: 1; margin: 0; }
.sp-header-centered .sp-actions { grid-column: 3; grid-row: 1; justify-self: end; }
.sp-header-centered .sp-menu { justify-content: center; }
.sp-mobile .sp-search { display: none; }

.sp-button { display: inline-block; padding: 6px 14px; border-radius: var(--r); font-weight: 600; font-size: .85em; border: 1.5px solid transparent; }
.sp-button.primary { background: var(--p); color: var(--on-p); }
.sp-buttons-pill .sp-button, .sp-buttons-pill .sp-search { border-radius: 99px; }
.sp-buttons-outline .sp-button.primary { background: transparent; color: var(--p); border-color: var(--p); }

.sp-hero { position: relative; overflow: hidden; }
.sp-hero-inner { position: relative; display: grid; align-items: center; gap: 14px; padding: 0 14px; }
.sp-hero-sm .sp-hero-inner { min-height: 120px; }
.sp-hero-md .sp-hero-inner { min-height: 160px; }
.sp-hero-lg .sp-hero-inner { min-height: 210px; }
.sp-hero-content { padding: 16px 0; max-width: 300px; }
.sp-h1 { font-size: 1.9em; margin-bottom: 6px; }
.sp-hero p { margin: 0 0 10px; font-size: .85em; opacity: .85; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sp-align-center .sp-hero-inner { justify-items: center; text-align: center; }
.sp-hero-text { background: radial-gradient(circle at 88% 15%, color-mix(in srgb, var(--s) 24%, transparent), transparent 42%), radial-gradient(circle at 8% 95%, color-mix(in srgb, var(--p) 14%, transparent), transparent 48%), var(--sf); }
.sp-hero-text .sp-h1, .sp-hero-split .sp-h1 { color: var(--p); }
.sp-hero-banner, .sp-hero-carousel { background: #111; color: #fff; }
.sp-hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none !important; }
.sp-hero-overlay { position: absolute; inset: 0; background: #000; }
.sp-hero-split { background: var(--sf); }
.sp-hero-split .sp-hero-inner { grid-template-columns: 1fr 1fr; padding-top: 12px; padding-bottom: 12px; }
.sp-mobile .sp-hero-split .sp-hero-inner { grid-template-columns: 1fr; }
.sp-hero-side { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: calc(var(--r) * 2); }

.sp-benefits { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; padding: 10px 14px; border-bottom: 1px solid color-mix(in srgb, var(--tx) 8%, transparent); font-size: .75em; font-weight: 600; }
.sp-benefit { display: flex; align-items: center; gap: 6px; }
.sp-benefit-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--p) 12%, transparent); color: var(--p); }

.sp-section { padding: 16px 14px 4px; }
.sp-h2 { font-size: 1.2em; margin-bottom: 10px; }
.sp-sale-section { background: color-mix(in srgb, var(--sale) 5%, var(--bg)); padding-bottom: 14px; margin-top: 10px; }
.sp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.sp-tile { position: relative; aspect-ratio: 4 / 3; border-radius: calc(var(--r) * 1.5); overflow: hidden; display: flex; align-items: flex-end; padding: 8px; color: var(--on-p); background: linear-gradient(135deg, var(--p), color-mix(in srgb, var(--p) 55%, var(--s))); }
.sp-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none !important; }
.sp-tile:has(img) { color: #fff; }
.sp-tile:has(img)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent 60%); }
.sp-tile span { position: relative; z-index: 1; font-size: .9em; }

.sp-grid { display: grid; gap: 12px 8px; }
.sp-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sp-card-image { position: relative; aspect-ratio: var(--ratio); border-radius: var(--r); overflow: hidden; background: var(--sf); }
.sp-card-image img { width: 100%; height: 100%; object-fit: var(--fit); }
.sp-badge { position: absolute; top: 5px; left: 5px; background: var(--sale); color: #fff; font-size: .62em; font-weight: 700; padding: 1px 6px; border-radius: 99px; }
.sp-card-body { display: grid; gap: 1px; font-size: .78em; }
.sp-card-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-price { font-weight: 700; display: flex; gap: 4px; flex-wrap: wrap; align-items: baseline; }
.sp-price s { font-weight: 400; opacity: .55; font-size: .85em; }
.sp-sale-price { color: var(--sale); }
.sp-card-button { text-align: center; font-size: .7em; padding: 4px 6px; }
.sp-text-center .sp-card-body { text-align: center; }
.sp-text-center .sp-price { justify-content: center; }
.sp-cards-bordered .sp-card { border: 1px solid color-mix(in srgb, var(--tx) 12%, transparent); border-radius: calc(var(--r) * 1.25); padding: 5px 5px 7px; }
.sp-cards-shadow .sp-card { background: var(--bg); border-radius: calc(var(--r) * 1.25); padding: 5px 5px 7px; box-shadow: 0 1px 3px rgba(0, 0, 0, .07), 0 6px 14px rgba(0, 0, 0, .07); }

.sp-about { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: center; font-size: .82em; }
.sp-about:not(:has(img)) { grid-template-columns: 1fr; text-align: center; }
.sp-about img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: calc(var(--r) * 1.5); }
.sp-about p { margin: 0; opacity: .85; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }

.sp-footer { margin-top: 18px; background: var(--fbg); color: var(--ftx); padding: 14px; display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 12px; font-size: .8em; }
.sp-mobile .sp-footer { grid-template-columns: 1fr; }
.sp-social { display: flex; gap: 5px; margin-top: 8px; }
.sp-social span { width: 14px; height: 14px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ftx) 40%, transparent); }
.sp-footer-col { display: grid; gap: 5px; align-content: start; }
.sp-footer-col b, .sp-footer-col i { display: block; height: 5px; border-radius: 3px; background: var(--ftx); }
.sp-footer-col b { width: 50%; opacity: .5; margin-bottom: 3px; }
.sp-footer-col i { width: 70%; opacity: .25; }
.sp-whatsapp { position: sticky; float: right; bottom: 10px; margin: -40px 10px 10px 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #25d366; color: #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .2); }
.sp-quick-add { display: flex; gap: 4px; align-items: stretch; margin-top: auto; }
.sp-quick-add .sp-card-button { flex: 1; padding: 4px 4px; }
.sp-qty { display: inline-flex; align-items: center; gap: 5px; padding: 0 5px; font-size: .68em; font-weight: 600; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--tx) 20%, transparent); }
.sp-qty i { font-style: normal; opacity: .6; }
.sp-buttons-pill .sp-qty { border-radius: 99px; }

.layout-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; }
.section-style { max-width: 190px; }

/* Preview: testimonials and FAQ */
.sp-quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.sp-quote { background: var(--sf); border-radius: var(--r); padding: 8px; font-size: .8em; }
.sp-quote p { margin: 4px 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sp-stars { color: #f59e0b; letter-spacing: 1px; }
.sp-faq-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid color-mix(in srgb, var(--tx) 15%, transparent); font-size: .82em; }

/* Editors: carousel banners, testimonials, FAQ */
.slide-editor { border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
.slide-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.slide-editor-head > .mud-input-control { flex: 1; }

/* Google result preview */
.seo-preview { display: grid; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--mud-palette-background-gray); font-family: Arial, sans-serif; }
.seo-url { font-size: .78rem; color: var(--mud-palette-text-secondary); }
.seo-title { font-size: 1.1rem; color: #1a0dab; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-text { font-size: .85rem; color: var(--mud-palette-text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* App (PWA) preview: the icon on a phone home screen */
.app-preview { display: grid; justify-items: start; gap: 8px; margin: 6px 0 16px; }
.app-phone { width: 220px; padding: 26px 18px; border-radius: 26px; box-shadow: inset 0 0 0 6px #111, 0 10px 30px rgba(0, 0, 0, .2); }
.app-home-icons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.app-ghost { aspect-ratio: 1; border-radius: 12px; background: rgba(255, 255, 255, .35); }
.app-home-icon { display: grid; justify-items: center; gap: 4px; }
.app-home-icon img { width: 100%; aspect-ratio: 1; border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); background: #fff; }
.app-home-icon small { color: #fff; font-size: .62rem; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); white-space: nowrap; max-width: 60px; overflow: hidden; text-overflow: ellipsis; }
