/* Public storefront (/shop/{slug}). The merchant's name and logo lead; Posmart green is the accent. */
:root {
    --sf-brand: #8AB33E;
    --sf-brand-hover: #779C33;
    --sf-brand-tint: #F1F6E7;
    --sf-brand-ink: #4B6A16;
    --sf-ink: #1D2318;
    --sf-muted: #646B5D;
    --sf-line: #E6E9E1;
    --sf-paper: #F7F8F5;
    --sf-surface: #FFFFFF;
    --sf-danger: #B42318;
    --sf-radius: 14px;
}

.sf-body {
    font-family: 'Rubik', system-ui, sans-serif;
    color: var(--sf-ink);
    background: var(--sf-paper);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.sf-body h1, .sf-body h2, .sf-body h3 {
    font-family: 'Poppins', 'Rubik', sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--sf-ink);
}
.sf-main { flex: 1; }
.sf-container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .sf-container { padding: 0 24px; } }

/* Header */
.sf-header {
    position: sticky; top: 0; z-index: 10;
    background: var(--sf-surface);
    border-bottom: 1px solid var(--sf-line);
}
.sf-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; }
.sf-brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: inherit; }
.sf-brand-logo { width: 42px; height: 42px; border-radius: 10px; object-fit: contain; flex-shrink: 0; background: var(--sf-surface); }
.sf-brand-logo--initial {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--sf-brand); color: #fff; font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 1.2rem;
}
.sf-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sf-brand-name { font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-brand-city { font-size: .8rem; color: var(--sf-muted); }
.sf-header-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Buttons */
.sf-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 999px; border: 1.5px solid transparent;
    font-weight: 500; font-size: .95rem; line-height: 1.1; text-decoration: none; white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.sf-btn--primary { background: var(--sf-brand); color: #fff; }
.sf-btn--primary:hover { background: var(--sf-brand-hover); color: #fff; }
.sf-btn--ghost { border-color: var(--sf-line); color: var(--sf-ink); background: var(--sf-surface); }
.sf-btn--ghost:hover { border-color: var(--sf-brand); color: var(--sf-brand-ink); }
.sf-btn--lg { padding: 14px 24px; font-size: 1rem; }
.sf-btn--block { width: 100%; }
.sf-btn:focus-visible, .sf-chip:focus-visible, .sf-card:focus-visible { outline: 3px solid rgba(138, 179, 62, .45); outline-offset: 2px; }
@media (max-width: 575.98px) { .sf-hide-sm { display: none; } }

/* Intro + toolbar */
.sf-intro { padding-top: 28px; padding-bottom: 8px; } /* side padding comes from .sf-container */
.sf-intro h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 6px; }
.sf-intro p { color: var(--sf-muted); margin: 0; max-width: 62ch; }
.sf-toolbar { position: sticky; top: 68px; z-index: 5; background: var(--sf-paper); padding: 16px 0 12px; }
.sf-search { position: relative; }
.sf-search i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--sf-muted); }
.sf-search input {
    width: 100%; padding: 12px 16px 12px 44px; border-radius: 999px;
    border: 1.5px solid var(--sf-line); background: var(--sf-surface); font-size: 1rem; color: var(--sf-ink);
}
.sf-search input:focus { outline: none; border-color: var(--sf-brand); box-shadow: 0 0 0 3px rgba(138, 179, 62, .2); }
.sf-chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 2px; scrollbar-width: none; }
.sf-chips::-webkit-scrollbar { display: none; }
.sf-chip {
    flex-shrink: 0; padding: 7px 14px; border-radius: 999px; font-size: .875rem; text-decoration: none;
    border: 1px solid var(--sf-line); background: var(--sf-surface); color: var(--sf-ink); text-transform: capitalize;
}
.sf-chip:hover { border-color: var(--sf-brand); color: var(--sf-brand-ink); }
.sf-chip.is-active { background: var(--sf-brand); border-color: var(--sf-brand); color: #fff; }
.sf-result-count { font-size: .875rem; color: var(--sf-muted); margin: 4px 0 12px; }

/* Product grid */
.sf-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 32px; }
@media (min-width: 640px) { .sf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 992px) { .sf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }
.sf-card {
    display: flex; flex-direction: column; text-decoration: none; color: inherit;
    background: var(--sf-surface); border: 1px solid var(--sf-line); border-radius: var(--sf-radius); overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.sf-card:hover { border-color: #CFDBB9; box-shadow: 0 6px 20px rgba(29, 35, 24, .07); transform: translateY(-2px); color: inherit; }
.sf-media { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--sf-brand-tint); }
/* Absolute so portrait/landscape sources can't stretch the square box */
.sf-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.sf-media-placeholder {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 2rem; color: var(--sf-brand-ink); opacity: .55;
}
.sf-card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.sf-card-name {
    font-weight: 500; font-size: .95rem; line-height: 1.3; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sf-card-foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.sf-price { font-family: 'Poppins', sans-serif; font-weight: 600; color: var(--sf-ink); font-variant-numeric: tabular-nums; }
.sf-stock { font-size: .75rem; font-weight: 500; padding: 3px 8px; border-radius: 999px; }
.sf-stock--in { background: var(--sf-brand-tint); color: var(--sf-brand-ink); }
.sf-stock--out { background: #FDECEA; color: var(--sf-danger); }
.sf-card.is-out .sf-media img { opacity: .55; }

/* Empty + pagination */
.sf-empty { text-align: center; padding: 64px 16px; color: var(--sf-muted); }
.sf-empty i { font-size: 2rem; color: var(--sf-brand); margin-bottom: 12px; }
.sf-empty h2 { font-size: 1.2rem; }
.sf-pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 0 40px; }
.sf-pager span { color: var(--sf-muted); font-size: .9rem; }

/* Product page */
.sf-product { display: grid; gap: 24px; padding-bottom: 48px; }
@media (min-width: 768px) { .sf-product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; } }
.sf-product-media { border-radius: var(--sf-radius); overflow: hidden; border: 1px solid var(--sf-line); }
.sf-product-media .sf-media-placeholder { font-size: 4rem; }
/* Detail view shows the whole photo; the grid crops to fill */
.sf-product-media img { object-fit: contain; background: var(--sf-surface); }
.sf-product-info { display: flex; flex-direction: column; gap: 14px; }
.sf-category { font-size: .8rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--sf-brand-ink); }
.sf-product-info h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }
.sf-product-price { font-family: 'Poppins', sans-serif; font-size: 1.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.sf-description { color: var(--sf-muted); line-height: 1.6; white-space: pre-line; margin: 0; }
.sf-order { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--sf-radius); background: var(--sf-surface); border: 1px solid var(--sf-line); }
.sf-order p { margin: 0; font-size: .875rem; color: var(--sf-muted); }

/* Footer */
.sf-footer { border-top: 1px solid var(--sf-line); background: var(--sf-surface); padding: 20px 0; font-size: .875rem; color: var(--sf-muted); }
.sf-footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.sf-footer-store { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.sf-footer-store strong { color: var(--sf-ink); font-weight: 500; }
.sf-powered { display: inline-flex; align-items: center; gap: 6px; color: var(--sf-muted); text-decoration: none; }
.sf-powered:hover { color: var(--sf-brand-ink); }

/* Not found */
.sf-notfound { text-align: center; padding: 96px 16px; }
.sf-notfound i { font-size: 2.5rem; color: var(--sf-brand); margin-bottom: 16px; }
.sf-notfound p { color: var(--sf-muted); }

/* Breadcrumbs */
.sf-breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 20px 0 16px; font-size: .875rem; color: var(--sf-muted); }
.sf-intro .sf-breadcrumbs { margin: 0 0 10px; }
.sf-breadcrumbs a { color: var(--sf-muted); text-decoration: none; }
.sf-breadcrumbs a:hover { color: var(--sf-brand-ink); text-decoration: underline; }
.sf-breadcrumbs i { font-size: .65rem; opacity: .6; }
.sf-breadcrumbs [aria-current] { color: var(--sf-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* Same item in other currencies */
.sf-variants { margin: 0; color: var(--sf-muted); font-size: .95rem; }
.sf-variants a { color: var(--sf-brand-ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* Shop directory */
.sf-shop-list { display: grid; gap: 12px; padding-bottom: 32px; }
@media (min-width: 768px) { .sf-shop-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sf-shop-card {
    display: flex; align-items: center; gap: 14px; padding: 16px; text-decoration: none; color: inherit;
    background: var(--sf-surface); border: 1px solid var(--sf-line); border-radius: var(--sf-radius);
    transition: border-color .15s, box-shadow .15s;
}
.sf-shop-card:hover { border-color: #CFDBB9; box-shadow: 0 6px 20px rgba(29, 35, 24, .07); color: inherit; }
.sf-shop-card:focus-visible { outline: 3px solid rgba(138, 179, 62, .45); outline-offset: 2px; }
.sf-shop-logo { width: 56px; height: 56px; border-radius: 12px; object-fit: contain; flex-shrink: 0; background: var(--sf-surface); border: 1px solid var(--sf-line); }
.sf-shop-logo.sf-brand-logo--initial { display: flex; align-items: center; justify-content: center; border: 0; background: var(--sf-brand); font-size: 1.4rem; }
.sf-shop-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.sf-shop-name { font-size: 1.05rem; font-weight: 600; margin: 0; }
.sf-shop-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .825rem; color: var(--sf-muted); }
.sf-shop-description { font-size: .875rem; color: var(--sf-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sf-shop-arrow { color: var(--sf-muted); font-size: .8rem; flex-shrink: 0; }
