/*
 * DynoMart — Global CSS
 * assets/css/app.css
 *
 * Loaded after Tailwind CDN. Adds:
 *  - CSS variable theming (overridden at runtime from site_settings)
 *  - Prose content styles for CMS pages
 *  - Print styles
 *  - Accessibility helpers
 */

/* ── Root vars (values injected by header.php via <style> block) ── */
:root {
    --color-primary:   #FF6B35;
    --color-secondary: #2D3748;
    --color-accent:    #FED330;
    --font-primary:    'Inter', sans-serif;
    --font-heading:    'Poppins', sans-serif;
    --radius-card:     16px;
    --shadow-card:     0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
}

/* ── Smooth scrolling ── */
html { scroll-behavior: smooth; }

/* ── Focus rings ── */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ── Prose (CMS pages, product descriptions) ── */
.prose { color: #374151; line-height: 1.75; }
.prose h1,.prose h2,.prose h3 { font-family: var(--font-heading); font-weight: 700; color: #111827; margin-top: 1.5em; margin-bottom: .5em; }
.prose h1 { font-size: 2rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }
.prose p  { margin-bottom: 1em; }
.prose ul,.prose ol { padding-left: 1.5em; margin-bottom: 1em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: .25em; }
.prose a  { color: var(--color-primary); text-decoration: underline; }
.prose a:hover { opacity: .8; }
.prose blockquote { border-left: 4px solid var(--color-primary); padding-left: 1rem; margin: 1.5em 0; color: #6b7280; font-style: italic; }
.prose img { border-radius: 12px; max-width: 100%; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
.prose th { background: #f9fafb; font-weight: 600; text-align: left; padding: .75rem 1rem; border-bottom: 2px solid #e5e7eb; }
.prose td { padding: .75rem 1rem; border-bottom: 1px solid #f3f4f6; }
.prose code { background: #f3f4f6; padding: .2em .4em; border-radius: 4px; font-size: .875em; font-family: monospace; }
.prose pre  { background: #1e293b; color: #e2e8f0; padding: 1.25rem; border-radius: 12px; overflow-x: auto; }
.prose pre code { background: transparent; padding: 0; }
.prose hr   { border: none; border-top: 1px solid #e5e7eb; margin: 2em 0; }

/* ── Line clamp utilities ── */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Loading spinner ── */
.spinner {
    width: 20px; height: 20px;
    border: 2.5px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}
.spinner.dark { border-color: rgba(0,0,0,.15); border-top-color: var(--color-primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Skeleton loading ── */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Sticky cart button (mobile) ── */
@media (max-width: 768px) {
    .sticky-checkout { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; padding: 12px 16px; background: #fff; border-top: 1px solid #e5e7eb; }
}

/* ── Chat bubbles ── */
.chat-bubble-mine    { background: var(--color-primary); color: #fff; border-radius: 18px 18px 4px 18px; }
.chat-bubble-theirs  { background: #f1f5f9; color: #1e293b; border-radius: 18px 18px 18px 4px; }

/* ── Rating stars interactive ── */
.star-rating-input span { cursor: pointer; font-size: 1.5rem; color: #d1d5db; transition: color .15s; }
.star-rating-input span:hover,
.star-rating-input span.active { color: #f59e0b; }

/* ── Print ── */
@media print {
    header, footer, nav, aside, .no-print { display: none !important; }
    body { font-size: 12pt; color: #000; background: #fff; }
    a { color: #000; text-decoration: none; }
    .card { border: 1px solid #ccc; box-shadow: none; }
}

/* ── Reduce motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
