/* =========================================================
   Kirana Store — main.css
   Mobile-first base styles.
   Loaded before responsive.css.

   Sections:
     1. Design tokens (:root)
     2. Reset & base
     3. Accessibility
     4. Layout containers
     5. Header (mobile + shared)
     6. Hamburger button
     7. Cart badge
     8. Mobile drawer (off-canvas)
     9. Demo-mode notice
    10. Hero
    11. How-it-works
    12. Featured products
    13. Notices
    14. Generic content (post cards, site-main)
    15. Buttons
    16. Footer
    17. Reduced-motion
   ========================================================= */

/* =========================================================
   1. Design tokens
   =======================================================*/
:root {
    --ks-primary:     #0a7d3e;
    --ks-primary-dk:  #075c2d;
    --ks-primary-lt:  #e6f4ec;
    --ks-accent:      #f59e0b;
    --ks-accent-dk:   #d97706;
    --ks-danger:      #dc2626;
    --ks-success:     #16a34a;
    --ks-whatsapp:    #25D366;

    --ks-text:        #1f2937;
    --ks-text-inv:    #ffffff;
    --ks-muted:       #6b7280;

    --ks-bg:          #ffffff;
    --ks-bg-alt:      #f9fafb;
    --ks-border:      #e5e7eb;
    --ks-border-dk:   #d1d5db;

    --ks-radius-sm:   6px;
    --ks-radius:      8px;
    --ks-radius-lg:   14px;

    --ks-shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --ks-shadow-lg:   0 8px 24px rgba(0,0,0,.15);

    --ks-header-h:    60px;
    --ks-touch:       44px;

    --ks-z-header:    100;
    --ks-z-backdrop:  190;
    --ks-z-drawer:    200;
    --ks-z-toast:     1000;

    --ks-transition:  0.25s cubic-bezier(.2,.8,.2,1);
}

/* =========================================================
   2. Reset & base
   =======================================================*/
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--ks-text);
    background: var(--ks-bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scroll lock while drawer is open.
   JS sets `body.style.top = '-<scrollY>px'` then adds this class;
   on close it removes the class and clears inline `top`. */
body.ks-menu-open {
    position: fixed;
    width: 100%;
    overflow: hidden;
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--ks-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
a:hover { color: var(--ks-primary-dk); }

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5em;
    line-height: 1.25;
    color: var(--ks-text);
}

p { margin: 0 0 1em; }

ul, ol { padding-left: 1.25rem; }

/* =========================================================
   3. Accessibility
   =======================================================*/
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link:focus {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: var(--ks-z-toast);
    width: auto;
    height: auto;
    padding: 10px 18px;
    margin: 0;
    clip: auto;
    clip-path: none;
    background: var(--ks-primary);
    color: #fff;
    border-radius: var(--ks-radius);
    text-decoration: none;
    font-weight: 600;
    white-space: normal;
}

:focus-visible {
    outline: 3px solid var(--ks-accent);
    outline-offset: 2px;
}

/* =========================================================
   4. Layout containers
   =======================================================*/
.container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 16px;
}

/* =========================================================
   5. Header (mobile + shared)
   =======================================================*/
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--ks-z-header);
    background: #fff;
    border-bottom: 1px solid var(--ks-border);
    box-shadow: var(--ks-shadow);
    padding-top: env(safe-area-inset-top, 0px);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--ks-header-h);
    padding-block: 8px;
}

.site-branding {
    flex: 1 1 auto;
    min-width: 0;              /* allow ellipsis inside flex child */
    text-align: center;
}

.site-title {
    display: inline-block;
    max-width: 100%;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ks-primary-dk);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.custom-logo {
    display: inline-block;
    max-height: 40px;
    width: auto;
}

/* Desktop-only elements hidden by default (mobile-first) */
.desktop-only { display: none !important; }

/* =========================================================
   6. Hamburger button
   =======================================================*/
.ks-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--ks-touch);
    height: var(--ks-touch);
    padding: 0;
    background: transparent;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.ks-menu-toggle:hover {
    background: var(--ks-bg-alt);
}

.ks-hamburger {
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
}

.ks-hamburger__line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--ks-text);
    border-radius: 2px;
    transition: transform var(--ks-transition), opacity 0.2s ease;
}

/* Morph to X when open */
.ks-menu-toggle[aria-expanded="true"] .ks-hamburger__line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.ks-menu-toggle[aria-expanded="true"] .ks-hamburger__line:nth-child(2) {
    opacity: 0;
}
.ks-menu-toggle[aria-expanded="true"] .ks-hamburger__line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =========================================================
   7. Cart badge
   =======================================================*/
.header-cart {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--ks-touch);
    height: var(--ks-touch);
    color: var(--ks-text);
    text-decoration: none;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.header-cart:hover { color: var(--ks-primary); }

.header-cart__icon {
    font-size: 1.35rem;
    line-height: 1;
}

.header-cart__count {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--ks-accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-cart:not(.has-items) .header-cart__count {
    /* Hide when zero — JS toggles .has-items */
    opacity: 0.55;
}

/* =========================================================
   8. Mobile drawer (off-canvas)
   =======================================================*/
.ks-mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--ks-z-backdrop);
    opacity: 0;
    transition: opacity var(--ks-transition);
}
.ks-mobile-backdrop.is-visible { opacity: 1; }

.ks-mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(85vw, 340px);
    max-width: 100%;
    background: #fff;
    z-index: var(--ks-z-drawer);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.2, .8, .2, 1);
    box-shadow: var(--ks-shadow-lg);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.ks-mobile-drawer.is-open {
    transform: translateX(0);
}

/* Drawer header (close button row) */
.ks-drawer__header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 12px;
    border-bottom: 1px solid var(--ks-border);
    flex-shrink: 0;
}

.ks-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--ks-touch);
    height: var(--ks-touch);
    padding: 0;
    background: transparent;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.ks-drawer__close:hover {
    background: var(--ks-bg-alt);
}

/* Drawer search */
.ks-drawer__search {
    display: flex;
    gap: 6px;
    padding: 12px;
    border-bottom: 1px solid var(--ks-border);
    flex-shrink: 0;
}

.ks-drawer__search input {
    flex: 1 1 auto;
    min-width: 0;
    height: var(--ks-touch);
    padding: 0 12px;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    font-size: 1rem;
}

.ks-drawer__search input:focus {
    outline: none;
    border-color: var(--ks-primary);
    box-shadow: 0 0 0 3px rgba(10, 125, 62, .15);
}

.ks-drawer__search button {
    flex-shrink: 0;
    min-width: var(--ks-touch);
    height: var(--ks-touch);
    padding: 0 14px;
    background: var(--ks-primary);
    color: #fff;
    border: none;
    border-radius: var(--ks-radius);
    font-weight: 600;
    cursor: pointer;
}

.ks-drawer__search button:hover {
    background: var(--ks-primary-dk);
}

/* Drawer nav */
.ks-drawer__nav {
    padding: 8px 0;
    flex: 1 1 auto;
}

.mobile-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu li {
    border-bottom: 1px solid var(--ks-border);
}
.mobile-menu li:last-child {
    border-bottom: none;
}

.mobile-menu a {
    display: block;
    padding: 14px 16px;
    min-height: var(--ks-touch);
    color: var(--ks-text);
    text-decoration: none;
    font-size: 1rem;
}

.mobile-menu a:hover,
.mobile-menu a:focus {
    background: var(--ks-bg-alt);
    color: var(--ks-primary);
}

.mobile-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 0 16px;
    background: var(--ks-bg-alt);
    border-top: 1px solid var(--ks-border);
}

.mobile-menu .sub-menu a {
    padding: 10px 16px;
    font-size: 0.95rem;
}

/* Drawer WhatsApp CTA */
.ks-drawer__wa {
    display: block;
    margin: 12px;
    padding: 12px 16px;
    background: var(--ks-whatsapp);
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: var(--ks-radius);
    font-weight: 600;
    min-height: var(--ks-touch);
    line-height: 1.2;
    flex-shrink: 0;
}

.ks-drawer__wa:hover {
    background: #1eb857;
    color: #fff;
}

/* =========================================================
   9. Demo-mode notice
   =======================================================*/
.ks-demo-notice {
    background: #fef3c7;
    color: #92400e;
    text-align: center;
    padding: 10px 16px;
    font-weight: 600;
    border-bottom: 1px solid #fcd34d;
    font-size: 0.95rem;
}

/* =========================================================
   10. Hero
   =======================================================*/
.ks-hero {
    background: linear-gradient(135deg, var(--ks-primary) 0%, var(--ks-primary-dk) 100%);
    color: #fff;
    padding: 48px 0;
    text-align: center;
}

.ks-hero__title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin: 0 0 12px;
    color: #fff;
}

.ks-hero__sub {
    font-size: 1.1rem;
    margin: 0 0 24px;
    opacity: 0.9;
    color: #fff;
}

/* =========================================================
   11. How-it-works section
   =======================================================*/
.ks-how-it-works {
    padding: 40px 16px;
}

.ks-how-it-works h2 {
    text-align: center;
    margin-bottom: 24px;
}

.ks-steps {
    max-width: 640px;
    margin: 0 auto;
    padding-left: 20px;
    counter-reset: ks-step;
    list-style: none;
}

.ks-steps li {
    position: relative;
    padding-left: 44px;
    margin-bottom: 16px;
    counter-increment: ks-step;
    line-height: 1.4;
}

.ks-steps li::before {
    content: counter(ks-step);
    position: absolute;
    left: 0;
    top: -2px;
    width: 32px;
    height: 32px;
    background: var(--ks-primary);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

/* =========================================================
   12. Featured products
   =======================================================*/
.ks-featured {
    padding: 40px 16px;
    background: var(--ks-bg-alt);
}

.ks-featured h2 {
    text-align: center;
    margin-bottom: 24px;
}

/* Placeholder grid used by plugin hook ks_render_featured_products() */
.ks-product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 640px) {
    .ks-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .ks-product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.ks-product-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    overflow: hidden;
    transition: box-shadow var(--ks-transition), transform var(--ks-transition);
}

.ks-product-card:hover {
    box-shadow: var(--ks-shadow-lg);
    transform: translateY(-2px);
}

.ks-product-card__image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--ks-bg-alt);
}

.ks-product-card__body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 6px;
}

.ks-product-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ks-product-card__price {
    font-weight: 700;
    color: var(--ks-primary-dk);
    font-size: 1rem;
}

.ks-product-card__price small {
    font-weight: 400;
    color: var(--ks-muted);
    font-size: 0.8rem;
}

/* =========================================================
   13. Notices
   =======================================================*/
.ks-notice {
    padding: 12px 16px;
    background: var(--ks-bg-alt);
    border: 1px solid var(--ks-border);
    border-left: 4px solid var(--ks-accent);
    border-radius: var(--ks-radius);
    color: var(--ks-muted);
    margin: 0 0 16px;
}

/* =========================================================
   14. Generic content
   =======================================================*/
.site-main {
    padding: 24px 16px;
}

.post-list {
    display: grid;
    gap: 16px;
}

.post-card {
    padding: 16px;
    background: #fff;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
}

.post-card__title {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.post-card__title a {
    color: var(--ks-text);
    text-decoration: none;
}

.post-card__title a:hover {
    color: var(--ks-primary);
}

.post-card__excerpt > p:last-child { margin-bottom: 0; }

/* Pagination */
.pagination,
.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 24px 0;
}

.pagination .page-numbers,
.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--ks-touch);
    height: var(--ks-touch);
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    color: var(--ks-text);
    text-decoration: none;
    font-weight: 600;
}

.pagination .page-numbers.current,
.nav-links .page-numbers.current {
    background: var(--ks-primary);
    color: #fff;
    border-color: var(--ks-primary);
}

.pagination a.page-numbers:hover,
.nav-links a.page-numbers:hover {
    background: var(--ks-bg-alt);
    color: var(--ks-primary);
}

/* =========================================================
   15. Buttons
   =======================================================*/
.ks-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--ks-touch);
    padding: 12px 24px;
    border: none;
    border-radius: var(--ks-radius);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--ks-transition), color var(--ks-transition),
                transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.ks-btn:active { transform: translateY(1px); }

.ks-btn--primary {
    background: var(--ks-accent);
    color: #fff;
}
.ks-btn--primary:hover {
    background: var(--ks-accent-dk);
    color: #fff;
}

.ks-btn--secondary {
    background: var(--ks-primary);
    color: #fff;
}
.ks-btn--secondary:hover {
    background: var(--ks-primary-dk);
    color: #fff;
}

.ks-btn--ghost {
    background: transparent;
    color: var(--ks-primary);
    border: 1px solid var(--ks-primary);
}
.ks-btn--ghost:hover {
    background: var(--ks-primary-lt);
}

.ks-btn--block { width: 100%; }

/* =========================================================
   16. Footer
   =======================================================*/
.site-footer {
    margin-top: 40px;
    background: var(--ks-bg-alt);
    border-top: 1px solid var(--ks-border);
    padding: 32px 0 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

.footer-inner {
    display: grid;
    gap: 24px;
}

.footer-heading {
    margin: 0 0 8px;
    font-size: 1rem;
    color: var(--ks-primary-dk);
}

.footer-tagline {
    margin: 0;
    color: var(--ks-muted);
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu li {
    margin-bottom: 6px;
}

.footer-menu a {
    color: var(--ks-text);
    text-decoration: none;
}

.footer-menu a:hover {
    color: var(--ks-primary);
}

.footer-copy {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--ks-border);
    color: var(--ks-muted);
    font-size: 0.875rem;
    text-align: center;
}

/* =========================================================
   17. Reduced motion
   =======================================================*/
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
/* =========================================================
   Footer — extended
   =======================================================*/
.footer-col {
    min-width: 0;
}

.footer-col--brand .footer-heading--brand {
    margin: 0 0 8px;
    font-size: 1.15rem;
}

.footer-col--brand .footer-heading--brand a {
    color: var(--ks-primary-dk);
    text-decoration: none;
}

.footer-logo img {
    max-height: 44px;
    width: auto;
    margin-bottom: 8px;
}

.footer-empty {
    color: var(--ks-muted);
    font-size: 0.9rem;
    margin: 0;
    font-style: italic;
}

/* Socials */
.footer-socials {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-socials__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius-sm);
    font-size: 0.85rem;
    color: var(--ks-text);
    text-decoration: none;
}

.footer-socials__link:hover {
    border-color: var(--ks-primary);
    color: var(--ks-primary);
}

/* Contact list */
.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact__item {
    margin-bottom: 10px;
    font-size: 0.92rem;
    line-height: 1.4;
}

.footer-contact__label {
    display: block;
    color: var(--ks-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
}

.footer-contact__value {
    color: var(--ks-text);
    text-decoration: none;
    word-break: break-word;
}

a.footer-contact__value:hover {
    color: var(--ks-primary);
    text-decoration: underline;
}

.footer-contact__wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 16px;
    background: var(--ks-whatsapp);
    color: #fff;
    border-radius: var(--ks-radius);
    font-weight: 600;
}

.footer-contact__wa:hover {
    background: #1eb857;
    color: #fff;
    text-decoration: none;
}

/* Bottom bar */
.footer-bottom {
    margin-top: 24px;
    border-top: 1px solid var(--ks-border);
    background: #fff;
}

.footer-bottom__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-block: 14px;
    flex-wrap: wrap;
}

.footer-bottom .footer-copy {
    margin: 0;
    padding: 0;
    border: none;
    text-align: left;
    font-size: 0.85rem;
    color: var(--ks-muted);
}

.footer-backtotop {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    color: var(--ks-text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 40px;
}

.footer-backtotop:hover {
    background: var(--ks-bg-alt);
    color: var(--ks-primary);
}

.footer-backtotop__text {
    /* Hide text on very narrow screens */
}

@media (max-width: 359px) {
    .footer-backtotop__text { display: none; }
    .footer-bottom__inner { justify-content: center; }
    .footer-bottom .footer-copy { text-align: center; width: 100%; }
}

/* Responsive column layout lives in responsive.css */
/* ---------- ≥ 768px (tablet) ---------- */
@media (min-width: 768px) {
    :root { --ks-header-h: 68px; }
    .site-main { padding: 32px 24px; }
    .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
}

/* ---------- ≥ 1024px (desktop) ---------- */
@media (min-width: 1024px) {
    /* ... existing desktop rules ... */
    .footer-inner { grid-template-columns: 2fr 1fr 1fr 1.2fr; }
}
/* =========================================================
   Mobile drawer — utility rows, cart, contact strip
   =======================================================*/

/* Utility block (cart row) sits directly under the primary menu */
.mobile-menu--utility {
    margin-top: 8px;
    border-top: 1px solid var(--ks-border);
}

.mobile-menu__cart a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    min-height: var(--ks-touch);
    color: var(--ks-text);
    text-decoration: none;
    font-weight: 600;
}

.mobile-menu__cart a:hover,
.mobile-menu__cart a:focus {
    background: var(--ks-bg-alt);
    color: var(--ks-primary);
}

.mobile-menu__cart-label {
    flex: 1 1 auto;
}

.mobile-menu__cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: var(--ks-accent);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 12px;
    line-height: 1;
}

/* Bottom contact strip */
.ks-drawer__contact {
    margin-top: auto;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--ks-border);
    background: var(--ks-bg-alt);
    flex-shrink: 0;
}

.ks-drawer__contact-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-size: 0.9rem;
    color: var(--ks-text);
    text-decoration: none;
}

.ks-drawer__contact-line:last-child {
    margin-bottom: 0;
}

a.ks-drawer__contact-line:hover {
    color: var(--ks-primary);
    text-decoration: underline;
}

.ks-drawer__contact-line--hours {
    color: var(--ks-muted);
}
/* =========================================================
   404 page
   =======================================================*/
.site-main--404 {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-block: 40px 64px;
}

.ks-404 {
    width: 100%;
    max-width: 640px;
    margin-inline: auto;
    text-align: center;
}

.ks-404__code {
    font-size: clamp(4rem, 18vw, 7rem);
    font-weight: 800;
    line-height: 1;
    margin: 0 0 8px;
    color: var(--ks-primary-lt);
    letter-spacing: -0.03em;
    user-select: none;
}

.ks-404__title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin: 0 0 12px;
    color: var(--ks-text);
}

.ks-404__message,
.ks-404__sub {
    color: var(--ks-muted);
    margin: 0 0 12px;
    line-height: 1.55;
}

.ks-404__sub {
    margin-bottom: 24px;
}

/* Search form */
.ks-404__search {
    display: flex;
    gap: 8px;
    margin: 0 auto 28px;
    max-width: 480px;
}

.ks-404__search input {
    flex: 1 1 auto;
    min-width: 0;
    height: var(--ks-touch);
    padding: 0 14px;
    border: 1px solid var(--ks-border-dk);
    border-radius: var(--ks-radius);
    font-size: 1rem;
}

.ks-404__search input:focus {
    outline: none;
    border-color: var(--ks-primary);
    box-shadow: 0 0 0 3px rgba(10, 125, 62, .15);
}

.ks-404__search button {
    flex-shrink: 0;
    min-height: var(--ks-touch);
}

/* Quick links */
.ks-404__links {
    margin-bottom: 32px;
}

.ks-404__links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.ks-404__links li {
    display: inline-block;
}

/* Featured section */
.ks-404__featured {
    margin-top: 40px;
    text-align: left;
}

.ks-404__featured-title {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.25rem;
}

/* Very narrow screens */
@media (max-width: 359px) {
    .ks-404__search {
        flex-direction: column;
    }
    .ks-404__search button {
        width: 100%;
    }
    .ks-404__links ul {
        flex-direction: column;
    }
    .ks-404__links li {
        display: block;
    }
    .ks-404__links .ks-btn {
        width: 100%;
    }
}
/* =========================================================
   Archive
   =======================================================*/
.archive-header {
    margin: 0 0 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--ks-border);
}

.archive-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin: 0 0 8px;
    color: var(--ks-text);
}

.archive-title .page-title,
.archive-title .entry-title {
    font: inherit;
    color: inherit;
}

.archive-description {
    color: var(--ks-muted);
    line-height: 1.6;
    margin: 0 0 8px;
}

.archive-description > *:last-child {
    margin-bottom: 0;
}

.archive-count {
    margin: 0;
    color: var(--ks-muted);
    font-size: 0.9rem;
}

.breadcrumbs {
    font-size: 0.85rem;
    color: var(--ks-muted);
    margin-bottom: 10px;
}

.breadcrumbs a {
    color: var(--ks-muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--ks-primary);
    text-decoration: underline;
}

/* Grid */
.archive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .archive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .archive-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px;
    }
}

/* Card */
.archive-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    background: #fff;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    transition: box-shadow var(--ks-transition);
}

.archive-card:hover {
    box-shadow: var(--ks-shadow-lg);
}

.archive-card__thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--ks-bg-alt);
}

.archive-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.archive-card:hover .archive-card__img {
    transform: scale(1.03);
}

.archive-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px 18px;
    flex: 1 1 auto;
}

.archive-card__title {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.35;
}

.archive-card__title a {
    color: var(--ks-text);
    text-decoration: none;
}

.archive-card__title a:hover {
    color: var(--ks-primary);
}

.archive-card__meta {
    font-size: 0.85rem;
    color: var(--ks-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.archive-card__meta-sep {
    opacity: 0.6;
}

.archive-card__excerpt {
    color: var(--ks-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.archive-card__excerpt > p:last-child {
    margin-bottom: 0;
}

.archive-card__more {
    margin-top: auto;
    align-self: flex-start;
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.9rem;
}

/* Empty state */
.archive-empty {
    text-align: center;
    padding: 40px 16px;
    max-width: 480px;
    margin: 0 auto;
}

.archive-empty h2 {
    font-size: 1.35rem;
    margin: 0 0 12px;
}

.archive-empty p {
    color: var(--ks-muted);
    margin-bottom: 20px;
}

.archive-empty__search {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.archive-empty__search input {
    flex: 1 1 auto;
    min-width: 0;
    height: var(--ks-touch);
    padding: 0 14px;
    border: 1px solid var(--ks-border-dk);
    border-radius: var(--ks-radius);
    font-size: 1rem;
}

.archive-empty__search input:focus {
    outline: none;
    border-color: var(--ks-primary);
    box-shadow: 0 0 0 3px rgba(10, 125, 62, .15);
}

@media (max-width: 359px) {
    .archive-empty__search {
        flex-direction: column;
    }
    .archive-empty__search button {
        width: 100%;
    }
}
/* =========================================================
   Front page — full
   =======================================================*/

.site-main--front { padding: 0; }

/* ---- Buttons: extras ---- */
.ks-btn--lg {
    padding: 14px 28px;
    font-size: 1.05rem;
    min-height: 48px;
}

.ks-btn--wa {
    background: var(--ks-whatsapp);
    color: #fff;
    border-color: var(--ks-whatsapp);
}
.ks-btn--wa:hover {
    background: #1eb857;
    color: #fff;
    border-color: #1eb857;
}

/* ---- Hero ---- */
.ks-hero {
    padding: 48px 0 56px;
    background: linear-gradient(135deg, var(--ks-primary) 0%, var(--ks-primary-dk) 100%);
    color: #fff;
}
.ks-hero__inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: center;
}
.ks-hero__eyebrow {
    margin: 0 0 10px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.85;
    font-weight: 600;
}
.ks-hero__title {
    margin: 0 0 14px;
    font-size: clamp(1.75rem, 6vw, 2.75rem);
    line-height: 1.15;
    color: #fff;
}
.ks-hero__sub {
    margin: 0 0 24px;
    font-size: 1.05rem;
    opacity: 0.92;
    max-width: 52ch;
    color: #fff;
}
.ks-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.ks-hero .ks-btn--primary { background: var(--ks-accent); border-color: var(--ks-accent); }
.ks-hero .ks-btn--primary:hover { background: var(--ks-accent-dk); }
.ks-hero .ks-btn--ghost {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.7);
}
.ks-hero .ks-btn--ghost:hover { background: rgba(255,255,255,0.15); }
.ks-hero__meta {
    list-style: none; padding: 0; margin: 20px 0 0;
    display: flex; flex-wrap: wrap; gap: 8px 16px;
    font-size: 0.85rem; opacity: 0.85;
}
.ks-hero__meta li::before {
    content: "✓ ";
    font-weight: 700;
}
.ks-hero__art {
    display: none;
    text-align: center;
}
.ks-hero__emoji {
    font-size: 12rem;
    line-height: 1;
    display: inline-block;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,0.25));
}

/* ---- Trust strip ---- */
.ks-trust {
    background: #fff;
    border-bottom: 1px solid var(--ks-border);
}
.ks-trust__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
    padding-block: 20px;
}
.ks-trust__item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-width: 0;
}
.ks-trust__icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
}
.ks-trust__item strong {
    display: block;
    font-size: 0.92rem;
    margin-bottom: 2px;
}
.ks-trust__item span {
    color: var(--ks-muted);
    font-size: 0.82rem;
    display: block;
    line-height: 1.3;
}

/* ---- Sections ---- */
.ks-section {
    padding: 48px 0;
}
.ks-section:nth-of-type(even) {
    background: var(--ks-bg-alt);
}
.ks-section__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.ks-section__header--center {
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.ks-section__title {
    margin: 0;
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    color: var(--ks-text);
}
.ks-section__sub {
    margin: 0;
    color: var(--ks-muted);
    font-size: 0.95rem;
}
.ks-section__more {
    color: var(--ks-primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.92rem;
    white-space: nowrap;
}
.ks-section__more:hover {
    color: var(--ks-primary-dk);
    text-decoration: underline;
}

/* ---- Category grid ---- */
.ks-category-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.ks-category-card__link {
    display: block;
    background: #fff;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow var(--ks-transition), transform var(--ks-transition);
}
.ks-category-card__link:hover {
    box-shadow: var(--ks-shadow-lg);
    transform: translateY(-2px);
}
.ks-category-card__media {
    aspect-ratio: 4 / 3;
    background: var(--ks-primary-lt);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ks-category-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ks-category-card__placeholder {
    font-size: 3rem;
    font-weight: 800;
    color: var(--ks-primary);
}
.ks-category-card__title {
    margin: 10px 12px 2px;
    font-size: 0.95rem;
}
.ks-category-card__count {
    margin: 0 12px 12px;
    color: var(--ks-muted);
    font-size: 0.8rem;
}

/* ---- How it works ---- */
.ks-how__steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 16px;
    counter-reset: none;
}
.ks-how__step {
    background: #fff;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    padding: 20px;
    text-align: center;
}
.ks-how__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ks-primary);
    color: #fff;
    font-weight: 800;
    margin-bottom: 10px;
    font-size: 1.1rem;
}
.ks-how__step-title {
    margin: 0 0 6px;
    font-size: 1.05rem;
}
.ks-how__step-text {
    margin: 0;
    color: var(--ks-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ---- Delivery ---- */
.ks-delivery__inner {
    display: grid;
    gap: 20px;
    align-items: start;
}
.ks-delivery__list {
    margin: 12px 0 0;
    padding-left: 20px;
    color: var(--ks-text);
    line-height: 1.7;
}

/* ---- Contact ---- */
.ks-contact__inner {
    display: grid;
    gap: 24px;
    align-items: start;
}
.ks-contact__list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}
.ks-contact__list li {
    margin-bottom: 10px;
    line-height: 1.5;
}
.ks-contact__label {
    color: var(--ks-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-right: 6px;
}
.ks-contact__list a {
    color: var(--ks-text);
    text-decoration: none;
    word-break: break-word;
}
.ks-contact__list a:hover {
    color: var(--ks-primary);
    text-decoration: underline;
}
.ks-contact__cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---- Responsive (mobile-first) ---- */
@media (min-width: 640px) {
    .ks-trust__inner { grid-template-columns: repeat(4, 1fr); }
    .ks-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ks-how__steps { grid-template-columns: 1fr 1fr; }
    .ks-delivery__inner { grid-template-columns: 1fr auto; align-items: center; }
    .ks-contact__inner { grid-template-columns: 1fr auto; align-items: start; }
}

@media (min-width: 900px) {
    .ks-hero { padding: 64px 0 72px; }
    .ks-hero__inner { grid-template-columns: 1.2fr 0.8fr; }
    .ks-hero__art { display: block; }
    .ks-category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ks-how__steps { grid-template-columns: repeat(4, 1fr); }
    .ks-section { padding: 64px 0; }
}
/* =========================================================
   Announcement bar
   =======================================================*/
.ks-announcement {
    background: var(--ks-primary-dk);
    color: #fff;
    font-size: 0.85rem;
    padding: 8px 0;
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
}
.ks-announcement__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    position: relative;
}
.ks-announcement__text {
    margin: 0;
    line-height: 1.35;
    flex: 1 1 auto;
}
.ks-announcement__dismiss {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: var(--ks-radius-sm);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.ks-announcement__dismiss:hover {
    background: rgba(255,255,255,0.15);
}
.ks-announcement[hidden] { display: none; }

/* When announcement is dismissed, hide on reload via localStorage.
   main.js sets the [hidden] attribute. This rule is a safety net. */
@media (max-width: 359px) {
    .ks-announcement__text { padding-right: 36px; }
}

/* =========================================================
   Header — actions column
   =======================================================*/
.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Mobile-only utility items */
.mobile-only { display: inline-flex !important; }
@media (min-width: 1024px) {
    .mobile-only { display: none !important; }
}

/* Mobile search toggle */
.header-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--ks-touch);
    height: var(--ks-touch);
    padding: 0;
    background: transparent;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    cursor: pointer;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.header-search-toggle:hover { background: var(--ks-bg-alt); }

/* WhatsApp header chip (desktop) */
.header-wa {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    background: var(--ks-whatsapp);
    color: #fff;
    border-radius: var(--ks-radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}
.header-wa:hover {
    background: #1eb857;
    color: #fff;
}
.header-wa__icon { font-size: 1rem; }

/* Prevent logo from squeezing at narrow widths */
.site-branding { flex-shrink: 1; min-width: 0; }
.site-branding > * { max-width: 100%; }

/* Ensure header background covers admin bar offset */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) {
    body.admin-bar .site-header { top: 46px; }
}

/* =========================================================
   Primary menu — desktop only (redundant safety net)
   =======================================================*/
@media (max-width: 1023px) {
    .main-navigation.desktop-only { display: none !important; }
}

/* Ensure focus rings don't get clipped inside the header */
.site-header :focus-visible {
    outline: 3px solid var(--ks-accent);
    outline-offset: 2px;
    border-radius: var(--ks-radius-sm);
}
/* =========================================================
   Page template
   =======================================================*/
.page-main {
    padding-block: 28px 40px;
}

/* Layout: full width vs sidebar */
.page-layout {
    display: grid;
    gap: 24px;
}

.layout-full .page-layout {
    grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
    .layout-with-sidebar .page-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
        align-items: start;
    }
}

/* Article */
.page-article {
    min-width: 0;
}

.page-hero {
    margin: 0 0 24px;
    border-radius: var(--ks-radius-lg);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--ks-bg-alt);
}

.page-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.page-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ks-border);
}

.page-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin: 0;
    color: var(--ks-text);
    line-height: 1.2;
    word-wrap: break-word;
}

/* Content */
.page-content.entry-content {
    color: var(--ks-text);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 72ch;      /* comfortable measure for long reading */
    overflow-wrap: anywhere; /* protects against super-long URLs / hashes */
}

.page-content > *:first-child { margin-top: 0; }
.page-content > *:last-child  { margin-bottom: 0; }

.page-content h2,
.page-content h3,
.page-content h4 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--ks-text);
    line-height: 1.3;
}

.page-content h2 { font-size: 1.4rem; }
.page-content h3 { font-size: 1.2rem; }
.page-content h4 { font-size: 1.05rem; }

.page-content p { margin: 0 0 1.1em; }

.page-content ul,
.page-content ol {
    padding-left: 1.4rem;
    margin: 0 0 1.1em;
}

.page-content li { margin-bottom: 6px; }

.page-content a {
    color: var(--ks-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.page-content a:hover { color: var(--ks-primary-dk); }

.page-content blockquote {
    margin: 1.5em 0;
    padding: 12px 20px;
    border-left: 4px solid var(--ks-primary);
    background: var(--ks-bg-alt);
    border-radius: var(--ks-radius-sm);
    color: var(--ks-muted);
    font-style: italic;
}

.page-content code {
    background: var(--ks-bg-alt);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.page-content pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 14px 18px;
    border-radius: var(--ks-radius);
    overflow-x: auto;
    font-size: 0.9em;
    max-width: 100%;
}

.page-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.2em;
    font-size: 0.95rem;
    overflow-x: auto;
    display: block;   /* enables horizontal scroll on narrow screens */
    max-width: 100%;
}

.page-content table th,
.page-content table td {
    padding: 10px 12px;
    border: 1px solid var(--ks-border);
    text-align: left;
    vertical-align: top;
}

.page-content table th {
    background: var(--ks-bg-alt);
    font-weight: 600;
}

.page-content figure {
    margin: 1.5em 0;
}

.page-content img {
    height: auto;
    border-radius: var(--ks-radius);
}

.page-content hr {
    border: none;
    border-top: 1px solid var(--ks-border);
    margin: 2em 0;
}

/* Multi-page navigation */
.page-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin: 24px 0;
    padding-top: 16px;
    border-top: 1px solid var(--ks-border);
    font-size: 0.9rem;
}

.page-links__label {
    color: var(--ks-muted);
    margin-right: 6px;
    font-weight: 600;
}

.page-links__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: var(--ks-bg-alt);
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius-sm);
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--ks-text);
}

.page-links a .page-links__num:hover {
    background: var(--ks-primary);
    color: #fff;
    border-color: var(--ks-primary);
}

.page-links .page-links__num {
    background: var(--ks-primary);
    color: #fff;
    border-color: var(--ks-primary);
}

.page-links a {
    text-decoration: none;
}

/* Edit link */
.page-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--ks-border);
}

.page-edit-link {
    margin: 0;
    font-size: 0.85rem;
    color: var(--ks-muted);
}

.page-edit-link a {
    color: var(--ks-primary);
    text-decoration: none;
}

.page-edit-link a:hover {
    text-decoration: underline;
}

/* Sidebar */
.page-sidebar {
    min-width: 0;
}

@media (max-width: 1023px) {
    .page-sidebar {
        order: 2;
        margin-top: 24px;
        padding-top: 24px;
        border-top: 1px solid var(--ks-border);
    }
}

.page-sidebar .widget {
    background: #fff;
    border: 1px solid var(--ks-border);
    border-radius: var(--ks-radius);
    padding: 16px 18px;
    margin-bottom: 16px;
}

.page-sidebar .widget:last-child { margin-bottom: 0; }

.page-sidebar .widget-title {
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--ks-primary-dk);
    border-bottom: 1px solid var(--ks-border);
    padding-bottom: 8px;
}

.page-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-sidebar li {
    padding: 6px 0;
    border-bottom: 1px dashed var(--ks-border);
}
.page-sidebar li:last-child { border-bottom: none; }

.page-sidebar a {
    color: var(--ks-text);
    text-decoration: none;
    font-size: 0.92rem;
}
.page-sidebar a:hover { color: var(--ks-primary); }

/* Comments */
.page-comments {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--ks-border);
}

.page-comments .comments-title {
    font-size: 1.15rem;
    margin: 0 0 16px;
}

.page-comments ol,
.page-comments ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}

.page-comments li.comment {
    padding: 14px 0;
    border-bottom: 1px solid var(--ks-border);
}

.page-comments .comment-form label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.page-comments .comment-form input,
.page-comments .comment-form textarea {
    width: 100%;
    min-height: 40px;
    padding: 10px 12px;
    border: 1px solid var(--ks-border-dk);
    border-radius: var(--ks-radius);
    font-size: 1rem;
    margin-bottom: 12px;
}

.page-comments .comment-form input:focus,
.page-comments .comment-form textarea:focus {
    outline: none;
    border-color: var(--ks-primary);
    box-shadow: 0 0 0 3px rgba(10, 125, 62, .15);
}

.page-comments .comment-form .submit {
    min-height: var(--ks-touch);
    padding: 10px 24px;
    background: var(--ks-primary);
    color: #fff;
    border: none;
    border-radius: var(--ks-radius);
    font-weight: 600;
    cursor: pointer;
}

.page-comments .comment-form .submit:hover {
    background: var(--ks-primary-dk);
}

/* Narrow screens */
@media (max-width: 359px) {
    .page-title { font-size: 1.35rem; }
    .page-content.entry-content { font-size: 0.95rem; }
    .page-content table { font-size: 0.85rem; }
    .page-content pre { font-size: 0.8rem; }
}
/* =========================================================
   Search page
   =======================================================*/
.search-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-page-form {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    max-width: 560px;
}

.search-page-form input {
    flex: 1 1 auto;
    min-width: 0;
    height: var(--ks-touch);
    padding: 0 14px;
    border: 1px solid var(--ks-border-dk);
    border-radius: var(--ks-radius);
    font-size: 1rem;
}

.search-page-form input:focus {
    outline: none;
    border-color: var(--ks-primary);
    box-shadow: 0 0 0 3px rgba(10, 125, 62, .15);
}

.search-page-form button {
    flex-shrink: 0;
}

/* Type chips */
.search-type-chips ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
}

.search-type-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    min-height: 32px;
    background: #fff;
    border: 1px solid var(--ks-border);
    border-radius: 999px;
    color: var(--ks-text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
}

.search-type-chip:hover {
    border-color: var(--ks-primary);
    color: var(--ks-primary);
}

.search-type-chip.is-active {
    background: var(--ks-primary);
    border-color: var(--ks-primary);
    color: #fff;
}

.search-type-chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.search-type-chip.is-active .search-type-chip__count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Small badge on page results */
.archive-card__badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--ks-primary-lt);
    color: var(--ks-primary-dk);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Suggestions on empty results */
.archive-empty__suggestions-label {
    margin: 20px 0 10px;
    color: var(--ks-muted);
    font-size: 0.9rem;
}

.archive-empty__suggestions {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.archive-empty__suggestions li {
    display: inline-block;
}

/* Narrow screens */
@media (max-width: 359px) {
    .search-page-form {
        flex-direction: column;
    }
    .search-page-form button {
        width: 100%;
    }
    .archive-empty__suggestions li {
        width: 100%;
    }
    .archive-empty__suggestions .ks-btn {
        width: 100%;
    }
}