/* ============================================================
   USAPets — public design system (vanilla, token-driven)
   Tokens injected from settings table via includes/site.php
   ============================================================ */
:root {
    --ds-color-accent: #3D268B;
    --ds-color-accent-2: #72B892;
    --ds-color-bg: #ffffff;
    --ds-color-surface: #ffffff;
    --ds-color-text: #1f2937;
    --ds-color-muted: #6b7280;
    --ds-color-border: #e5e7eb;
    --ds-radius: 16px;
    --ds-logo-size: 42px;
    --font-display: 'Baloo 2', 'Comic Sans MS', cursive;
    --font-body: 'Inter', system-ui, sans-serif;
    --shadow-sm: 0 2px 10px rgba(36, 22, 64, .07);
    --shadow-md: 0 12px 32px -8px rgba(36, 22, 64, .18);
    --shadow-lg: 0 30px 80px -20px rgba(36, 22, 64, .28);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background:
        radial-gradient(900px 480px at 90% -10%, #ece5fa 0%, transparent 55%),
        radial-gradient(800px 500px at -10% 30%, #e2f2e9 0%, transparent 50%),
        var(--ds-color-bg);
    color: var(--ds-color-text);
    line-height: 1.65;
    min-height: 100vh;
    display: flex; flex-direction: column;
}
img { max-width: 100%; height: auto; }
a { color: var(--ds-color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
code, pre { font-family: 'Consolas', monospace; }

.site-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.site-main { flex: 1; padding: 34px 0 60px; }
.site-main > .site-wrap { padding-top: 0; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 200;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--ds-color-border);
}
.site-header-in { display: flex; align-items: center; gap: 22px; height: 68px; }
.site-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; color: var(--ds-color-text); text-decoration: none; }
.site-logo img { height: var(--ds-logo-size); width: auto; object-fit: contain; }
.site-logo-text { white-space: nowrap; }
.site-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav-link {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 13px; border-radius: 12px;
    font-size: .85rem; font-weight: 600; color: var(--ds-color-muted);
    white-space: nowrap; transition: all .18s;
}
.site-nav-link:hover { background: #efe9fb; color: var(--ds-color-accent); text-decoration: none; }
.site-nav-link.active { background: linear-gradient(135deg, var(--ds-color-accent), var(--ds-color-accent-2)); color: #fff; }
.site-header-actions { display: flex; gap: 8px; align-items: center; }
.site-icon-btn {
    width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--ds-color-border);
    background: var(--ds-color-surface); color: var(--ds-color-text); cursor: pointer; font-size: .95rem;
    display: grid; place-items: center; transition: all .18s;
}
.site-icon-btn:hover { border-color: var(--ds-color-accent); color: var(--ds-color-accent); transform: translateY(-1px); }
.site-burger { display: none; }
.site-searchbar { display: none; border-top: 1px solid var(--ds-color-border); background: #fff; padding: 14px 0; }
.site-searchbar.open { display: block; }
.site-search-form { display: flex; align-items: center; gap: 12px; background: var(--ds-color-bg); border: 1px solid var(--ds-color-border); border-radius: 14px; padding: 6px 6px 6px 16px; }
.site-search-form i { color: var(--ds-color-muted); }
.site-search-form input { flex: 1; border: 0; background: transparent; font: inherit; font-size: .95rem; outline: none; color: var(--ds-color-text); }
.site-btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: .92rem; padding: 10px 20px; border-radius: 12px; border: 0; cursor: pointer; transition: all .18s; text-decoration: none !important; }
.site-btn-primary { background: linear-gradient(135deg, var(--ds-color-accent), var(--ds-color-accent-2)); color: #fff; box-shadow: 0 8px 20px -6px rgba(61,38,139,.4); }
.site-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -6px rgba(61,38,139,.45); }
.site-btn-ghost { background: var(--ds-color-surface); color: var(--ds-color-accent); border: 1px solid var(--ds-color-border); }
.site-btn-ghost:hover { border-color: var(--ds-color-accent); }
.site-btn-sm { padding: 7px 14px; font-size: .8rem; border-radius: 10px; }

/* ---------- Hero ---------- */
.hero {
    position: relative; border-radius: 28px; overflow: hidden;
    background: linear-gradient(120deg, #e6defa 0%, #cfe8d8 55%, #eef0fb 100%);
    padding: 70px 56px; margin-bottom: 44px;
    display: flex; flex-direction: column; justify-content: center;
    box-shadow: var(--shadow-md);
}
.hero::after {
    content: ''; position: absolute; right: -40px; top: -40px; width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(255,255,255,.7), transparent 70%);
}
.hero .paw-deco { position: absolute; font-size: 5rem; color: rgba(255,255,255,.5); transform: rotate(-15deg); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); color: #241640; max-width: 640px; }
.hero p { margin: 16px 0 30px; font-size: 1.08rem; color: #4b5563; max-width: 520px; }
.hero .hero-paws { position: absolute; bottom: 18px; right: 30px; font-size: 2rem; color: rgba(255,255,255,.65); letter-spacing: 10px; }

/* ---------- Sections ---------- */
.section { margin-bottom: 52px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.7rem; color: var(--ds-color-text); display: flex; align-items: center; gap: 12px; }
.section-head h2 i { color: var(--ds-color-accent); }
.section-head .see-all { font-size: .85rem; font-weight: 600; }
.section-sub { color: var(--ds-color-muted); font-size: .9rem; margin-top: 4px; }

/* ---------- Cards & grids ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px; }
.card-grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.card-grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card-grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.ecosystem-grid { grid-template-columns: 1fr !important; }
@media (min-width: 961px) { .ecosystem-grid { grid-template-columns: 1fr 1fr !important; } }
.card {
    background: var(--ds-color-surface); border: 1px solid var(--ds-color-border);
    border-radius: var(--ds-radius); overflow: hidden;
    box-shadow: var(--shadow-sm); transition: transform .22s, box-shadow .22s;
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); text-decoration: none; }
.card-img { aspect-ratio: 16/10; object-fit: cover; width: 100%; background: #f6f7fb; display: block; }
.card-img-ph { aspect-ratio: 16/10; background: linear-gradient(135deg,#efe9fb,#e2f2e9); display: grid; place-items: center; color: #b7a6d9; font-size: 2.2rem; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--ds-color-text); line-height: 1.3; }
.card:hover .card-title { color: var(--ds-color-accent); }
.card-meta { font-size: .78rem; color: var(--ds-color-muted); display: flex; gap: 12px; flex-wrap: wrap; }
.card-meta i { margin-right: 4px; }
.card-excerpt { font-size: .85rem; color: var(--ds-color-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: clamp: 2; overflow: hidden; }
.card-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; padding: 4px 10px; border-radius: 99px; background: #efe9fb; color: var(--ds-color-accent); }
.badge.green { background: #dcfce7; color: #15803d; }
.badge.blue { background: #dbeafe; color: #1d4ed8; }
.badge.amber { background: #fef3c7; color: #b45309; }
.badge.purple { background: #ede9fe; color: #6d28d9; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 15px; border-radius: 99px; border: 1px solid var(--ds-color-border); background: var(--ds-color-surface); font-size: .82rem; font-weight: 600; color: var(--ds-color-muted); transition: all .15s; }
.chip:hover { border-color: var(--ds-color-accent); color: var(--ds-color-accent); text-decoration: none; }
.chip.active { background: var(--ds-color-accent); border-color: var(--ds-color-accent); color: #fff; }

/* ---------- Detail pages ---------- */
.page-head { margin-bottom: 30px; }
.page-head h1 { font-size: 2.2rem; }
.page-head .crumbs { font-size: .82rem; color: var(--ds-color-muted); margin-bottom: 10px; }
.page-head .crumbs a { color: var(--ds-color-muted); }
.detail-hero { border-radius: 24px; overflow: hidden; background: var(--ds-color-surface); border: 1px solid var(--ds-color-border); box-shadow: var(--shadow-sm); margin-bottom: 30px; }
.detail-hero-img { width: 100%; max-height: 420px; object-fit: cover; display: block; }
.detail-body { padding: 30px 34px; }
.prose { font-size: .98rem; line-height: 1.8; }
.prose h2, .prose h3 { margin: 1.4em 0 .5em; }
.prose p { margin-bottom: 1em; }
.prose img { border-radius: 14px; margin: 1em 0; }
.prose ul, .prose ol { margin: 0 0 1em 1.4em; }
.prose blockquote { border-left: 4px solid var(--ds-color-accent); padding: 4px 0 4px 18px; color: var(--ds-color-muted); margin: 1em 0; font-style: italic; }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.stat-pill { background: var(--ds-color-bg); border: 1px solid var(--ds-color-border); border-radius: 12px; padding: 10px 16px; font-size: .82rem; }
.stat-pill b { display: block; font-family: var(--font-display); font-size: 1.05rem; color: var(--ds-color-text); }
.stat-pill span { color: var(--ds-color-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Tables / filters ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; padding: 16px 20px; background: var(--ds-color-surface); border: 1px solid var(--ds-color-border); border-radius: var(--ds-radius); }
.filter-bar input[type=search], .filter-bar select {
    padding: 10px 14px; border-radius: 12px; border: 1px solid var(--ds-color-border);
    font: inherit; font-size: .88rem; background: var(--ds-color-bg); color: var(--ds-color-text); outline: none;
}
.filter-bar input[type=search]:focus, .filter-bar select:focus { border-color: var(--ds-color-accent); }
.filter-bar input[type=search] { flex: 1; min-width: 200px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin: 36px 0 10px; flex-wrap: wrap; }
.pagination a, .pagination span {
    min-width: 40px; height: 40px; padding: 0 12px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--ds-color-border); background: var(--ds-color-surface);
    font-size: .85rem; font-weight: 600; color: var(--ds-color-muted);
}
.pagination a:hover { border-color: var(--ds-color-accent); color: var(--ds-color-accent); text-decoration: none; }
.pagination .current { background: var(--ds-color-accent); border-color: var(--ds-color-accent); color: #fff; }
.pagination .disabled { opacity: .45; }

/* ---------- Empty / misc ---------- */
.empty-state { text-align: center; padding: 70px 20px; color: var(--ds-color-muted); }
.empty-state i { font-size: 3rem; color: #b7a6d9; display: block; margin-bottom: 16px; }
.empty-state h3 { color: var(--ds-color-text); margin-bottom: 8px; }
.notice { padding: 16px 20px; border-radius: 14px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; font-size: .88rem; margin-bottom: 22px; }
.price { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--ds-color-accent); }
.price del { font-size: .9rem; color: var(--ds-color-muted); font-weight: 400; margin-left: 6px; }

/* ---------- Footer ---------- */
.site-footer { background: #241640; color: #cfc4e0; margin-top: auto; }
.site-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr 1fr; gap: 34px; padding: 50px 22px 34px; }
.site-footer-brand { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.site-footer-tag { font-size: .85rem; opacity: .75; max-width: 280px; }
.site-footer h4 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; font-family: var(--font-body); }
.site-footer a { display: block; color: #b3a6cc; font-size: .88rem; padding: 4px 0; }
.site-footer a:hover { color: #fff; }
.site-footer-base { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 22px; font-size: .78rem; opacity: .7; text-align: center; }

/* ---------- Paw skeletons ---------- */
.skel { position: relative; overflow: hidden; background: #efe9fb; border-radius: 10px; min-height: 16px; }
.skel::after { content:''; position:absolute; inset:0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.8), transparent); animation: skelShimmer 1.4s infinite; transform: translateX(-100%); }
@keyframes skelShimmer { to { transform: translateX(100%); } }
.sk-card { background: var(--ds-color-surface); border: 1px solid var(--ds-color-border); border-radius: var(--ds-radius); overflow: hidden; }
.sk-card .skel-img { aspect-ratio: 16/10; }
.sk-card .skel-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Toasts ---------- */
#siteToasts { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 13px 18px; border-radius: 14px; color: #fff; font-size: .85rem; font-weight: 600; box-shadow: var(--shadow-lg); animation: toastIn .25s ease; display: flex; gap: 10px; align-items: center; }
.toast.success { background: #059669; } .toast.error { background: #dc2626; } .toast.info { background: #2563eb; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Verify banner & cookie consent ---------- */
.verify-banner { background: linear-gradient(135deg,#fef3c7,#fde68a); border-bottom: 1px solid #fcd34d; }
.verify-banner-in { display: flex; align-items: center; gap: 12px; padding: 11px 22px; font-size: .86rem; font-weight: 600; color: #92400e; flex-wrap: wrap; }
.verify-banner-in i { color: #d97706; }
.verify-banner-btn { background: #92400e; color: #fff; border: 0; border-radius: 9px; padding: 7px 14px; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.verify-banner-link { color: #92400e; font-weight: 700; margin-left: auto; }

.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9998; padding: 16px 22px; background: rgba(20,16,38,.55); backdrop-filter: blur(6px); }
.cookie-banner-card { max-width: 860px; margin: 0 auto; background: var(--ds-color-surface); border-radius: 18px; padding: 20px 24px; box-shadow: var(--shadow-lg); border: 1px solid var(--ds-color-border); }
.cookie-banner-head { display: flex; align-items: center; gap: 10px; font-size: .98rem; color: var(--ds-color-text); }
.cookie-banner-head i { color: var(--ds-color-accent); font-size: 1.2rem; }
.cookie-banner-text { margin: 8px 0 14px; font-size: .85rem; color: var(--ds-color-muted); }
.cookie-banner-text a { color: var(--ds-color-accent); font-weight: 600; }
.cookie-banner-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-banner-custom { margin-top: 14px; border-top: 1px solid var(--ds-color-border); padding-top: 12px; }
.cookie-toggle { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: .87rem; color: var(--ds-color-text); cursor: pointer; }
.cookie-toggle input { accent-color: var(--ds-color-accent); width: 16px; height: 16px; }
.cookie-toggle small { color: var(--ds-color-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .site-nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 14px 22px; border-bottom: 1px solid var(--ds-color-border); box-shadow: var(--shadow-md); }
    .site-nav.open { display: flex; }
    .site-nav-link { padding: 12px 14px; }
    .site-burger { display: grid; }
    .site-footer-grid { grid-template-columns: 1fr 1fr; }
    .hero { padding: 44px 30px; }
    .pet-detail-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 560px) {
    .site-footer-grid { grid-template-columns: 1fr; }
    .card-grid, .card-grid.cols-2, .card-grid.cols-3, .card-grid.cols-4 { grid-template-columns: 1fr; }
    .detail-body { padding: 22px 20px; }
    .page-head h1 { font-size: 1.7rem; }
}
