/* SBSHOP - Core Design System */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; max-width: 100%; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

/* ---------- Premium page-to-page transitions (native browser API, no JS/library) ---------- */
@view-transition {
    navigation: auto;
}
@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 480px) { .container { padding: 0 14px; } }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14.5px;
    border: 1px solid transparent; cursor: pointer;
    transition: background-color .2s cubic-bezier(.4,0,.2,1), border-color .2s cubic-bezier(.4,0,.2,1),
                color .2s cubic-bezier(.4,0,.2,1), transform .15s cubic-bezier(.4,0,.2,1), box-shadow .2s cubic-bezier(.4,0,.2,1);
}
.btn-primary { background: var(--button); color: #fff; }
.btn-primary:hover { background: var(--button-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn:active:not(:disabled) { transform: scale(0.97); transition-duration: .08s; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
@media (max-width: 640px) {
    .btn-sm { padding: 10px 14px; min-height: 38px; } /* keep touch targets comfortable on mobile */
}
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
@media (prefers-reduced-motion: reduce) {
    .btn { transition: none; }
    .btn:active:not(:disabled) { transform: none; }
}

/* ---------- Navbar ---------- */
.navbar { background: var(--navbar); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; transition: box-shadow .25s ease, background-color .25s ease; }
.navbar.navbar-scrolled { box-shadow: 0 4px 20px rgba(15,23,42,.08); }
.navbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 10px; }
.navbar-logo { font-weight: 800; font-size: 20px; letter-spacing: -0.5px; color: var(--primary); overflow: hidden; text-overflow: ellipsis; }

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(135deg, var(--surface) 0%, var(--background) 100%);
    padding: 72px 0 56px; position: relative; overflow: hidden;
}
@media (max-width: 640px) { .hero { padding: 40px 0 32px; } }
.hero-glow { position: absolute; width: 480px; height: 480px; border-radius: 50%;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%); opacity: .18;
    top: -180px; right: -120px; pointer-events: none; }
.hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -1px; margin: 0 0 16px; max-width: 640px; }
.hero p.lead { font-size: 17px; color: var(--muted); max-width: 560px; margin: 0 0 28px; }
.hero-ctas { display: flex; gap: 14px; margin-bottom: 36px; }
.trust-row { display: flex; gap: 28px; flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
@media (max-width: 640px) { .hero h1 { font-size: 30px; } }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); transition: box-shadow .25s cubic-bezier(.4,0,.2,1), transform .25s cubic-bezier(.4,0,.2,1); }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
@media (hover: none) {
    .card:hover { transform: none; } /* avoid "stuck hover" look on touch devices after tapping */
}

.category-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
@media (max-width: 960px) { .category-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .category-grid { grid-template-columns: repeat(2, 1fr); } }

.category-card { text-align: center; padding: 26px 16px; cursor: pointer; }
.category-icon { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 22px; font-weight: 700; }
.category-card h3 { margin: 0; font-size: 15px; }

.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 960px) { .service-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .service-grid { grid-template-columns: 1fr; } }

.service-card { display: flex; flex-direction: column; gap: 10px; }
.service-card .badge-row { display: flex; gap: 6px; flex-wrap: wrap; }
.service-card .card-actions { display:flex; align-items:center; justify-content:space-between; margin-top:8px; gap:8px; }
.service-card .card-actions .action-btns { display:flex; gap:6px; }
@media (max-width: 360px) {
    .service-card .card-actions { flex-direction: column; align-items: stretch; }
    .service-card .card-actions .action-btns { width: 100%; }
    .service-card .card-actions .action-btns .btn { flex: 1; }
}
.service-card h3 { margin: 4px 0; font-size: 16.5px; }
.service-card p.desc { color: var(--muted); font-size: 13.5px; margin: 0; flex: 1; }
.service-price { font-size: 20px; font-weight: 800; color: var(--primary); }
.service-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge-primary { background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); }
.badge-success { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.badge-warning { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.badge-danger { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.badge-muted { background: var(--border); color: var(--muted); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.form-control {
    width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font-size: 14.5px;
    transition: border-color .18s cubic-bezier(.4,0,.2,1), box-shadow .18s cubic-bezier(.4,0,.2,1);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
select.form-control { cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
    .form-control { transition: none; }
}

/* ---------- Alerts ---------- */
.alert {
    padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; border: 1px solid transparent;
    animation: alertIn .3s cubic-bezier(.4,0,.2,1);
}
@keyframes alertIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .alert { animation: none; } }
.alert-success { background: color-mix(in srgb, var(--success) 12%, var(--surface)); color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.alert-danger { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-warning { background: color-mix(in srgb, var(--warning) 15%, var(--surface)); color: #92620a; border-color: color-mix(in srgb, var(--warning) 35%, transparent); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; scroll-margin-top: 84px; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 36px; }
.section-head h2 { font-size: 30px; font-weight: 800; margin: 0 0 10px; letter-spacing: -0.5px; }
.section-head p { color: var(--muted); margin: 0; }

.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 860px) { .why-grid { grid-template-columns: repeat(2, 1fr); } }
.why-item { text-align: center; padding: 24px; }
.why-icon { width: 46px; height: 46px; border-radius: 12px; background: color-mix(in srgb, var(--primary) 12%, transparent);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; color: var(--primary); font-size: 20px; }

.steps-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
@media (max-width: 860px) { .steps-row { grid-template-columns: repeat(2, 1fr); } }
.step-item { position: relative; padding: 24px; }
.step-num { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: flex;
    align-items: center; justify-content: center; font-weight: 800; margin-bottom: 12px; }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q { padding: 18px 4px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 600; font-size: 15px; }
.faq-a-wrap { display: grid; grid-template-rows: 0fr; overflow: hidden; transition: grid-template-rows .3s cubic-bezier(.4,0,.2,1); }
.faq-a { overflow: hidden; color: var(--muted); font-size: 14px; min-height: 0; }
.faq-item.open .faq-a-wrap { grid-template-rows: 1fr; }
.faq-item.open .faq-a { padding-bottom: 18px; }
.faq-item.open .faq-toggle { transform: rotate(45deg); }
.faq-toggle { transition: transform .2s cubic-bezier(.4,0,.2,1); font-size: 20px; color: var(--primary); }
@media (prefers-reduced-motion: reduce) {
    .faq-a-wrap { transition: none; }
    .faq-toggle { transition: none; }
}

/* ---------- Footer ---------- */
.footer { background: var(--footer); color: #cbd5e1; padding: 48px 0 24px; margin-top: 40px; }
.footer h4 { color: #fff; font-size: 15px; margin: 0 0 14px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer a { color: #94a3b8; font-size: 13.5px; display: block; margin-bottom: 8px; }
.footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1e293b; margin-top: 30px; padding-top: 20px; font-size: 12.5px; color: #64748b; text-align: center; }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px; opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .2s cubic-bezier(.4,0,.2,1), visibility .2s;
}
.modal-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }
.modal-box {
    background: var(--surface); border-radius: var(--radius); max-width: 480px; width: 100%; padding: 28px;
    max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
    transform: translateY(14px) scale(.98); transition: transform .22s cubic-bezier(.4,0,.2,1);
}
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }
@media (prefers-reduced-motion: reduce) {
    .modal-overlay, .modal-box { transition: opacity .01s, visibility .01s; }
}
@media (max-width: 480px) {
    .modal-overlay { padding: 12px; }
    .modal-box { padding: 20px; border-radius: 16px; }
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px; border-bottom: 1px solid var(--border); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* ---------- Dashboard layout ---------- */
.dash-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
.dash-sidebar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; position: sticky; top: 90px; }
.dash-sidebar a { display: block; padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 2px; }
.dash-sidebar a.active, .dash-sidebar a:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
@media (max-width: 860px) {
    .dash-layout { grid-template-columns: 1fr; }
    .dash-sidebar { position: static; top: auto; } /* must come after the base rule above, or the cascade silently keeps it sticky on mobile */
}

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 860px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { padding: 20px; }
.stat-card .label { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .value { font-size: 28px; font-weight: 800; margin-top: 6px; }

/* ---------- Empty / loading states ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.spinner { width: 20px; height: 20px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Scroll-reveal (subtle fade-in / slide-up) ---------- */
@media (prefers-reduced-motion: no-preference) {
    .reveal-init { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; will-change: opacity, transform; }
    .reveal-init.reveal-in { opacity: 1; transform: translateY(0); }
}

/* ---------- Back to Top button ---------- */
.back-to-top {
    position: fixed; bottom: 22px; left: 22px; width: 46px; height: 46px; border-radius: 50%;
    background: var(--primary); color: #fff; border: none; font-size: 19px; line-height: 1; cursor: pointer;
    box-shadow: 0 10px 26px rgba(0,0,0,.2); z-index: 200; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s, background .2s ease;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--button-hover); }
@media (max-width: 480px) { .back-to-top { bottom: 16px; left: 16px; width: 42px; height: 42px; font-size: 17px; } }
@media (prefers-reduced-motion: reduce) {
    .back-to-top { transition: opacity .01s, visibility .01s; }
}
