/* ==========================================================================
   2BFox.com — Frontend Stylesheet
   Fox Color Palette: Light (Red Fox) & Dark (Black / Silver Fox)
   ========================================================================== */

:root,
html[data-theme="light"] {
    --bg-main: #FAF6F0;
    --bg-alt: #F2EAE0;
    --bg-card: #FFFFFF;
    --bg-header: rgba(250, 246, 240, 0.92);
    --fox-orange: #E86A17;
    --fox-orange-hover: #C9560B;
    --fox-orange-soft: rgba(232, 106, 23, 0.12);
    --fox-brown: #6E3B1A;
    --fox-charcoal: #1E1B18;
    --text-main: #1E1B18;
    --text-muted: #695D53;
    --border-color: #E5DBD0;
    --border-light: #F2EAE0;
    --shadow-sm: 0 2px 8px rgba(30, 27, 24, 0.06);
    --shadow-md: 0 8px 24px rgba(30, 27, 24, 0.10);
    --radius-md: 12px;
    --radius-lg: 18px;
}

html[data-theme="dark"] {
    --bg-main: #111317;
    --bg-alt: #171A21;
    --bg-card: #1C2029;
    --bg-header: rgba(17, 19, 23, 0.92);
    --fox-orange: #F58220;
    --fox-orange-hover: #FB923C;
    --fox-orange-soft: rgba(245, 130, 32, 0.16);
    --fox-brown: #CBD5E1;
    --fox-charcoal: #F8FAFC;
    --text-main: #E2E8F0;
    --text-muted: #94A3B8;
    --border-color: #2B313E;
    --border-light: #222733;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.50);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    margin: 0;
    font-family: var(--font-body, 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.68;
    font-size: 16px;
    transition: background-color 0.2s ease, color 0.2s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6, .brand-name, .nav-item, .btn {
    font-family: var(--font-heading, 'Anuphan', sans-serif);
}

/* Reserve width for Bootstrap Icons on initial non-blocking load */
i.bi {
    display: inline-block;
    min-width: 1em;
}

a {
    color: var(--fox-orange);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: var(--fox-orange-hover);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.container-full {
    width: 100%;
    padding: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.58rem 1.15rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.94rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.18s ease;
    text-decoration: none;
}
.btn-sm {
    padding: 0.38rem 0.85rem;
    font-size: 0.85rem;
    border-radius: 8px;
}
.btn-lg {
    padding: 0.78rem 1.5rem;
    font-size: 1.02rem;
}
.btn-block {
    display: flex;
    width: 100%;
}
.btn-primary {
    background: var(--fox-orange);
    color: #FFFFFF !important;
    box-shadow: 0 3px 10px var(--fox-orange-soft);
}
.btn-primary:hover {
    background: var(--fox-orange-hover);
    transform: translateY(-1px);
}
.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-main) !important;
}
.btn-outline:hover {
    border-color: var(--fox-orange);
    color: var(--fox-orange) !important;
}
.btn-light {
    background: #FFFFFF;
    color: #111827 !important;
    font-weight: 600;
}
.btn-light:hover {
    background: var(--surface-100, #F1F5F9);
    color: var(--fox-orange, #111827) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}
.btn-light-outline {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.5);
    color: #FFFFFF !important;
    backdrop-filter: blur(4px);
}
.btn-light-outline:hover {
    background: rgba(255, 255, 255, 0.25);
}
.btn-ghost {
    background: transparent;
    color: var(--text-muted) !important;
}
.btn-ghost:hover {
    background: var(--fox-orange-soft);
    color: var(--fox-orange) !important;
}

/* Header & Desktop Navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    gap: 1rem;
}
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text-main) !important;
}
.brand-logo img {
    border-radius: 10px;
    border: 2px solid var(--fox-orange);
}
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.brand-name {
    font-size: 1.22rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.brand-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.nav-item {
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
}
.nav-item:hover,
.nav-item.active {
    background: var(--fox-orange-soft);
    color: var(--fox-orange);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.icon-btn:hover {
    border-color: var(--fox-orange);
    color: var(--fox-orange);
}
html[data-theme="light"] .theme-icon-dark { display: inline; }
html[data-theme="light"] .theme-icon-light { display: none; }
html[data-theme="dark"] .theme-icon-light { display: inline; }
html[data-theme="dark"] .theme-icon-dark { display: none; }

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.7rem 0.25rem 0.3rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main) !important;
    font-size: 0.88rem;
    font-weight: 500;
}
.user-pill img {
    border-radius: 50%;
    object-fit: cover;
}

/* Mobile Hamburger & Right Drawer */
.mobile-only {
    display: none !important;
}
.hamburger-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
}
.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: 0.2s ease;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2090;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}
.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(310px, 85vw);
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    z-index: 2100;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
    display: flex;
    flex-direction: column;
    padding: 1.15rem;
    overflow-y: auto;
    visibility: hidden;
}
.mobile-drawer.open {
    transform: translateX(0);
    visibility: visible;
}
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.drawer-close {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-main);
    font-size: 1rem;
    cursor: pointer;
}
.drawer-search {
    display: flex;
    gap: 0.4rem;
    margin: 1rem 0;
}
.drawer-search input {
    flex: 1;
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-main);
}
.drawer-search button {
    padding: 0 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--fox-orange);
    color: #fff;
    cursor: pointer;
}
.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: auto;
}
.drawer-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.68rem 0.85rem;
    border-radius: 10px;
    color: var(--text-main) !important;
    font-weight: 500;
}
.drawer-link.active,
.drawer-link:hover {
    background: var(--fox-orange-soft);
    color: var(--fox-orange) !important;
}
.drawer-link-icon {
    display: inline-flex;
    color: var(--fox-orange);
}
.drawer-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
.drawer-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.drawer-user-card img {
    border-radius: 50%;
}
.drawer-user-card div {
    display: flex;
    flex-direction: column;
}
.drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Main & Page Sections */
.site-main {
    flex: 1;
}
.page-section {
    padding: 3.25rem 0;
}
.page-section.bg-alt {
    background-color: var(--bg-alt);
}
.page-section.bg-card {
    background-color: var(--bg-card);
}
.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.section-header.centered {
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.section-title {
    margin: 0;
    font-size: 1.75rem;
    color: var(--text-main);
}
.section-subtitle {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
}
.section-badge {
    display: inline-block;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    background: var(--fox-orange-soft);
    color: var(--fox-orange);
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 0.6rem;
}

/* Section Type: Banner / Carousel */
.fox-carousel {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.carousel-slide {
    display: none;
    position: relative;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    padding: 3.5rem 2.5rem;
    align-items: center;
}
.carousel-slide.active {
    display: flex;
}
.carousel-overlay {
    position: absolute;
    inset: 0;
}
.carousel-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
    color: #FFFFFF;
}
.hero-badge {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    background: var(--fox-orange);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 600;
    margin-bottom: 0.9rem;
}
.hero-title {
    margin: 0 0 0.85rem;
    font-size: clamp(1.75rem, 3.5vw, 2.6rem);
    line-height: 1.22;
}
.hero-subtitle {
    margin: 0 0 1.6rem;
    font-size: 1.06rem;
    color: rgba(255, 255, 255, 0.9);
}
.hero-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}
.carousel-arrow.prev { left: 1rem; }
.carousel-arrow.next { right: 1rem; }
.carousel-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    gap: 0.45rem;
}
.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.45);
    cursor: pointer;
}
.carousel-dot.active {
    background: var(--fox-orange);
    width: 24px;
    border-radius: 999px;
}

/* Section Type: Feature Cards */
.feature-grid {
    display: grid;
    gap: 1.35rem;
}
.feature-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.feature-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.feature-grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.6rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.feature-card:hover {
    transform: translateY(-3px);
    border-color: var(--fox-orange);
}
.feature-icon {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    color: var(--fox-orange);
}
.feature-icon img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}
.feature-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.18rem;
}
.feature-card p {
    margin: 0 0 0.85rem;
    color: var(--text-muted);
}
.feature-link {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Section Type: Image + Text Split */
.split-block {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 2.5rem;
    align-items: center;
}
.split-block.img-right {
    grid-template-columns: 1.15fr 1fr;
}
.split-block.img-right .split-media {
    order: 2;
}
.split-media img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    object-fit: cover;
}
.split-text h2 {
    margin: 0 0 1rem;
    font-size: 1.85rem;
}

/* Section Type: FAQ Accordion */
.faq-list {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.faq-question {
    width: 100%;
    padding: 1.1rem 1.35rem;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-heading, 'Anuphan', sans-serif);
    font-size: 1.02rem;
    font-weight: 600;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}
.faq-toggle-icon {
    color: var(--fox-orange);
    font-size: 1.3rem;
    transition: transform 0.2s ease;
}
.faq-item.open .faq-toggle-icon {
    transform: rotate(45deg);
}
.faq-answer {
    display: none;
    padding: 0 1.35rem 1.15rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}
.faq-item.open .faq-answer {
    display: block;
    padding-top: 0.9rem;
}

/* Section Type: Gallery Grid & Lightbox */
.gallery-grid {
    display: grid;
    gap: 1.15rem;
}
.gallery-grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.gallery-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.gallery-grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.gallery-item {
    margin: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: zoom-in;
}
.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}
.gallery-item:hover img {
    transform: scale(1.04);
}
.gallery-item figcaption {
    padding: 0.6rem 0.85rem;
    font-size: 0.86rem;
    color: var(--text-muted);
    text-align: center;
}

.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 300;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.lightbox-modal.open {
    display: flex;
}
.lightbox-modal img {
    max-width: 92vw;
    max-height: 80vh;
    border-radius: 10px;
}
.lightbox-caption {
    color: #fff;
    margin-top: 0.75rem;
}
.lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Section Type: Call to Action */
.cta-banner {
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: #FFFFFF;
}
.cta-fox {
    background: linear-gradient(135deg, var(--fox-orange) 0%, var(--fox-orange-hover) 100%);
}
.cta-accent {
    background: linear-gradient(135deg, var(--brand-accent, #2C1A11) 0%, var(--accent-800, #1E1B18) 100%);
}
.cta-dark {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
}
.cta-text {
    max-width: 680px;
}
.cta-text h2 {
    margin: 0 0 0.5rem;
    font-size: 1.65rem;
}
.cta-text p {
    margin: 0;
    opacity: 0.92;
}

/* Blog / Post Cards & Directory */
.post-filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}
.filter-search {
    flex: 1;
    min-width: 220px;
}
.filter-search input,
.filter-selects select {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
}
.filter-selects {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.filter-selects select {
    width: auto;
}

.active-filter-tags {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-top: -0.25rem;
    margin-bottom: 1.85rem;
    font-size: 0.92rem;
    color: var(--text-muted);
}
.active-filter-tags .tag-chip.active {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    background: var(--fox-orange-soft);
    border: 1px solid var(--fox-orange);
    color: var(--fox-orange) !important;
    font-weight: 500;
}
.active-filter-tags .tag-chip.active a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--fox-orange-soft);
    color: var(--fox-orange) !important;
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1;
    margin-left: 0.2rem;
    transition: background 0.15s ease, transform 0.15s ease;
}
.active-filter-tags .tag-chip.active a:hover {
    background: var(--fox-orange);
    color: #fff !important;
    transform: scale(1.1);
}

/* Reading Progress Bar (Fixed Top) */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3.5px;
    background: var(--fox-orange, #E86A17);
    z-index: 99999;
    pointer-events: none;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(232, 106, 23, 0.65);
}

/* Blog Category Quick Tabs (Pill Scrolling) */
.blog-cat-tabs-scroll {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--fox-orange-soft) transparent;
}
.blog-cat-tabs-scroll::-webkit-scrollbar {
    height: 4px;
}
.blog-cat-tabs-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.blog-cat-tabs-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 999px;
}
.blog-cat-tabs-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--fox-orange);
}
.blog-cat-tabs {
    display: flex;
    gap: 0.6rem;
    min-width: max-content;
}

/* Hero Featured Post Card */
.post-hero-card {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 20px);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md, 0 4px 20px rgba(0,0,0,0.06));
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.post-hero-card:hover {
    border-color: var(--fox-orange);
    box-shadow: var(--shadow-lg, 0 10px 30px rgba(232, 106, 23, 0.12));
    transform: translateY(-2px);
}
.post-hero-thumb-link {
    position: relative;
    display: block;
    min-height: 320px;
    overflow: hidden;
    background: var(--bg-alt);
}
.post-hero-thumb-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}
.post-hero-card:hover .post-hero-thumb-link img {
    transform: scale(1.035);
}
.post-hero-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--fox-orange), #C2410C);
    box-shadow: 0 4px 12px rgba(232, 106, 23, 0.4);
    letter-spacing: 0.02em;
    z-index: 2;
}
.post-hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.2rem 2.4rem;
}
.post-hero-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 0.9rem;
}
.post-hero-title {
    font-family: var(--font-heading, sans-serif);
    font-size: clamp(1.35rem, 2.3vw, 1.95rem);
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.9rem;
    color: var(--text-main);
}
.post-hero-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}
.post-hero-title a:hover {
    color: var(--fox-orange);
}
.post-hero-excerpt {
    font-size: 1.02rem;
    line-height: 1.68;
    color: var(--text-muted);
    margin: 0 0 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-hero-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}
.post-hero-author {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}
@media (max-width: 900px) {
    .post-hero-card {
        grid-template-columns: 1fr;
    }
    .post-hero-thumb-link {
        min-height: 220px;
        aspect-ratio: 16 / 9;
    }
    .post-hero-content {
        padding: 1.4rem 1.25rem;
    }
}

.post-read-time {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1.5rem;
}

/* Magazine List View (Horizontal Row Cards) */
.post-grid.post-magazine-view {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.post-grid.post-magazine-view .post-card {
    flex-direction: row;
    align-items: stretch;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.post-grid.post-magazine-view .post-card:hover {
    box-shadow: var(--shadow-md, 0 6px 20px rgba(0,0,0,0.06));
}
.post-grid.post-magazine-view .post-card-thumb {
    width: 310px;
    max-width: 38%;
    flex-shrink: 0;
    aspect-ratio: 16 / 10;
}
.post-grid.post-magazine-view .post-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
    padding: 1.35rem 1.6rem;
}
.post-grid.post-magazine-view .post-card-title {
    font-size: 1.22rem;
    line-height: 1.4;
    margin-bottom: 0.55rem;
}
.post-grid.post-magazine-view .post-card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}
.post-grid.post-magazine-view .post-card-footer {
    margin-top: auto;
}
@media (max-width: 768px) {
    .post-grid.post-magazine-view .post-card {
        flex-direction: column;
    }
    .post-grid.post-magazine-view .post-card-thumb {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 16 / 9;
    }
    .post-grid.post-magazine-view .post-card-body {
        padding: 1.15rem 1.15rem;
    }
}
.post-list-view {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}
.post-list-view .post-card {
    flex-direction: row;
}
.post-list-view .post-card-thumb {
    width: 260px;
    flex-shrink: 0;
}
@media (min-width: 769px) {
    .post-list-view .post-card-body {
        min-width: 0;
    }
    .post-list-view .post-card-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .post-list-view .post-card-excerpt {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.post-card:hover {
    transform: translateY(-4px);
    border-color: var(--fox-orange);
}
.post-card-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-alt);
}
.post-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.post-card:hover .post-card-thumb img {
    transform: scale(1.04);
}
.badge-pinned {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    background: var(--fox-orange);
    color: #fff;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
}
.post-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.post-card-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.55rem;
}
.post-cat-badge {
    background: var(--fox-orange-soft);
    color: var(--fox-orange);
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    font-weight: 600;
}
.post-card-title {
    margin: 0 0 0.55rem;
    font-size: 1.15rem;
    line-height: 1.38;
}
.post-card-title a {
    color: var(--text-main);
}
.post-card-title a:hover {
    color: var(--fox-orange);
}
.post-card-excerpt {
    margin: 0 0 1rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}
.tag-mini {
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--bg-alt);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}
.post-card-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Single Post Reading View (/post/{slug}/) */
.post-single-container {
    max-width: 860px;
    padding-top: 2rem;
    padding-bottom: 3.5rem;
}
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.post-single-header {
    margin-bottom: 1.75rem;
}
.post-single-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.badge-pinned-inline {
    background: var(--fox-orange);
    color: #fff;
    padding: 0.18rem 0.65rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}
.post-single-title {
    margin: 0 0 0.75rem;
    font-size: clamp(1.65rem, 3.2vw, 2.35rem);
    line-height: 1.28;
}
.post-single-lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0 0 1.15rem;
}
.post-single-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
    color: var(--text-muted);
}
.meta-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.post-single-cover {
    margin: 0 0 2rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.post-single-cover img {
    width: 100%;
    display: block;
}

.post-toc {
    background: var(--bg-alt);
    border-left: 4px solid var(--fox-orange);
    border-radius: 10px;
    padding: 1rem 1.35rem;
    margin-bottom: 2rem;
}
.post-toc-title {
    font-family: var(--font-heading, 'Anuphan', sans-serif);
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.post-toc ul {
    margin: 0;
    padding-left: 1.25rem;
}
.post-toc li {
    margin: 0.25rem 0;
}

.rich-content {
    font-size: 1.08rem;
    line-height: 1.82;
}
.rich-content h2 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--fox-orange-soft);
    padding-bottom: 0.35rem;
}
.rich-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}
.rich-content p {
    margin: 0 0 1.2rem;
}
.rich-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.35rem;
    border-left: 4px solid var(--fox-orange);
    background: var(--bg-alt);
    border-radius: 0 10px 10px 0;
    font-style: italic;
}
.rich-content pre, .rich-content code {
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
    background: var(--bg-alt);
    border-radius: 6px;
}
.rich-content pre {
    padding: 1rem;
    overflow-x: auto;
}
.rich-content img {
    border-radius: 10px;
    margin: 1rem 0;
}

/* Rich Content Enhancements */
.compare-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0 1.75rem;
}
.compare-card {
    padding: 1.15rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-alt);
    font-size: 0.96rem;
    line-height: 1.65;
}
.compare-card.client-side {
    border-top: 3px solid #3b82f6;
}
.compare-card.dev-side {
    border-top: 3px solid var(--fox-orange);
}
.compare-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    margin-bottom: 0.6rem;
}
.compare-badge.client {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}
.compare-badge.dev {
    background: var(--fox-orange-soft);
    color: var(--fox-orange);
}

.script-dialogue {
    margin: 1rem 0 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-alt);
    border-radius: 10px;
    border-left: 3px solid #10b981;
    font-size: 0.98rem;
    line-height: 1.65;
}
.script-dialogue-tag {
    color: #059669;
    font-weight: 700;
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.84rem;
}

.callout-box {
    margin: 1.5rem 0;
    padding: 1.15rem 1.35rem;
    border-radius: 10px;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--fox-orange);
}
.callout-box.warn {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}
.callout-box-title {
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: var(--text-main);
}

.post-single-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.post-tags-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    color: var(--text-main) !important;
    font-size: 0.86rem;
}
.tag-chip:hover, .tag-chip.active {
    border-color: var(--fox-orange);
    color: var(--fox-orange) !important;
}

.post-interaction-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
}
.btn-like {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-main) !important;
    font-family: var(--font-heading, 'Anuphan', sans-serif);
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s ease;
}
.btn-like.liked {
    border-color: #E11D48;
    background: rgba(225, 29, 72, 0.1);
    color: #E11D48 !important;
}
.like-count {
    background: var(--bg-card);
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.82rem;
}

/* Social Share Bar */
.post-share-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.9rem 1.15rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}
.share-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.share-btn-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.share-icon-btn,
.share-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    font-size: 1.05rem;
    text-decoration: none;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-main);
    transition: all 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 0;
}
.share-icon-btn:hover,
.share-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
.share-icon-btn.share-fb:hover,
.share-pill.share-fb:hover {
    background: #1877F2;
    border-color: #1877F2;
    color: #FFF !important;
}
.share-icon-btn.share-line:hover,
.share-pill.share-line:hover {
    background: #06C755;
    border-color: #06C755;
    color: #FFF !important;
}
.share-icon-btn.share-x:hover,
.share-pill.share-x:hover {
    background: #000000;
    border-color: #000000;
    color: #FFF !important;
}
html[data-theme="dark"] .share-icon-btn.share-x:hover,
html[data-theme="dark"] .share-pill.share-x:hover {
    background: #FFFFFF;
    border-color: #FFFFFF;
    color: #000000 !important;
}
.share-icon-btn.share-copy:hover,
.share-pill.share-copy:hover {
    border-color: var(--fox-orange);
    color: var(--fox-orange);
    background: var(--fox-orange-soft, rgba(232, 106, 23, 0.12));
}

/* Author Bio Card */
.author-bio-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 1.6rem 1.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 18px);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease;
}
.author-bio-card:hover {
    border-color: var(--fox-orange);
}
.author-bio-avatar-wrap {
    flex-shrink: 0;
}
.author-bio-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--fox-orange);
    box-shadow: 0 4px 12px rgba(232, 106, 23, 0.2);
}
.author-bio-info {
    flex: 1;
    min-width: 0;
}
.author-bio-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
}
.author-bio-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
    font-family: var(--font-heading, sans-serif);
}
.author-bio-role {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    background: var(--fox-orange-soft, rgba(232, 106, 23, 0.12));
    color: var(--fox-orange);
}
.author-bio-desc {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0 0 0.85rem;
}
.author-bio-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 0.75rem;
}
.author-post-count {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.author-all-posts-btn {
    font-size: 0.8rem !important;
    padding: 0.32rem 0.75rem !important;
}
@media (max-width: 640px) {
    .author-bio-card {
        flex-direction: column;
        text-align: center;
        padding: 1.35rem 1.15rem;
    }
    .author-bio-header {
        justify-content: center;
    }
    .author-bio-footer {
        justify-content: center;
    }
}

/* Related Posts & Comments */
.related-posts-section,
.post-comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}
.comment-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.comment-form-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}
.comment-form-user img {
    border-radius: 50%;
}
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.96rem;
}
.comment-login-prompt {
    background: var(--bg-alt);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.comment-item {
    display: flex;
    gap: 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
}
.comment-avatar {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.comment-body {
    flex: 1;
}
.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.35rem;
}
.comment-meta small {
    color: var(--text-muted);
}
.comment-text {
    margin: 0;
}
.btn-link-danger {
    background: none;
    border: none;
    color: #DC2626;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Pagination, Alerts, Error Box */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-top: 2.25rem;
    flex-wrap: wrap;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 0.5rem;
}
.page-num {
    min-width: 38px;
    height: 38px;
    padding: 0 0.55rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: all 0.2s ease;
}
.page-num:hover {
    border-color: var(--fox-orange);
    color: var(--fox-orange);
}
.page-num.active {
    background: var(--fox-orange);
    border-color: var(--fox-orange);
    color: #fff;
}
.page-arrow {
    color: var(--text-muted);
}
.page-arrow:hover {
    color: var(--fox-orange);
}
.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 38px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.88rem;
    user-select: none;
}

.alert {
    padding: 0.85rem 1.15rem;
    border-radius: 10px;
    margin: 1rem 0;
    font-weight: 500;
}
.alert-success {
    background: rgba(22, 163, 74, 0.14);
    color: #15803D;
    border: 1px solid rgba(22, 163, 74, 0.3);
}
.alert-error {
    background: rgba(220, 38, 38, 0.14);
    color: #B91C1C;
    border: 1px solid rgba(220, 38, 38, 0.3);
}
.empty-box, .error-box {
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

/* Site Footer */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 0;
    margin-top: auto;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}
.footer-intro {
    color: var(--text-muted);
    margin: 0.85rem 0 0.5rem;
    max-width: 540px;
}
.footer-outro {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin: 0;
}
/* Footer Social & Contact System */
.footer-contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.85rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.footer-contact-item i {
    color: var(--fox-orange);
    font-size: 0.95rem;
}
.footer-contact-item a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}
.footer-contact-item a:hover {
    color: var(--fox-orange);
}
.footer-social-links {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-top: 1.15rem;
}
.social-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt, #F1F5F9);
    border: 1px solid var(--border-color, #E2E8F0);
    color: var(--text-main);
    font-size: 1.05rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none !important;
}
.social-icon-btn:hover {
    background: var(--fox-orange);
    color: #FFFFFF !important;
    border-color: var(--fox-orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--fox-orange-soft);
}
.footer-links-col h4,
.footer-links-col .footer-col-title {
    margin: 0 0 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    font-family: var(--font-heading, 'Anuphan', sans-serif);
}
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}
.footer-links a {
    color: var(--text-muted);
    font-size: 0.94rem;
}
.footer-links a:hover {
    color: var(--fox-orange);
}
.footer-bottom {
    padding-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.86rem;
    color: var(--text-muted);
}
.footer-meta-links {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.86rem;
}
.footer-meta-links a,
.footer-meta-links button,
.footer-meta-links span {
    color: var(--fox-orange);
    text-decoration: none !important;
}
.footer-meta-links a:hover,
.footer-meta-links button:hover {
    color: var(--fox-orange-hover);
    text-decoration: none !important;
}

/* Mobile Responsive & Bottom Navigation Bar */
@media (max-width: 768px) {
    .desktop-nav,
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: inline-flex !important;
    }
    body {
        padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px));
    }
    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(64px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--bg-header);
        backdrop-filter: blur(14px);
        border-top: 1px solid var(--border-color);
        z-index: 150;
        display: flex !important;
        justify-content: space-around;
        align-items: center;
    }
    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: var(--text-muted) !important;
        font-size: 0.72rem;
        font-family: var(--font-heading, 'Anuphan', sans-serif);
        font-weight: 500;
        height: 100%;
    }
    .bottom-nav-item.active {
        color: var(--fox-orange) !important;
    }
    .bottom-nav-icon {
        display: inline-flex;
    }

    .split-block,
    .split-block.img-right,
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .split-block.img-right .split-media {
        order: 0;
    }
    .carousel-slide {
        padding: 2.25rem 1.35rem;
        min-height: 320px;
    }
    .post-list-view .post-card {
        flex-direction: column;
    }
    .post-list-view .post-card-thumb {
        width: 100%;
    }
}

/* ==========================================================================
   Cookie Consent Banner & Preferences Modal (PDPA / GDPR Compliant)
   ========================================================================== */
.footer-cookie-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--fox-orange);
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none !important;
    line-height: inherit;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s ease;
}
.footer-cookie-btn:hover {
    color: var(--fox-orange-hover);
    text-decoration: none !important;
}

.cookie-banner {
    position: fixed;
    left: 1.25rem;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 350;
    max-width: 980px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 16px 45px rgba(0,0,0,0.22);
    padding: 1.15rem 1.35rem;
    animation: cookieSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cookieSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
.cookie-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.cookie-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 280px;
}
.cookie-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--fox-orange-soft);
    color: var(--fox-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.cookie-banner-text strong {
    display: block;
    font-size: 0.98rem;
    color: var(--text-main);
    margin-bottom: 0.2rem;
}
.cookie-banner-text p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.48;
}
.cookie-banner-text a {
    color: var(--fox-orange);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cookie-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Cookie Modal */
.cookie-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    z-index: 400;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: cookieFadeIn 0.2s ease;
}
@keyframes cookieFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.cookie-modal-card {
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 16px;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0,0,0,0.35);
    border: 1px solid var(--border-color);
    overflow: hidden;
    animation: cookieZoom 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cookieZoom {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}
.cookie-modal-header {
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cookie-modal-title-box {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.cookie-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.15s ease;
}
.cookie-modal-close:hover {
    color: var(--text-main);
    border-color: var(--fox-orange);
}
.cookie-modal-body {
    padding: 1.25rem 1.35rem;
    overflow-y: auto;
    flex: 1;
}
.cookie-pref-item {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    margin-bottom: 0.85rem;
}
.cookie-pref-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}
.cookie-pref-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #16A34A;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 0.2rem;
}
.cookie-pref-sub {
    display: block;
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.15rem;
}
.cookie-pref-desc {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Toggle Switch */
.cookie-toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 25px;
    flex-shrink: 0;
}
.cookie-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #CBD5E1;
    transition: 0.2s ease;
    border-radius: 25px;
}
.cookie-toggle-switch input:checked + .cookie-toggle-slider {
    background-color: var(--fox-orange);
}
.cookie-toggle-slider::before {
    position: absolute;
    content: "";
    height: 19px;
    width: 19px;
    left: 3px;
    bottom: 3px;
    background-color: #FFFFFF;
    transition: 0.2s ease;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.cookie-toggle-switch input:checked + .cookie-toggle-slider::before {
    transform: translateX(21px);
}

.cookie-modal-footer {
    padding: 1rem 1.35rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    background: var(--bg-card);
    flex-wrap: wrap;
}

/* Mobile responsive for Cookie Banner */
@media (max-width: 768px) {
    .cookie-banner {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        left: 0.75rem;
        right: 0.75rem;
        padding: 1rem;
    }
    .cookie-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }
    .cookie-banner-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }
    .cookie-banner-actions .btn {
        width: 100%;
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
        text-align: center;
        justify-content: center;
    }
}

/* ==========================================================================
   Floating Toast Notifications (Bottom-Left — Non-Intrusive)
   ========================================================================== */
.toast-toast-wrapper {
    position: fixed;
    left: 1.5rem;
    bottom: 1.5rem;
    z-index: 450;
    max-width: 440px;
    pointer-events: none;
    animation: toastPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastPopIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.15rem;
    border-radius: 12px;
    background: var(--bg-card, #FFFFFF);
    color: var(--text-main, #1E293B);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color, #E2E8F0);
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.45;
}
html[data-theme="dark"] .toast-item {
    background: #1E222A;
    color: #F1F5F9;
    border-color: #334155;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.toast-item.toast-success {
    border-left: 4px solid #16A34A;
}
.toast-item.toast-success .toast-icon {
    color: #16A34A;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.toast-item.toast-error {
    border-left: 4px solid #DC2626;
}
.toast-item.toast-error .toast-icon {
    color: #DC2626;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.toast-content {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}
.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted, #64748B);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.2rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.toast-close:hover {
    color: var(--text-main, #1E293B);
    background: rgba(0, 0, 0, 0.06);
}
html[data-theme="dark"] .toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFF;
}

@media (max-width: 768px) {
    .toast-toast-wrapper {
        left: 1rem;
        right: 1rem;
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
        max-width: none;
    }
}



/* ==========================================================================
   Fox Shop & E-commerce System Styles (Phase 2)
   ========================================================================== */

/* Cart Header Button & Counter Badge */
.cart-header-btn {
    position: relative;
    text-decoration: none;
}
.cart-badge-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--fox-orange);
    color: #FFF;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 5px var(--fox-orange-soft);
    pointer-events: none;
}
.cart-badge-count.hidden {
    display: none;
}

/* Shop Header Banner */
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.shop-header-text {
    max-width: 680px;
}
.shop-header-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}
.trust-pill i {
    color: var(--fox-orange);
}

/* Category Quick Tabs */
.shop-cat-tabs-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
    padding-bottom: 0.45rem;
}
.shop-cat-tabs-scroll::-webkit-scrollbar,
.shop-subcat-tabs-scroll::-webkit-scrollbar {
    height: 4px;
}
.shop-cat-tabs-scroll::-webkit-scrollbar-track,
.shop-subcat-tabs-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.shop-cat-tabs-scroll::-webkit-scrollbar-thumb,
.shop-subcat-tabs-scroll::-webkit-scrollbar-thumb {
    background: var(--fox-orange-soft);
    border-radius: 999px;
}
.shop-cat-tabs-scroll::-webkit-scrollbar-thumb:hover,
.shop-subcat-tabs-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--fox-orange);
}
.shop-cat-tabs-scroll,
.shop-subcat-tabs-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--fox-orange-soft) transparent;
}
.shop-cat-tabs {
    display: flex;
    gap: 0.6rem;
    min-width: max-content;
}
.cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: all 0.2s ease;
}
.cat-tab:hover {
    border-color: var(--fox-orange);
    color: var(--fox-orange);
}
.cat-tab.active {
    background: var(--fox-orange);
    border-color: var(--fox-orange);
    color: #FFF;
}
.cat-tab.active .cat-tab-count {
    background: rgba(255, 255, 255, 0.25);
    color: #FFF;
}
.cat-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--bg-alt);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}
.cat-tab .subcat-icon {
    font-size: 0.78rem;
    opacity: 0.7;
    margin-left: 2px;
}

/* Subcategory Hierarchy Bar */
.shop-header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}
.shop-header-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}
.shop-header-breadcrumb a:hover {
    color: var(--fox-orange);
}
.shop-header-breadcrumb i {
    font-size: 0.7rem;
    opacity: 0.5;
}
.shop-header-breadcrumb span {
    color: var(--fox-orange);
    font-weight: 600;
}

.shop-subcat-wrapper {
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    box-shadow: var(--shadow-sm);
}
.shop-subcat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.shop-subcat-header strong {
    color: var(--text-main);
}
.shop-subcat-tabs-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.2rem;
}
.shop-subcat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.cat-subtab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.38rem 0.85rem;
    border-radius: 999px;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.cat-subtab:hover {
    border-color: var(--fox-orange);
    color: var(--fox-orange);
}
.cat-subtab.active {
    background: var(--fox-orange-soft);
    border-color: var(--fox-orange);
    color: var(--fox-orange);
    font-weight: 700;
}
.cat-subtab .subtab-arrow {
    color: var(--fox-orange);
    font-weight: bold;
    font-size: 0.95rem;
}
.cat-subtab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.05);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
}
html[data-theme="dark"] .cat-subtab-count {
    background: rgba(255, 255, 255, 0.08);
}
.cat-subtab.active .cat-subtab-count {
    background: var(--fox-orange);
    color: #FFF;
}

/* ==========================================================================
   Shop Main Layout (Desktop Sidebar vs Mobile Tabs & Accordion)
   ========================================================================== */
.shop-main-layout {
    display: flex;
    gap: 1.75rem;
    align-items: flex-start;
    width: 100%;
}
.shop-main-layout.no-sidebar .shop-content {
    width: 100%;
}
.shop-content {
    flex: 1;
    min-width: 0;
}

/* Desktop Sidebar */
.shop-sidebar {
    width: 270px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
}
.shop-sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.15rem 1rem;
    box-shadow: var(--shadow-sm);
}
.shop-sidebar-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.shop-sidebar-title i {
    color: var(--fox-orange);
}

/* Category Vertical Tree Navigation */
.shop-tree-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding-right: 0.25rem;
}
.tree-nav-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.15s ease;
}
.tree-nav-item:hover {
    background: var(--bg-alt);
    color: var(--fox-orange);
}
.tree-nav-item.active {
    background: var(--fox-orange-soft);
    color: var(--fox-orange);
    font-weight: 700;
}
.tree-nav-item.branch-active {
    color: var(--fox-orange);
    font-weight: 600;
}
.tree-bullet {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    opacity: 0.7;
    flex-shrink: 0;
}
.tree-nav-item.active .tree-bullet {
    color: var(--fox-orange);
    opacity: 1;
}
.tree-label {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tree-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.05rem 0.38rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    opacity: 0.75;
    flex-shrink: 0;
    line-height: 1.2;
    transition: all 0.15s ease;
}
html[data-theme="dark"] .tree-count {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
    opacity: 0.65;
}
.tree-nav-item:hover .tree-count {
    opacity: 0.95;
    background: rgba(255, 107, 0, 0.12);
    color: var(--fox-orange);
}
.tree-nav-item.active .tree-count {
    background: rgba(255, 107, 0, 0.18);
    color: var(--fox-orange);
    opacity: 1;
    font-weight: 600;
}
html[data-theme="dark"] .tree-nav-item.active .tree-count {
    background: rgba(255, 107, 0, 0.25);
    color: #FF944D;
    opacity: 1;
    font-weight: 600;
}

/* Tree Nested Children & Multi-Tier Styling */
.tree-branch {
    display: flex;
    flex-direction: column;
}
.tree-row {
    display: flex;
    align-items: center;
    position: relative;
    border-radius: 6px;
    transition: background 0.15s ease;
}
.tree-row:hover {
    background: var(--bg-alt);
}
.tree-row .tree-nav-item {
    flex: 1;
    min-width: 0;
}
.tree-row.active {
    background: var(--fox-orange-soft);
}
.tree-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.72rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 0.25rem;
}
.tree-toggle-btn:hover {
    color: var(--fox-orange);
    background: rgba(0, 0, 0, 0.05);
}
.tree-toggle-btn.expanded i,
.tree-toggle-btn.expanded .bi-chevron-right {
    transform: rotate(90deg);
    color: var(--fox-orange);
}
.tree-children {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-left: 0.75rem;
    padding-left: 0.55rem;
    border-left: 1px dashed var(--border-color);
    margin-top: 0.15rem;
    margin-bottom: 0.25rem;
}
.tree-nav-item.tree-tier-2 {
    font-size: 0.84rem;
    padding: 0.35rem 0.5rem;
}
.tree-nav-item.tree-tier-3 {
    font-size: 0.81rem;
    padding: 0.3rem 0.45rem;
    opacity: 0.95;
}
.tree-nav-item.tree-tier-4 {
    font-size: 0.78rem;
    padding: 0.28rem 0.4rem;
    opacity: 0.9;
}
.tree-arrow {
    font-size: 0.78rem;
    color: var(--fox-orange);
    font-weight: 700;
    opacity: 0.85;
}

/* Mobile Category Drawer / Toggle */
.shop-sidebar-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}
.shop-sidebar-toggle:hover {
    border-color: var(--fox-orange);
}
.shop-sidebar-toggle .toggle-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.shop-sidebar-toggle .toggle-text i {
    color: var(--fox-orange);
}
.shop-sidebar-toggle .toggle-chevron {
    transition: transform 0.2s ease;
}
.shop-sidebar-toggle.open .toggle-chevron {
    transform: rotate(180deg);
}

/* Option 2: Top Quick Tabs Layout */
.shop-tabs-layout-top {
    margin-bottom: 0.5rem;
}

/* Desktop vs Mobile Media Queries */
@media (min-width: 992px) {
    .shop-mobile-quicktabs,
    .shop-sidebar-mobile-cascading {
        display: none !important;
    }
    .shop-sidebar-desktop-only {
        display: block !important;
    }
}

@media (max-width: 991px) {
    .shop-main-layout {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .shop-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .shop-sidebar {
        width: 100%;
        position: static;
    }
    .shop-sidebar-desktop-only {
        display: none !important;
    }
    .shop-sidebar-mobile-cascading {
        display: block;
        margin-bottom: 0.5rem;
    }
    .shop-sidebar-toggle {
        display: flex;
    }
    .shop-mob-cat-count {
        font-size: 0.76rem;
        color: var(--fox-orange);
        font-weight: 700;
        margin-left: auto;
        margin-right: 0.4rem;
        background: var(--fox-orange-soft);
        padding: 0.1rem 0.45rem;
        border-radius: 999px;
    }
    .shop-mob-cat-drawer {
        display: none;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 0.85rem;
        margin-bottom: 1rem;
        box-shadow: var(--shadow-sm);
        animation: fadeIn 0.2s ease;
    }
    .shop-mob-cat-drawer.show {
        display: block;
    }
    .shop-mobile-quicktabs {
        display: block;
    }
}

/* Shop Filter Bar */
.shop-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}
.shop-filter-search {
    position: relative;
    flex: 1;
    min-width: 240px;
}
.shop-filter-search .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.shop-filter-search input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}
.shop-filter-search input:focus {
    border-color: var(--fox-orange);
}
.shop-filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}
.shop-select {
    padding: 0.6rem 2rem 0.6rem 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23695D53' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}
html[data-theme="dark"] .shop-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
.shop-filter-btn {
    padding: 0.6rem 1.25rem;
}
.shop-reset-btn {
    padding: 0.6rem 1rem;
}

/* Product Grid & Cards */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.product-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: var(--shadow-sm);
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--fox-orange);
}
.product-card.out-of-stock {
    opacity: 0.85;
}
.product-card-thumb-wrapper {
    position: relative;
    width: 100%;
    padding-top: 66.66%; /* 3:2 Aspect ratio */
    background: var(--bg-alt);
    overflow: hidden;
}
.product-card-thumb {
    position: absolute;
    inset: 0;
    display: block;
}
.product-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.product-card:hover .product-card-thumb img {
    transform: scale(1.05);
}
.product-badges-corner {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    z-index: 2;
    pointer-events: none;
}
.badge-condition {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    backdrop-filter: blur(6px);
}
.badge-condition.condition-new {
    background: rgba(16, 185, 129, 0.92);
    color: #FFF;
}
.badge-condition.condition-like-new {
    background: rgba(2, 132, 199, 0.92);
    color: #FFF;
}
.badge-condition.condition-used-good {
    background: var(--fox-orange);
    color: #FFF;
}
.badge-condition.condition-used-fair {
    background: rgba(100, 116, 139, 0.92);
    color: #FFF;
}
.badge-condition.condition-refurbished {
    background: rgba(139, 92, 246, 0.92);
    color: #FFF;
}
.badge-discount {
    align-self: flex-start;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: #E11D48;
    color: #FFF;
    font-size: 0.72rem;
    font-weight: 800;
}
.out-of-stock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}
.out-of-stock-overlay span {
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    background: #DC2626;
    color: #FFF;
    font-weight: 700;
    font-size: 0.85rem;
}

.product-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.15rem;
}
.product-card-cat a {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--fox-orange);
    text-decoration: none;
    text-transform: uppercase;
}
.product-card-title {
    margin: 0.35rem 0 0.5rem 0;
    font-size: 1.05rem;
    line-height: 1.4;
    font-weight: 700;
}
.product-card-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s ease;
}
.product-card-title a:hover {
    color: var(--fox-orange);
}
.product-card-warranty {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.product-card-warranty i {
    color: #10B981;
}
.product-card-specs {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.spec-chip {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.spec-chip strong {
    color: var(--text-main);
}
.product-card-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-color);
}
.product-card-price {
    display: flex;
    flex-direction: column;
}
.price-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--fox-orange);
    line-height: 1.2;
}
.compare-price-val {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
}
.stock-status-pill.out {
    font-size: 0.8rem;
    color: #DC2626;
    font-weight: 600;
}

/* Product Detail Page */
.breadcrumb-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}
.breadcrumb-nav a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}
.breadcrumb-nav a:hover {
    color: var(--fox-orange);
}
.breadcrumb-nav .sep {
    color: var(--border-color);
}
.breadcrumb-nav .current {
    color: var(--text-main);
    font-weight: 600;
}

.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}
@media (max-width: 900px) {
    .product-detail-layout {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
}
.product-main-image-box {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding-top: 75%; /* 4:3 Aspect */
}
.main-product-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bg-alt);
    padding: 0.75rem;
}
.product-thumb-strip {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}
.gallery-thumb-btn {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    padding: 2px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
}
.gallery-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}
.gallery-thumb-btn:hover {
    border-color: var(--fox-orange-hover);
}
.gallery-thumb-btn.active {
    border-color: var(--fox-orange);
    box-shadow: 0 0 0 2px var(--fox-orange-soft);
}
.shop-trust-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.15rem 1.25rem;
    margin-top: 1.25rem;
}
.trust-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.trust-icon {
    font-size: 1.35rem;
    color: var(--fox-orange);
    flex-shrink: 0;
}
.trust-item strong {
    display: block;
    font-size: 0.92rem;
    color: var(--text-main);
}
.trust-item small {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.product-info-container {
    display: flex;
    flex-direction: column;
}
.product-meta-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}
.product-cat-pill {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: var(--fox-orange-soft);
    color: var(--fox-orange);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
}
.product-sku-code {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.product-page-title {
    font-size: 1.75rem;
    line-height: 1.35;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 1.25rem 0;
}
.product-page-excerpt {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin: -0.65rem 0 1.25rem 0;
}
.condition-callout-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
}
.condition-callout-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.condition-callout-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}
.condition-callout-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.warranty-callout-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.5rem;
}
.warranty-callout-icon {
    font-size: 1.5rem;
    color: #10B981;
    flex-shrink: 0;
}
.warranty-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
}
.warranty-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Product Card Variants Badge (Catalog Grid) */
.product-card-variants-badge {
    margin: -0.25rem 0 0.55rem 0;
}
.variant-count-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.55rem;
    border-radius: 6px;
    background: var(--fox-orange-soft);
    color: var(--fox-orange);
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.18s ease;
}
.variant-count-pill:hover {
    background: var(--fox-orange);
    color: #fff;
}

/* Sibling Variants Switcher Box (Product Detail Page) */
.product-variants-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.variants-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.variants-box-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.variants-box-title i {
    color: var(--fox-orange);
}
.variants-current-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--fox-orange);
    background: var(--fox-orange-soft);
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}
.variants-pills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}
.variant-pill-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-alt);
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.18s ease;
    min-width: 110px;
}
.variant-pill-btn:hover {
    border-color: var(--fox-orange);
    background: var(--bg-card);
    transform: translateY(-1px);
}
.variant-pill-btn.active {
    border-color: var(--fox-orange);
    background: var(--fox-orange-soft);
    box-shadow: 0 0 0 1px var(--fox-orange);
}
.variant-pill-btn.out-of-stock {
    opacity: 0.6;
    border-style: dashed;
}
.variant-pill-main {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
}
.variant-pill-btn.active .variant-pill-main {
    color: var(--fox-orange);
}
.variant-check-icon {
    color: var(--fox-orange);
    font-size: 0.9rem;
}
.variant-pill-sub {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    color: var(--text-muted);
}
.variant-pill-price {
    font-weight: 600;
}
.variant-pill-soldout {
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    background: rgba(220, 38, 38, 0.12);
    color: #DC2626;
    font-size: 0.68rem;
    font-weight: 700;
}

.product-price-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.price-main {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--fox-orange);
    line-height: 1;
}
.price-compare {
    font-size: 1.15rem;
    color: var(--text-muted);
    text-decoration: line-through;
}
.price-savings {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: rgba(225, 29, 72, 0.1);
    color: #E11D48;
    font-size: 0.85rem;
    font-weight: 700;
}
.stock-status-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    font-weight: 600;
}
.stock-status-indicator.in-stock {
    color: #10B981;
}
.stock-status-indicator.out-of-stock {
    color: #DC2626;
}

.product-actions-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.qty-stepper-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
}
.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    overflow: hidden;
}
.stepper-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}
.stepper-btn:hover {
    background: var(--bg-alt);
}
.qty-stepper input {
    width: 48px;
    height: 38px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    outline: none;
}
.purchase-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}
.btn-line-chat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    background: #06C755;
    color: #FFF;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    transition: background 0.2s ease, transform 0.15s ease;
}
.btn-line-chat:hover {
    background: #05B34C;
    transform: translateY(-2px);
    color: #FFF;
}

.product-details-content-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm);
}
.section-subheading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 1.25rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--fox-orange);
}
.specs-table-wrapper {
    overflow-x: auto;
    margin-bottom: 2rem;
}
.specs-table {
    width: 100%;
    border-collapse: collapse;
}
.specs-table tr {
    border-bottom: 1px solid var(--border-color);
}
.specs-table tr:last-child {
    border-bottom: none;
}
.spec-label {
    width: 30%;
    padding: 0.75rem 1rem 0.75rem 0;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.92rem;
}
.spec-value {
    padding: 0.75rem 0;
    color: var(--text-main);
    font-size: 0.95rem;
}
.product-rich-description {
    line-height: 1.7;
    font-size: 1rem;
    color: var(--text-main);
}

/* Cart & Free Shipping Meter */
.free-shipping-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow-sm);
}
.free-shipping-card.achieved {
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.06);
}
.free-shipping-text {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}
.free-shipping-badge {
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    background: var(--fox-orange);
    color: #FFF;
    font-size: 0.75rem;
    font-weight: 700;
}
.free-shipping-card.achieved .free-shipping-badge {
    background: #10B981;
}
.free-shipping-progress {
    height: 8px;
    border-radius: 4px;
    background: var(--bg-alt);
    overflow: hidden;
}
.free-shipping-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--fox-orange), #10B981);
    transition: width 0.4s ease;
}

.cart-layout-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 2rem;
    align-items: flex-start;
}
@media (max-width: 900px) {
    .cart-layout-grid {
        grid-template-columns: 1fr;
    }
}

.cart-table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}
.cart-table {
    width: 100%;
    border-collapse: collapse;
}
.cart-table th {
    padding: 1rem 1.25rem;
    background: var(--bg-alt);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.88rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.cart-table td {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.cart-item-product {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 240px;
}
.cart-item-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-alt);
    overflow: hidden;
    flex-shrink: 0;
}
.cart-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cart-item-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    line-height: 1.35;
}
.cart-item-title:hover {
    color: var(--fox-orange);
}
.cart-item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
    font-size: 0.78rem;
}
.cart-item-sku {
    color: var(--text-muted);
}
.badge-condition-mini {
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}
.badge-condition-mini.condition-new { background: rgba(16, 185, 129, 0.15); color: #10B981; }
.badge-condition-mini.condition-like-new { background: rgba(2, 132, 199, 0.15); color: #0284C7; }
.badge-condition-mini.condition-used-good { background: var(--fox-orange-soft); color: var(--fox-orange); }

.cart-qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-card);
    overflow: hidden;
}
.cart-qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-qty-btn:hover {
    background: var(--bg-alt);
}
.cart-qty-val {
    width: 32px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
}
.cart-stock-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.cart-remove-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.15rem;
    transition: color 0.15s ease;
}
.cart-remove-btn:hover {
    color: #DC2626;
}
.cart-actions-row {
    margin-top: 1.25rem;
}

.cart-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 90px;
}
.summary-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 1.25rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}
.free-shipping-text-green {
    color: #10B981;
    font-weight: 700;
}
.summary-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1rem 0;
}
.grand-total-row {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}
.grand-total-val {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--fox-orange);
}
.summary-actions {
    margin-top: 1.25rem;
}
.summary-guarantees {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.summary-guarantees i {
    color: var(--fox-orange);
}

/* Checkout Page */
.checkout-layout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: flex-start;
}
@media (max-width: 900px) {
    .checkout-layout-grid {
        grid-template-columns: 1fr;
    }
}
.checkout-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.checkout-card-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border-color);
}
.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--fox-orange);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.88rem;
}
.checkout-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}
.checkout-card-body {
    padding: 1.5rem;
}

/* Checkout Form Fields & Layout */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
@media (max-width: 768px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
}
.form-label.required::after {
    content: " *";
    color: #E11D48;
    font-weight: 700;
}

.form-control {
    width: 100%;
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}
.form-control:focus {
    border-color: var(--fox-orange);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 3px var(--fox-orange-soft);
}
textarea.form-control {
    min-height: 95px;
    resize: vertical;
}

.form-control-file {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}
.form-control-file:hover {
    border-color: var(--fox-orange);
}

.alert-danger {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid #DC2626;
    color: #DC2626;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-methods-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.payment-method-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    background: var(--bg-card);
    transition: all 0.2s ease;
}
.payment-method-item:hover {
    border-color: var(--fox-orange-hover);
}
.payment-method-item.selected {
    border-color: var(--fox-orange);
    background: var(--fox-orange-soft);
}
.payment-method-item input[type="radio"] {
    margin-top: 0.35rem;
    accent-color: var(--fox-orange);
}
.payment-method-body {
    flex: 1;
}
.payment-method-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}
.badge-recommended {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: #10B981;
    color: #FFF;
    font-size: 0.72rem;
    font-weight: 700;
}
.badge-stripe {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: #6366F1;
    color: #FFF;
    font-size: 0.72rem;
    font-weight: 700;
}
.payment-method-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.payment-details-panel {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}
.bank-info-box {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.promptpay-qr-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}
.promptpay-qr-img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    border-radius: 6px;
    background: #FFF;
    padding: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.qr-caption {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.bank-accounts-text {
    flex: 1;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-main);
}
.slip-upload-group {
    margin-top: 0.75rem;
}

.checkout-items-preview {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    max-height: 260px;
    overflow-y: auto;
}
.checkout-item-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.checkout-item-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg-alt);
}
.checkout-item-details {
    flex: 1;
    min-width: 0;
}
.checkout-item-title {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.checkout-item-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.checkout-item-subtotal {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Order Success & Order Track */
.order-success-card {
    max-width: 780px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
}
@media (max-width: 600px) {
    .order-success-card {
        padding: 1.5rem;
    }
}
.success-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
    color: #10B981;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.25rem auto;
}
.order-success-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 0.5rem 0;
}
.order-success-sub {
    font-size: 0.98rem;
    color: var(--text-muted);
    margin: 0 0 1.5rem 0;
}
.order-badge-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.order-num-pill, .order-date-pill {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: var(--bg-alt);
    font-size: 0.88rem;
    color: var(--text-main);
}
.order-num-pill strong {
    color: var(--fox-orange);
    letter-spacing: 0.5px;
}
.order-status-banner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 2rem;
    text-align: left;
}
@media (max-width: 600px) {
    .order-status-banner {
        grid-template-columns: 1fr;
    }
}
.status-col .status-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.slip-reupload-box {
    margin-bottom: 2rem;
    text-align: left;
}
.slip-already-uploaded {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid #10B981;
    border-radius: 10px;
    padding: 1rem;
}
.slip-preview-thumb {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.slip-needed-prompt {
    display: flex;
    gap: 1.25rem;
    background: var(--fox-orange-soft);
    border: 1px dashed var(--fox-orange);
    border-radius: 10px;
    padding: 1.25rem;
}
.prompt-icon {
    font-size: 2rem;
    color: var(--fox-orange);
}
.line-order-notify-box {
    margin-bottom: 2rem;
}

.order-items-breakdown {
    text-align: left;
    margin-bottom: 2rem;
}
.breakdown-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
}
.order-items-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.order-table {
    width: 100%;
    border-collapse: collapse;
}
.order-table th {
    padding: 0.75rem 1rem;
    background: var(--bg-alt);
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.order-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}
.order-item-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.order-item-img {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
}
.order-table tfoot td {
    background: var(--bg-main);
    font-weight: 600;
}
.grand-total-tr td {
    font-size: 1.05rem;
}
.grand-total-cell {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--fox-orange);
}
.order-shipping-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    text-align: left;
}
@media (max-width: 600px) {
    .order-shipping-info-grid {
        grid-template-columns: 1fr;
    }
}
.info-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
}
.info-card h4 {
    margin: 0 0 0.85rem 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.info-card p {
    margin: 0 0 0.5rem 0;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.info-card p strong {
    color: var(--text-main);
}

/* Order Tracking Page */
.track-input-group {
    display: flex;
    gap: 0.5rem;
    max-width: 540px;
    margin: 0 auto;
}
.track-input {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
}
.track-input:focus {
    border-color: var(--fox-orange);
}
.track-btn {
    border-radius: 999px;
    padding: 0.75rem 1.5rem;
}
.tracked-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-alt);
}
.order-no-txt {
    color: var(--fox-orange);
    font-size: 1.05rem;
}
.order-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    overflow-x: auto;
}
.order-timeline::before {
    content: '';
    position: absolute;
    top: 2.85rem;
    left: 2.5rem;
    right: 2.5rem;
    height: 3px;
    background: var(--border-color);
    z-index: 1;
}
.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    position: relative;
    z-index: 2;
    min-width: 70px;
}
.timeline-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}
.timeline-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}
.timeline-step.completed .timeline-dot {
    background: #10B981;
    border-color: #10B981;
    color: #FFF;
}
.timeline-step.completed .timeline-label {
    color: #10B981;
}
.timeline-step.active .timeline-dot {
    background: var(--fox-orange);
    border-color: var(--fox-orange);
    color: #FFF;
    box-shadow: 0 0 0 4px var(--fox-orange-soft);
}
.timeline-step.active .timeline-label {
    color: var(--fox-orange);
}

.tracking-carrier-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(2, 132, 199, 0.08);
    border: 1px solid #0284C7;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 0 1.5rem 1.5rem 1.5rem;
}
.carrier-icon-col {
    font-size: 1.8rem;
    color: #0284C7;
}
.carrier-info-col {
    flex: 1;
}
.carrier-name {
    font-size: 0.88rem;
    color: var(--text-muted);
}
.tracking-number-code {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}
.carrier-track-btn {
    border-radius: 999px;
}
.tracked-order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* =========================================================================
   Global Search Page (/search/)
   ========================================================================= */
.search-hero-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 16px);
    padding: 2rem 2rem 1.75rem;
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
}
.search-hero-box .directory-title {
    margin: 0.5rem 0 0.4rem;
}
.search-query-text {
    color: var(--fox-orange);
}
.search-hero-box .directory-subtitle {
    margin-bottom: 1.35rem;
}
.global-search-form {
    max-width: 720px;
    margin: 0 auto;
}
.global-search-input-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    border-radius: 999px;
    padding: 0.35rem 0.4rem 0.35rem 1.15rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.global-search-input-wrap:focus-within {
    border-color: var(--fox-orange);
    box-shadow: 0 0 0 4px var(--fox-orange-soft);
}
.global-search-icon {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-right: 0.65rem;
    flex-shrink: 0;
}
.global-search-input-wrap input[type="search"] {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    padding: 0.45rem 0.5rem 0.45rem 0;
    outline: none;
    min-width: 0;
}
.global-search-input-wrap input[type="search"]::-webkit-search-cancel-button {
    display: none;
}
.global-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-muted);
    text-decoration: none;
    margin-right: 0.35rem;
    transition: background 0.15s ease, color 0.15s ease;
}
.global-search-clear:hover {
    background: var(--bg-alt);
    color: var(--text-main);
}
.global-search-btn {
    border-radius: 999px !important;
    padding: 0.55rem 1.5rem !important;
    font-weight: 600;
    flex-shrink: 0;
}

.search-terms-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 1rem;
    font-size: 0.85rem;
}
.terms-label {
    color: var(--text-muted);
}
.term-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: var(--fox-orange-soft);
    color: var(--fox-orange);
    font-weight: 600;
    font-size: 0.8rem;
}

/* Filter Tabs */
.search-tabs-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.85rem;
}
.search-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: all 0.2s ease;
}
.search-tab:hover {
    border-color: var(--fox-orange);
    color: var(--fox-orange);
}
.search-tab.active {
    background: var(--fox-orange);
    border-color: var(--fox-orange);
    color: var(--fox-primary-btn-text, #FFFFFF);
}
.search-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: var(--bg-alt);
    color: var(--text-main);
    font-size: 0.76rem;
    font-weight: 700;
}
.search-tab.active .search-tab-count {
    background: rgba(255, 255, 255, 0.22);
    color: inherit;
}

/* Search Result Cards */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.search-result-card {
    display: flex;
    align-items: stretch;
    gap: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 12px);
    padding: 1.15rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.search-result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--fox-orange);
}
.search-result-media {
    width: 170px;
    min-height: 118px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-alt);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.search-result-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.search-result-card:hover .search-result-media img {
    transform: scale(1.04);
}
.search-result-placeholder {
    width: 100%;
    height: 100%;
    min-height: 118px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fox-orange-soft);
    color: var(--fox-orange);
    font-size: 2.1rem;
}
.search-result-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.search-result-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.search-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.18rem 0.6rem;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
}
.search-type-badge.badge-page {
    background: rgba(59, 130, 246, 0.12);
    color: #2563EB;
}
html[data-theme="dark"] .search-type-badge.badge-page {
    background: rgba(96, 165, 250, 0.18);
    color: #60A5FA;
}
.search-type-badge.badge-post {
    background: var(--fox-orange-soft);
    color: var(--fox-orange);
}
.search-type-badge.badge-product {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}
html[data-theme="dark"] .search-type-badge.badge-product {
    background: rgba(52, 211, 153, 0.18);
    color: #34D399;
}
.search-meta-cat {
    font-weight: 600;
    color: var(--text-main);
}
.search-result-title {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
    line-height: 1.4;
    font-weight: 700;
}
.search-result-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.15s ease;
}
.search-result-title a:hover {
    color: var(--fox-orange);
}
.search-result-snippet {
    margin: 0 0 0.75rem;
    font-size: 0.94rem;
    line-height: 1.6;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
mark.search-highlight {
    background: var(--fox-orange-soft);
    color: var(--fox-orange);
    font-weight: 600;
    padding: 0.05rem 0.28rem;
    border-radius: 4px;
}
.search-result-footer {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color);
}
.search-result-url {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 340px;
}
.search-product-price {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}
.search-result-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--fox-orange);
    text-decoration: none;
    margin-left: auto;
}
.search-result-link:hover {
    text-decoration: underline;
}

/* Search Empty State */
.search-empty-state {
    padding: 3rem 1.5rem;
}
.search-empty-icon {
    font-size: 2.5rem;
    color: var(--fox-orange);
    margin-bottom: 0.65rem;
}
.search-quick-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.15rem;
}

@media (max-width: 768px) {
    .search-hero-box {
        padding: 1.35rem 1.1rem;
    }
    .global-search-input-wrap {
        padding: 0.25rem 0.3rem 0.25rem 0.9rem;
    }
    .global-search-btn {
        padding: 0.5rem 1.1rem !important;
    }
    .search-result-card {
        flex-direction: column;
        gap: 0.9rem;
    }
    .search-result-media {
        width: 100%;
        height: 175px;
    }
    .search-result-url {
        max-width: 190px;
    }
}

/* =========================================================================
   Modular Header Search Options ('icon' Popover & 'bar' Inline)
   ========================================================================= */
.header-search-pop-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.header-search-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 290px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 210;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}
.header-search-popover.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.header-popover-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.header-popover-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
}
.header-popover-form input[type="search"]:focus {
    border-color: var(--fox-orange);
}
.header-popover-form button {
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    flex-shrink: 0;
}

.header-search-bar {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.28rem 0.75rem;
    width: 200px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.header-search-bar:focus-within {
    border-color: var(--fox-orange);
    box-shadow: 0 0 0 3px var(--fox-orange-soft);
}
.header-search-bar i {
    color: var(--text-muted);
    font-size: 0.88rem;
}
.header-search-bar input[type="search"] {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 0.86rem;
    font-family: inherit;
    outline: none;
    padding: 0.15rem 0;
}
.header-search-bar input[type="search"]::-webkit-search-cancel-button {
    display: none;
}

/* =========================================================================
   Brand Logo Display Modes (Square + Text, Wide Rectangular Only, Wide + Text)
   ========================================================================= */
.brand-logo img {
    object-fit: contain;
    flex-shrink: 0;
}
body.logo-mode-wide_only .brand-logo img,
body.logo-mode-wide_text .brand-logo img,
.brand-logo.logo-mode-wide_only img,
.brand-logo.logo-mode-wide_text img {
    width: auto !important;
    height: 42px !important;
    max-width: 220px;
    object-fit: contain;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
}
body.logo-mode-wide_only .site-header.header-style-minimal .brand-logo img,
body.logo-mode-wide_text .site-header.header-style-minimal .brand-logo img,
body.logo-mode-wide_only .mobile-drawer .brand-logo img,
body.logo-mode-wide_text .mobile-drawer .brand-logo img,
body.logo-mode-wide_only .site-footer.footer-style-minimal .brand-logo img,
body.logo-mode-wide_text .site-footer.footer-style-minimal .brand-logo img {
    height: 36px !important;
    max-width: 185px;
}
body.logo-mode-wide_only .site-footer.footer-style-stacked .brand-logo img,
body.logo-mode-wide_text .site-footer.footer-style-stacked .brand-logo img {
    height: 52px !important;
    max-width: 240px;
}
body.logo-mode-wide_only .brand-logo .brand-text,
body.logo-mode-wide_only .brand-logo > .brand-name,
.brand-logo.logo-mode-wide_only .brand-text,
.brand-logo.logo-mode-wide_only > .brand-name {
    display: none !important;
}

/* =========================================================================
   Modular Header Templates (1: Classic, 2: Two-Tier, 3: Split, 4: Minimal)
   & Tri-Color CI Tones (brand, deep, surface)
   ========================================================================= */

/* Header 2: Two-Tier Nav (แยก 2 ชั้น — แถบเมนูคาดเต็มจอ) */
.site-header.header-style-centered {
    padding: 0;
}
.header-centered-top-wrap {
    padding: 0.65rem 0;
}
.header-centered-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.header-centered-top .brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}
.header-centered-top .header-actions {
    justify-content: flex-end;
}
.header-centered-bar {
    width: 100%;
    background: var(--bg-alt);
    border-top: 1px solid var(--border-color);
    border-bottom: 2px solid var(--hc-brand-bg, var(--fox-orange));
}
.header-centered-nav {
    justify-content: center;
    border-top: none;
    padding: 0;
    min-height: 46px;
    align-items: stretch;
    gap: 0.15rem;
}
.site-header.header-style-centered .header-centered-nav .nav-item {
    display: inline-flex;
    align-items: center;
    padding: 0 1.25rem;
    border-radius: 0;
    font-weight: 600;
}

/* Header 3: Top Bar & Split Navigation */
.site-header.header-style-split {
    padding-top: 0;
    border-bottom: 2px solid var(--hc-brand-bg, var(--fox-orange));
}
.site-header.header-style-split .header-inner {
    height: 68px;
}
.site-header.header-style-split .header-split-right,
.site-header.header-style-split .desktop-nav {
    height: 100%;
    align-items: stretch;
    gap: 0.15rem;
}
.site-header.header-style-split .nav-item {
    display: inline-flex;
    align-items: center;
    padding: 0 1.15rem;
    border-radius: 0;
    font-weight: 600;
}
.site-header.header-style-split .header-actions .btn-primary {
    border-radius: 999px !important;
    padding-left: 1.15rem;
    padding-right: 1.15rem;
}
.header-topbar {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 0.38rem 0;
}
.header-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.topbar-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-muted);
    text-decoration: none;
}
.topbar-item i {
    color: var(--fox-orange);
}
.topbar-link:hover {
    color: var(--fox-orange);
}
.header-mini-socials {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}
.header-mini-socials a {
    color: var(--text-muted);
    font-size: 0.88rem;
    transition: color 0.15s ease, transform 0.15s ease;
}
.header-mini-socials a:hover {
    color: var(--fox-orange);
    transform: translateY(-1px);
}
.header-split-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

/* Header 4: Minimal Clean */
.site-header.header-style-minimal .header-inner {
    min-height: 58px;
}
.header-minimal-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.site-header.header-style-minimal .brand-logo img {
    border-width: 1.5px;
    border-radius: 8px;
}
.site-header.header-style-minimal .brand-name {
    font-size: 1.12rem;
}

/* -------------------------------------------------------------------------
   Header Tri-Color Mode 1: 'brand' (60 · 30 · 10 Signature Archetypes)
   ------------------------------------------------------------------------- */

/* [Brand Mode] Header 1: Classic Fox — Full 30% Brand Bar + 10% Accent Active/CTA (HomePro Style) */
.site-header.header-style-classic.header-tone-brand {
    background: var(--hc-brand-bg, var(--fox-orange));
    border-bottom: 3px solid var(--hc-accent-bg, var(--brand-accent));
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.10);
}
.site-header.header-style-classic.header-tone-brand .brand-logo,
.site-header.header-style-classic.header-tone-brand .brand-name {
    color: var(--hc-brand-text, #FFFFFF) !important;
}
.site-header.header-style-classic.header-tone-brand .brand-sub {
    color: var(--hc-brand-muted, rgba(255,255,255,0.82)) !important;
}
.site-header.header-style-classic.header-tone-brand .brand-logo img {
    border-color: var(--hc-accent-pop, #FFFFFF);
    background: #FFFFFF;
}
.site-header.header-style-classic.header-tone-brand .nav-item {
    color: var(--hc-brand-text, #FFFFFF);
    font-weight: 600;
    border-radius: 8px;
    padding: 0.48rem 0.95rem;
}
.site-header.header-style-classic.header-tone-brand .nav-item:hover {
    background: var(--hc-brand-soft, rgba(255,255,255,0.15));
    color: var(--hc-brand-text, #FFFFFF);
}
.site-header.header-style-classic.header-tone-brand .nav-item.active {
    background: var(--hc-brand-soft, rgba(255,255,255,0.18));
    color: var(--hc-brand-text, #FFFFFF);
    font-weight: 700;
    box-shadow: inset 0 -3px 0 var(--hc-accent-pop, #FFFFFF);
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
}
.site-header.header-style-classic.header-tone-brand .header-search-bar {
    background: #FFFFFF;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.site-header.header-style-classic.header-tone-brand .header-search-bar i {
    color: var(--hc-accent-bg, var(--fox-orange));
}
.site-header.header-style-classic.header-tone-brand .header-search-bar input[type="search"] {
    color: #111827;
}
.site-header.header-style-classic.header-tone-brand .header-search-bar input[type="search"]::placeholder {
    color: #6B7280;
}
.site-header.header-style-classic.header-tone-brand .icon-btn,
.site-header.header-style-classic.header-tone-brand .hamburger-btn {
    background: var(--hc-brand-soft, rgba(255,255,255,0.15));
    border-color: var(--hc-brand-border, rgba(255,255,255,0.22));
    color: var(--hc-brand-text, #FFFFFF);
}
.site-header.header-style-classic.header-tone-brand .hamburger-btn span {
    background: var(--hc-brand-text, #FFFFFF);
}
.site-header.header-style-classic.header-tone-brand .icon-btn:hover {
    background: var(--hc-accent-bg, #2C1A11);
    border-color: var(--hc-accent-bg, #2C1A11);
    color: var(--hc-accent-text, #FFFFFF);
}
.site-header.header-style-classic.header-tone-brand .cart-badge-count {
    background: var(--hc-accent-bg, #2C1A11) !important;
    color: var(--hc-accent-text, #FFFFFF) !important;
    border: 2px solid var(--hc-brand-bg, #E86A17);
}
.site-header.header-style-classic.header-tone-brand .header-actions .btn-primary {
    background: var(--hc-accent-bg, #2C1A11) !important;
    color: var(--hc-accent-text, #FFFFFF) !important;
    border-color: var(--hc-accent-bg, #2C1A11) !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}
.site-header.header-style-classic.header-tone-brand .header-actions .btn-outline,
.site-header.header-style-classic.header-tone-brand .user-pill {
    background: var(--hc-brand-soft, rgba(255,255,255,0.15));
    border-color: var(--hc-brand-border, rgba(255,255,255,0.28));
    color: var(--hc-brand-text, #FFFFFF) !important;
}

/* [Brand Mode] Header 2: Two-Tier Nav — 60% Surface Top + Full-Width 30% Brand Bar + 10% Accent Active Block (Siriwan Style) */
.site-header.header-style-centered.header-tone-brand {
    background: var(--bg-card);
    border-bottom: none;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.site-header.header-style-centered.header-tone-brand .header-centered-top-wrap {
    background: var(--bg-card);
    padding: 0.65rem 0;
}
.site-header.header-style-centered.header-tone-brand .header-search-bar {
    border-color: var(--hc-accent-bg, var(--fox-orange));
}
.site-header.header-style-centered.header-tone-brand .header-search-bar i {
    color: var(--hc-accent-bg, var(--fox-orange));
}
.site-header.header-style-centered.header-tone-brand .header-actions .btn-primary {
    background: var(--hc-accent-bg, var(--brand-accent)) !important;
    color: var(--hc-accent-text, #FFFFFF) !important;
    border-color: var(--hc-accent-bg, var(--brand-accent)) !important;
}
.site-header.header-style-centered.header-tone-brand .header-centered-bar {
    background: var(--hc-brand-bg, var(--fox-orange));
    border-top: 1px solid var(--hc-brand-border, rgba(255,255,255,0.15));
    border-bottom: 2px solid var(--hc-brand-bg-darker, var(--fox-orange-hover));
}
.site-header.header-style-centered.header-tone-brand .header-centered-nav {
    border-top: none;
    padding: 0;
    min-height: 46px;
    align-items: stretch;
    gap: 0.15rem;
}
.site-header.header-style-centered.header-tone-brand .header-centered-nav .nav-item {
    display: inline-flex;
    align-items: center;
    padding: 0 1.25rem;
    border-radius: 0;
    color: var(--hc-brand-text, #FFFFFF);
    font-weight: 600;
}
.site-header.header-style-centered.header-tone-brand .header-centered-nav .nav-item:hover {
    background: var(--hc-brand-soft, rgba(255,255,255,0.16));
    color: var(--hc-brand-text, #FFFFFF);
}
.site-header.header-style-centered.header-tone-brand .header-centered-nav .nav-item.active {
    background: var(--hc-accent-bg, #2C1A11);
    color: var(--hc-accent-text, #FFFFFF);
    font-weight: 700;
}

/* [Brand Mode] Header 3: Top Bar & Split — Solid Deep Topbar + Full-Height 30% Brand Active Block + 10% Accent Pill CTA (Kookkaeagraph Style) */
.site-header.header-style-split.header-tone-brand {
    background: var(--bg-card);
    border-bottom: 2px solid var(--hc-brand-bg, var(--fox-orange));
}
.site-header.header-style-split.header-tone-brand .header-topbar {
    background: var(--hc-topbar-bg, #2C1A11);
    color: var(--hc-topbar-text, #FFFFFF);
    border-bottom: none;
    padding: 0.42rem 0;
}
.site-header.header-style-split.header-tone-brand .topbar-item,
.site-header.header-style-split.header-tone-brand .header-mini-socials a {
    color: var(--hc-topbar-text, #FFFFFF);
    opacity: 0.92;
}
.site-header.header-style-split.header-tone-brand .topbar-item i {
    color: var(--fc-deep-heading, #FDBA74);
}
.site-header.header-style-split.header-tone-brand .topbar-link:hover,
.site-header.header-style-split.header-tone-brand .header-mini-socials a:hover {
    color: var(--fc-deep-heading, #FDBA74);
    opacity: 1;
}
.site-header.header-style-split.header-tone-brand .header-inner {
    height: 68px;
}
.site-header.header-style-split.header-tone-brand .header-split-right,
.site-header.header-style-split.header-tone-brand .desktop-nav {
    height: 100%;
    align-items: stretch;
    gap: 0.15rem;
}
.site-header.header-style-split.header-tone-brand .nav-item {
    display: inline-flex;
    align-items: center;
    padding: 0 1.15rem;
    border-radius: 0;
    font-weight: 600;
}
.site-header.header-style-split.header-tone-brand .nav-item:hover {
    background: var(--fox-orange-soft);
    color: var(--fox-orange);
}
.site-header.header-style-split.header-tone-brand .nav-item.active {
    background: var(--hc-brand-bg, var(--fox-orange));
    color: var(--hc-brand-text, #FFFFFF);
    font-weight: 700;
}
.site-header.header-style-split.header-tone-brand .header-actions .btn-primary {
    background: var(--hc-accent-bg, var(--brand-accent)) !important;
    color: var(--hc-accent-text, #FFFFFF) !important;
    border-color: var(--hc-accent-bg, var(--brand-accent)) !important;
    border-radius: 999px !important;
    padding-left: 1.15rem;
    padding-right: 1.15rem;
}

/* [Brand Mode] Header 4: Minimal Clean — Top Tri-Color Ribbon + Solid Brand Pill Nav + Accent CTA */
.site-header.header-style-minimal.header-tone-brand {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
}
.site-header.header-style-minimal.header-tone-brand::before {
    content: "";
    display: block;
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, var(--hc-brand-bg) 0%, var(--hc-brand-bg) 68%, var(--hc-accent-bg) 68%, var(--hc-accent-bg) 100%);
}
.site-header.header-style-minimal.header-tone-brand .nav-item {
    border-radius: 999px;
    padding: 0.38rem 0.95rem;
    font-weight: 600;
}
.site-header.header-style-minimal.header-tone-brand .nav-item.active {
    background: var(--hc-brand-bg, var(--fox-orange));
    color: var(--hc-brand-text, #FFFFFF);
}
.site-header.header-style-minimal.header-tone-brand .header-actions .btn-primary {
    background: var(--hc-accent-bg, var(--brand-accent)) !important;
    color: var(--hc-accent-text, #FFFFFF) !important;
    border-color: var(--hc-accent-bg, var(--brand-accent)) !important;
}

/* -------------------------------------------------------------------------
   Header Tri-Color Mode 2: 'deep' (AIS-Style Deep Contrast Dark Brand)
   ------------------------------------------------------------------------- */
.site-header.header-tone-deep {
    background: var(--fc-deep-bg, #111827) !important;
    border-bottom: 2px solid var(--fc-deep-heading, var(--fox-orange)) !important;
    color: #FFFFFF !important;
}
.site-header.header-tone-deep .header-centered-top-wrap {
    background: var(--fc-deep-bg, #111827);
}
.site-header.header-tone-deep .header-centered-bar,
.site-header.header-tone-deep .header-topbar {
    background: var(--fc-deep-bottom-bg, #090D16) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: rgba(255, 255, 255, 0.88) !important;
}
.site-header.header-tone-deep .topbar-item,
.site-header.header-tone-deep .header-mini-socials a {
    color: rgba(255, 255, 255, 0.88) !important;
}
.site-header.header-tone-deep .topbar-item i,
.site-header.header-tone-deep .topbar-link:hover,
.site-header.header-tone-deep .header-mini-socials a:hover {
    color: var(--fc-deep-heading, #FDBA74) !important;
}
.site-header.header-tone-deep .brand-logo,
.site-header.header-tone-deep .brand-name {
    color: #FFFFFF !important;
}
.site-header.header-tone-deep .brand-sub {
    color: rgba(255, 255, 255, 0.75) !important;
}
.site-header.header-tone-deep .nav-item {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 600;
}
.site-header.header-tone-deep .nav-item:hover {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #FFFFFF !important;
}
.site-header.header-tone-deep .nav-item.active {
    background: rgba(255, 255, 255, 0.16) !important;
    color: var(--fc-deep-heading, #FDBA74) !important;
    box-shadow: inset 0 -3px 0 var(--fc-deep-heading, #FDBA74) !important;
}
/* Header 2 & Header 3 in Tone 2 ('deep'): Full-Height Solid Block for Hover & Active (matching Tone 1 geometry) */
.site-header.header-style-centered.header-tone-deep .header-centered-nav .nav-item,
.site-header.header-style-split.header-tone-deep .nav-item {
    border-radius: 0 !important;
}
.site-header.header-style-centered.header-tone-deep .header-centered-nav .nav-item:hover,
.site-header.header-style-split.header-tone-deep .nav-item:hover {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #FFFFFF !important;
}
.site-header.header-style-centered.header-tone-deep .header-centered-nav .nav-item.active,
.site-header.header-style-split.header-tone-deep .nav-item.active {
    background: var(--fc-deep-accent-bg, var(--fox-orange)) !important;
    color: var(--fc-deep-accent-text, #FFFFFF) !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}
/* Header 4 in Tone 2 ('deep'): Pill geometry matching Tone 1 */
.site-header.header-style-minimal.header-tone-deep .nav-item {
    border-radius: 999px !important;
    padding: 0.38rem 0.95rem;
}
.site-header.header-style-minimal.header-tone-deep .nav-item.active {
    background: var(--fc-deep-accent-bg, var(--fox-orange)) !important;
    color: var(--fc-deep-accent-text, #FFFFFF) !important;
    box-shadow: none !important;
}
.site-header.header-tone-deep .header-search-bar {
    background: #FFFFFF !important;
    border-color: transparent !important;
}
.site-header.header-tone-deep .header-search-bar input[type="search"] {
    color: #111827 !important;
}
.site-header.header-tone-deep .icon-btn,
.site-header.header-tone-deep .hamburger-btn,
.site-header.header-tone-deep .user-pill,
.site-header.header-tone-deep .header-actions .btn-outline {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    color: #FFFFFF !important;
}
.site-header.header-tone-deep .hamburger-btn span {
    background: #FFFFFF !important;
}
.site-header.header-tone-deep .header-actions .btn-primary {
    background: var(--fc-deep-accent-bg, var(--fox-orange)) !important;
    color: var(--fc-deep-accent-text, #FFFFFF) !important;
    border-color: var(--fc-deep-accent-bg, var(--fox-orange)) !important;
}

/* -------------------------------------------------------------------------
   Header Tri-Color Mode 3: 'surface' (Clean 60% Surface + 30% Brand Blocks)
   ------------------------------------------------------------------------- */
.site-header.header-tone-surface {
    background: var(--bg-card);
}
.site-header.header-style-classic.header-tone-surface .nav-item.active {
    background: var(--fox-orange-soft);
    color: var(--fox-orange);
    font-weight: 700;
    box-shadow: inset 0 -3px 0 var(--hc-brand-bg, var(--fox-orange));
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
}
/* Header 2 & Header 3 in Tone 3 ('surface'): Full-Height Solid Block for Hover & Active (matching Tone 1 geometry) */
.site-header.header-style-centered.header-tone-surface .header-centered-nav .nav-item,
.site-header.header-style-split.header-tone-surface .nav-item {
    border-radius: 0 !important;
    color: var(--text-main);
}
.site-header.header-style-centered.header-tone-surface .header-centered-nav .nav-item:hover,
.site-header.header-style-split.header-tone-surface .nav-item:hover {
    background: var(--fox-orange-soft) !important;
    color: var(--fox-orange) !important;
}
.site-header.header-style-centered.header-tone-surface .header-centered-nav .nav-item.active,
.site-header.header-style-split.header-tone-surface .nav-item.active {
    background: var(--hc-brand-bg, var(--fox-orange)) !important;
    color: var(--hc-brand-text, #FFFFFF) !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}
/* Header 4 in Tone 3 ('surface'): Pill geometry matching Tone 1 */
.site-header.header-style-minimal.header-tone-surface .nav-item {
    border-radius: 999px;
    padding: 0.38rem 0.95rem;
    font-weight: 600;
}
.site-header.header-style-minimal.header-tone-surface .nav-item.active {
    background: var(--hc-brand-bg, var(--fox-orange)) !important;
    color: var(--hc-brand-text, #FFFFFF) !important;
    box-shadow: none !important;
}

/* =========================================================================
   Modular Footer Templates (1: Classic, 2: Columns, 3: Minimal, 4: Stacked)
   & Tri-Color CI Tones (brand, deep, surface)
   ========================================================================= */

.site-footer.footer-style-classic,
.site-footer.footer-style-columns {
    padding: 3rem 0 0 !important;
}
.footer-bottom-bar {
    width: 100%;
    padding: 0.95rem 0;
}
.footer-bottom-bar .footer-bottom,
.footer-bottom-bar .footer-stacked-bottom {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Footer 2: Corporate Columns */
.footer-grid-3 {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.1fr;
    gap: 2.25rem;
    padding-bottom: 2rem;
}
.footer-col-links h4,
.footer-col-links .footer-col-title,
.footer-col-contact h4,
.footer-col-contact .footer-col-title {
    margin: 0 0 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    font-family: var(--font-heading, 'Anuphan', sans-serif);
}

/* Footer 3: Minimal Slim Bar (2-tier: Line 1 Brand & Nav, Line 2 Copyright & Meta) */
.site-footer.footer-style-minimal {
    padding: 0;
}
.footer-minimal-main-bar {
    padding: 1rem 0;
}
.footer-minimal-sub-bar {
    padding: 0.75rem 0;
    border-top: 1px dashed var(--border-color);
}
.footer-minimal-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.footer-minimal-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.footer-minimal-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.footer-minimal-sub-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-left: auto;
}
.footer-minimal-copy {
    font-size: 0.84rem;
    color: var(--text-muted);
}
.footer-minimal-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.15rem;
}
.footer-minimal-links a {
    font-size: 0.88rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}
.footer-minimal-links a:hover {
    color: var(--fox-orange);
}
.footer-minimal-sub-right .footer-social-links {
    margin-top: 0;
}

/* Footer 4: Centered Stacked (บน: โลโก้ | กลาง1: โซเชียล & เมนู | กลาง2: คำโปรย | ล่าง: ลิขสิทธิ์) */
.site-footer.footer-style-stacked {
    padding: 1.5rem 0 0;
    text-align: center;
}
.footer-stacked-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    margin: 0 auto;
    padding-bottom: 1.25rem;
}
.footer-stacked-top .brand-logo {
    flex-direction: row;
    gap: 0.65rem;
    justify-content: center;
    text-align: left;
}
.footer-stacked-top .brand-name {
    font-size: 1.25rem;
}
.footer-stacked-mid1 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    padding: 0.9rem 0;
    border-top: 1px dashed var(--border-color);
    border-bottom: 1px dashed var(--border-color);
}
.footer-stacked-connect-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.05rem;
}
.connect-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--fox-orange);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.connect-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 0.03em;
    font-family: var(--font-heading, 'Anuphan', sans-serif);
}
.footer-stacked-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.15rem;
}
.footer-stacked-links a {
    display: inline-block;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    background: var(--bg-alt);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.footer-stacked-links a:hover {
    background: var(--fox-orange-soft);
    color: var(--fox-orange);
}
.footer-stacked-connect {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.footer-stacked-connect .footer-social-links {
    margin-top: 0;
    justify-content: center;
}
.footer-stacked-contacts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}
.stacked-contact-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.82rem;
    text-decoration: none;
}
.stacked-contact-pill i {
    color: var(--fox-orange);
}
.stacked-contact-pill:hover {
    border-color: var(--fox-orange);
    color: var(--fox-orange);
}
.footer-stacked-mid2 {
    max-width: 580px;
}
.footer-stacked-mid2 .footer-intro {
    margin: 0 0 0.45rem;
    font-size: 0.92rem;
    color: var(--text-main);
    line-height: 1.6;
}
.footer-stacked-mid2 .footer-outro {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.55;
}
.footer-stacked-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.65rem;
    width: 100%;
    padding: 0.95rem 0;
    font-size: 0.84rem;
    color: var(--text-muted);
}

/* -------------------------------------------------------------------------
   Footer Tri-Color Mode 1: 'brand' (60 · 30 · 10 Signature Archetypes)
   ------------------------------------------------------------------------- */

/* [Brand Mode] Footer 1: Classic Fox — Full 30% Brand Surface + 10% Accent Socials + Distinct Bottom Bar (HomePro / Siriwan Style) */
.site-footer.footer-style-classic.footer-tone-brand {
    background: var(--fc-brand-bg, var(--fox-orange));
    color: var(--fc-brand-text, #FFFFFF);
    border-top: 4px solid var(--hc-accent-bg, #2C1A11);
    padding: 3rem 0 0;
}
.site-footer.footer-style-classic.footer-tone-brand .footer-grid {
    border-bottom: none;
    padding-bottom: 2.25rem;
}
.site-footer.footer-style-classic.footer-tone-brand .brand-logo,
.site-footer.footer-style-classic.footer-tone-brand .brand-name,
.site-footer.footer-style-classic.footer-tone-brand .footer-col-title {
    color: var(--fc-brand-text, #FFFFFF) !important;
}
.site-footer.footer-style-classic.footer-tone-brand .footer-col-title {
    position: relative;
    padding-bottom: 0.55rem;
}
.site-footer.footer-style-classic.footer-tone-brand .footer-col-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 38px;
    height: 3px;
    border-radius: 2px;
    background: var(--hc-accent-pop, #FFFFFF);
}
.site-footer.footer-style-classic.footer-tone-brand .brand-logo img {
    border-color: var(--hc-accent-pop, #FFFFFF);
    background: #FFFFFF;
}
.site-footer.footer-style-classic.footer-tone-brand .footer-intro,
.site-footer.footer-style-classic.footer-tone-brand .footer-outro,
.site-footer.footer-style-classic.footer-tone-brand .footer-contact-list,
.site-footer.footer-style-classic.footer-tone-brand .footer-links a {
    color: var(--fc-brand-muted, rgba(255,255,255,0.84));
}
.site-footer.footer-style-classic.footer-tone-brand .footer-links a:hover,
.site-footer.footer-style-classic.footer-tone-brand .footer-contact-item a:hover {
    color: var(--fc-brand-text, #FFFFFF);
    text-decoration: underline;
}
.site-footer.footer-style-classic.footer-tone-brand .footer-contact-item i {
    color: var(--hc-accent-pop, #FFFFFF);
}
.site-footer.footer-style-classic.footer-tone-brand .social-icon-btn {
    background: var(--hc-accent-bg, #2C1A11);
    border-color: var(--hc-accent-bg, #2C1A11);
    color: var(--hc-accent-text, #FFFFFF) !important;
}
.site-footer.footer-style-classic.footer-tone-brand .social-icon-btn:hover {
    background: #FFFFFF;
    border-color: #FFFFFF;
    color: #111827 !important;
}
.site-footer.footer-style-classic.footer-tone-brand .footer-bottom-bar {
    background: var(--fc-brand-bottom-bg, #2C1A11);
    color: var(--fc-brand-bottom-text, #FFFFFF);
    padding: 0.95rem 0;
}
.site-footer.footer-style-classic.footer-tone-brand .footer-bottom {
    padding-top: 0;
    color: var(--fc-brand-bottom-text, #FFFFFF);
    opacity: 0.92;
}
.site-footer.footer-style-classic.footer-tone-brand .footer-meta-links button {
    color: var(--fc-brand-bottom-text, #FFFFFF) !important;
    background: rgba(128, 128, 128, 0.18);
    border: 1px solid rgba(128, 128, 128, 0.3);
    padding: 0.22rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
}

/* [Brand Mode] Footer 2: Corporate Columns — Deep 900 Brand Surface + Bright 400 Column Titles + Crisp White Links (AIS Style) */
.site-footer.footer-style-columns.footer-tone-brand {
    background: var(--fc-deep-bg, #111827);
    color: #FFFFFF;
    border-top: 4px solid var(--fc-deep-heading, var(--fox-orange));
    padding: 3.25rem 0 0;
}
.site-footer.footer-style-columns.footer-tone-brand .brand-logo,
.site-footer.footer-style-columns.footer-tone-brand .brand-name {
    color: #FFFFFF !important;
}
.site-footer.footer-style-columns.footer-tone-brand .brand-logo img {
    border-color: var(--fc-deep-heading, var(--fox-orange));
    background: #FFFFFF;
}
.site-footer.footer-style-columns.footer-tone-brand .footer-col-title {
    color: var(--fc-deep-heading, #FDBA74) !important;
    font-size: 1.04rem;
    letter-spacing: 0.01em;
}
.site-footer.footer-style-columns.footer-tone-brand .footer-intro,
.site-footer.footer-style-columns.footer-tone-brand .footer-outro,
.site-footer.footer-style-columns.footer-tone-brand .footer-contact-list,
.site-footer.footer-style-columns.footer-tone-brand .footer-links a {
    color: rgba(255, 255, 255, 0.84);
}
.site-footer.footer-style-columns.footer-tone-brand .footer-links a:hover,
.site-footer.footer-style-columns.footer-tone-brand .footer-contact-item a:hover {
    color: var(--fc-deep-heading, #FDBA74);
}
.site-footer.footer-style-columns.footer-tone-brand .footer-contact-item i {
    color: var(--fc-deep-heading, #FDBA74);
}
.site-footer.footer-style-columns.footer-tone-brand .social-icon-btn {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.42);
    color: #FFFFFF !important;
}
.site-footer.footer-style-columns.footer-tone-brand .social-icon-btn:hover {
    background: var(--fc-deep-heading, #FDBA74);
    border-color: var(--fc-deep-heading, #FDBA74);
    color: #111827 !important;
}
.site-footer.footer-style-columns.footer-tone-brand .footer-bottom-bar {
    background: var(--fc-deep-bottom-bg, #090D16);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
}
.site-footer.footer-style-columns.footer-tone-brand .footer-bottom {
    padding-top: 0;
    color: rgba(255, 255, 255, 0.78);
}
.site-footer.footer-style-columns.footer-tone-brand .footer-meta-links button {
    color: var(--fc-deep-heading, #FDBA74) !important;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* [Brand Mode] Footer 3: Minimal Slim Bar — 30% Brand Upper Bar + 10% Accent/Deep Lower Copyright Bar */
.site-footer.footer-style-minimal.footer-tone-brand {
    background: transparent;
    border-top: none;
    padding: 0;
}
.site-footer.footer-style-minimal.footer-tone-brand .footer-minimal-main-bar {
    background: var(--fc-brand-bg, var(--fox-orange));
    color: var(--fc-brand-text, #FFFFFF);
    padding: 0.95rem 0;
}
.site-footer.footer-style-minimal.footer-tone-brand .footer-minimal-main .brand-logo,
.site-footer.footer-style-minimal.footer-tone-brand .footer-minimal-main .brand-name,
.site-footer.footer-style-minimal.footer-tone-brand .footer-minimal-links a {
    color: var(--fc-brand-text, #FFFFFF) !important;
    font-weight: 600;
}
.site-footer.footer-style-minimal.footer-tone-brand .footer-minimal-main .brand-logo img {
    border-color: var(--hc-accent-pop, #FFFFFF);
    background: #FFFFFF;
}
.site-footer.footer-style-minimal.footer-tone-brand .footer-minimal-links a:hover {
    text-decoration: underline;
    opacity: 0.85;
}
.site-footer.footer-style-minimal.footer-tone-brand .footer-minimal-sub-bar {
    background: var(--fc-brand-bottom-bg, #2C1A11);
    color: var(--fc-brand-bottom-text, #FFFFFF);
    border-top: none;
    padding: 0.7rem 0;
}
.site-footer.footer-style-minimal.footer-tone-brand .footer-minimal-copy {
    color: var(--fc-brand-bottom-text, #FFFFFF);
    opacity: 0.88;
}
.site-footer.footer-style-minimal.footer-tone-brand .social-icon-btn {
    width: 30px;
    height: 30px;
    font-size: 0.88rem;
    background: rgba(128, 128, 128, 0.2);
    border-color: rgba(128, 128, 128, 0.32);
    color: var(--fc-brand-bottom-text, #FFFFFF) !important;
}
.site-footer.footer-style-minimal.footer-tone-brand .footer-meta-links button {
    color: var(--fc-brand-bottom-text, #FFFFFF) !important;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* [Brand Mode] Footer 4: Centered Stacked — Deep Brand Stage + Centered 10% Accent Heading & Solid 10% Accent Social Circles (Kookkaeagraph Style) */
.site-footer.footer-style-stacked.footer-tone-brand {
    background: var(--hc-topbar-bg, #1E293B);
    color: #FFFFFF;
    border-top: 4px solid var(--fc-deep-accent-bg, var(--fox-orange));
    padding: 1.75rem 0 0;
}
.site-footer.footer-style-stacked.footer-tone-brand .brand-logo,
.site-footer.footer-style-stacked.footer-tone-brand .brand-name {
    color: #FFFFFF !important;
}
.site-footer.footer-style-stacked.footer-tone-brand .brand-logo img {
    border-color: var(--fc-deep-heading, #FDBA74);
    background: #FFFFFF;
}
.site-footer.footer-style-stacked.footer-tone-brand .footer-stacked-mid1 {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.site-footer.footer-style-stacked.footer-tone-brand .connect-kicker,
.site-footer.footer-style-stacked.footer-tone-brand .connect-title {
    color: var(--fc-deep-heading, #FDBA74);
}
.site-footer.footer-style-stacked.footer-tone-brand .footer-stacked-connect .social-icon-btn {
    width: 42px;
    height: 42px;
    font-size: 1.15rem;
    background: var(--fc-deep-accent-bg, var(--fox-orange));
    border-color: var(--fc-deep-accent-bg, var(--fox-orange));
    color: var(--fc-deep-accent-text, #FFFFFF) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}
.site-footer.footer-style-stacked.footer-tone-brand .footer-stacked-connect .social-icon-btn:hover {
    background: #FFFFFF;
    border-color: #FFFFFF;
    color: #111827 !important;
}
.site-footer.footer-style-stacked.footer-tone-brand .footer-stacked-links a {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}
.site-footer.footer-style-stacked.footer-tone-brand .footer-stacked-links a:hover {
    background: var(--fc-deep-accent-bg, var(--fox-orange));
    border-color: var(--fc-deep-accent-bg, var(--fox-orange));
    color: var(--fc-deep-accent-text, #FFFFFF);
}
.site-footer.footer-style-stacked.footer-tone-brand .stacked-contact-pill {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.92);
}
.site-footer.footer-style-stacked.footer-tone-brand .stacked-contact-pill i {
    color: var(--fc-deep-heading, #FDBA74);
}
.site-footer.footer-style-stacked.footer-tone-brand .footer-stacked-mid2 .footer-intro {
    color: rgba(255, 255, 255, 0.92);
}
.site-footer.footer-style-stacked.footer-tone-brand .footer-stacked-mid2 .footer-outro {
    color: rgba(255, 255, 255, 0.75);
}
.site-footer.footer-style-stacked.footer-tone-brand .footer-bottom-bar {
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.site-footer.footer-style-stacked.footer-tone-brand .footer-stacked-bottom {
    color: rgba(255, 255, 255, 0.8);
}
.site-footer.footer-style-stacked.footer-tone-brand .footer-meta-links button {
    color: var(--fc-deep-heading, #FDBA74) !important;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* -------------------------------------------------------------------------
   Footer Tri-Color Mode 2: 'deep' (AIS-Style Deep Contrast across all Footers)
   ------------------------------------------------------------------------- */
.site-footer.footer-tone-deep {
    background: var(--fc-deep-bg, #111827) !important;
    color: #FFFFFF !important;
    border-top: 4px solid var(--fc-deep-heading, var(--fox-orange)) !important;
    padding-bottom: 0 !important;
}
.site-footer.footer-tone-deep .footer-minimal-main-bar {
    background: var(--fc-deep-bg, #111827) !important;
}
.site-footer.footer-tone-deep .footer-bottom-bar,
.site-footer.footer-tone-deep .footer-minimal-sub-bar {
    background: var(--fc-deep-bottom-bg, #090D16) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 0.95rem 0 !important;
}
.site-footer.footer-tone-deep .footer-grid,
.site-footer.footer-tone-deep .footer-grid-3 {
    border-bottom: none !important;
    padding-bottom: 2.25rem !important;
}
.site-footer.footer-tone-deep .brand-logo,
.site-footer.footer-tone-deep .brand-name {
    color: #FFFFFF !important;
}
.site-footer.footer-tone-deep .footer-col-title,
.site-footer.footer-tone-deep .connect-kicker,
.site-footer.footer-tone-deep .connect-title {
    color: var(--fc-deep-heading, #FDBA74) !important;
}
.site-footer.footer-tone-deep .footer-intro,
.site-footer.footer-tone-deep .footer-outro,
.site-footer.footer-tone-deep .footer-contact-list,
.site-footer.footer-tone-deep .footer-links a,
.site-footer.footer-tone-deep .footer-minimal-links a,
.site-footer.footer-tone-deep .footer-minimal-copy,
.site-footer.footer-tone-deep .footer-bottom,
.site-footer.footer-tone-deep .footer-stacked-bottom {
    color: rgba(255, 255, 255, 0.84) !important;
}
.site-footer.footer-tone-deep .footer-links a:hover,
.site-footer.footer-tone-deep .footer-minimal-links a:hover,
.site-footer.footer-tone-deep .footer-contact-item a:hover {
    color: var(--fc-deep-heading, #FDBA74) !important;
}
.site-footer.footer-tone-deep .footer-contact-item i,
.site-footer.footer-tone-deep .stacked-contact-pill i {
    color: var(--fc-deep-heading, #FDBA74) !important;
}
.site-footer.footer-tone-deep .social-icon-btn {
    background: var(--fc-deep-accent-bg, var(--fox-orange)) !important;
    border-color: var(--fc-deep-accent-bg, var(--fox-orange)) !important;
    color: var(--fc-deep-accent-text, #FFFFFF) !important;
}
.site-footer.footer-tone-deep .footer-stacked-links a,
.site-footer.footer-tone-deep .stacked-contact-pill {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #FFFFFF !important;
}
.site-footer.footer-tone-deep .footer-meta-links button {
    color: var(--fc-deep-heading, #FDBA74) !important;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* -------------------------------------------------------------------------
   Footer Tri-Color Mode 3: 'surface' (Clean 60% Surface + Distinct Bottom Bar)
   ------------------------------------------------------------------------- */
.site-footer.footer-tone-surface {
    background: var(--bg-card);
    padding-bottom: 0 !important;
}
.site-footer.footer-tone-surface .footer-grid,
.site-footer.footer-tone-surface .footer-grid-3 {
    border-bottom: none;
    padding-bottom: 2.25rem;
}
.site-footer.footer-tone-surface .footer-bottom-bar,
.site-footer.footer-tone-surface .footer-minimal-sub-bar {
    background: var(--bg-alt);
    border-top: 1px solid var(--border-color);
    padding: 0.95rem 0;
}

@media (max-width: 900px) {
    .header-centered-top {
        display: flex;
        justify-content: space-between;
    }
    .header-centered-bar,
    .header-centered-nav {
        display: none;
    }
    .footer-grid-3 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .footer-stacked-bottom {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
}

/* ==========================================================================
   Section Builder: Category List Grid / Strip (Shop & Blog)
   ========================================================================== */
.category-section-header {
    margin-bottom: 1.75rem;
}
.category-view-all {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--fox-orange);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
}
.category-view-all:hover {
    color: var(--fox-orange-hover);
    background: var(--fox-orange-soft);
    transform: translateX(3px);
}

/* Style: Horizontal Box (Card Box - Image/Icon Left, Text Right) */
.category-grid-row.style-card_h {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.15rem;
}
.category-card-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.15rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.category-card-box:hover {
    border-color: var(--fox-orange);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--fox-orange-soft);
}
.category-box-media {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    transition: all 0.2s ease;
}
.category-box-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.category-card-box:hover .category-box-media img {
    transform: scale(1.08);
}
.category-box-media i {
    font-size: 1.65rem;
    color: var(--fox-orange);
    transition: transform 0.3s ease;
}
.category-card-box:hover .category-box-media {
    border-color: var(--fox-orange);
    background: var(--fox-orange-soft);
}
.category-card-box:hover .category-box-media i {
    transform: scale(1.12);
}
.category-box-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.category-box-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.35;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}
.category-card-box:hover .category-box-title {
    color: var(--fox-orange);
}
.category-box-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Style: Circle Icon & Rounded Card (Vertical) */
.category-grid-row.style-circle,
.category-grid-row.style-rounded {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 1.25rem;
    text-align: center;
}
.category-grid-row.align-center {
    justify-content: center;
}
.category-grid-row.align-left {
    justify-content: flex-start;
}
.category-grid-row.style-circle .category-card-item,
.category-grid-row.style-rounded .category-card-item {
    width: 108px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 0.5rem 0.25rem;
    border-radius: var(--radius-md);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.category-card-item:hover {
    transform: translateY(-4px);
}
.category-img-wrap {
    width: 80px;
    height: 80px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.65rem;
    overflow: hidden;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.category-img-wrap.shape-circle {
    border-radius: 50%;
}
.category-img-wrap.shape-rounded {
    border-radius: var(--radius-md);
}
.category-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.category-card-item:hover .category-img-wrap img {
    transform: scale(1.08);
}
.category-img-wrap i {
    font-size: 2.1rem;
    color: var(--fox-orange);
    transition: transform 0.3s ease;
}
.category-card-item:hover .category-img-wrap {
    border-color: var(--fox-orange);
    box-shadow: 0 8px 22px var(--fox-orange-soft);
}
.category-card-item:hover .category-img-wrap i {
    transform: scale(1.12);
}
.category-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.35;
    margin-bottom: 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    transition: color 0.2s ease;
}
.category-card-item:hover .category-name {
    color: var(--fox-orange);
}
.category-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .category-grid-row.style-card_h {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .category-grid-row.style-circle,
    .category-grid-row.style-rounded {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.85rem;
        padding-bottom: 0.75rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
    }
    .category-grid-row::-webkit-scrollbar {
        height: 4px;
    }
    .category-grid-row::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 4px;
    }
    .category-grid-row.style-circle .category-card-item,
    .category-grid-row.style-rounded .category-card-item {
        flex: 0 0 90px;
        width: 90px;
        scroll-snap-align: start;
    }
    .category-img-wrap {
        width: 68px;
        height: 68px;
    }
    .category-img-wrap i {
        font-size: 1.8rem;
    }
}

/* Style: Brand / Partner Logo Box (Responsive grid, white canvas, object-fit contain) */
.category-grid-row.style-brand_box {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
}
.category-grid-row.style-brand_box.align-center {
    justify-content: center;
}
.category-grid-row.style-brand_box.align-left {
    justify-content: flex-start;
}
.category-grid-row.style-brand_box .category-card-brand {
    display: flex;
    flex-direction: column;
    flex: 0 1 calc(25% - 0.95rem);
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.category-card-brand:hover {
    border-color: var(--fox-orange);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}
.category-brand-logo-wrap {
    height: 110px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}
.category-brand-logo-wrap img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.25s ease;
}
.category-card-brand:hover .category-brand-logo-wrap img {
    transform: scale(1.06);
}
.category-brand-logo-wrap i {
    font-size: 2.5rem;
    color: var(--text-muted);
    opacity: 0.7;
    transition: all 0.2s ease;
}
.category-card-brand:hover .category-brand-logo-wrap i {
    color: var(--fox-orange);
    transform: scale(1.1);
}
.category-brand-info {
    padding: 0.85rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: var(--bg-card);
}
.category-brand-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}
.category-card-brand:hover .category-brand-title {
    color: var(--fox-orange);
}
.category-brand-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

@media (max-width: 992px) {
    .category-grid-row.style-brand_box .category-card-brand {
        flex: 0 1 calc(33.333% - 0.75rem);
    }
}
@media (max-width: 640px) {
    .category-grid-row.style-brand_box {
        gap: 0.75rem;
    }
    .category-grid-row.style-brand_box .category-card-brand {
        flex: 0 1 calc(50% - 0.4rem);
        min-width: 135px;
    }
    .category-brand-logo-wrap {
        height: 90px;
        padding: 0.75rem;
    }
}




/* LiteFox Extra Shop Mobile Pagination */

@media (max-width: 768px) {
    .pagination {
        gap: 0.25rem;
    }
    .page-num {
        min-width: 32px;
        height: 32px;
        font-size: 0.82rem;
        border-radius: 6px;
        padding: 0 0.35rem;
    }
    .page-ellipsis {
        min-width: 18px;
        height: 32px;
        font-size: 0.82rem;
    }
}
@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}


/* ==========================================================================
   Option 3: Mega Explorer (Department Store Style)
   ========================================================================== */
.shop-mega-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.btn-mega-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1.15rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 107, 0, 0.4);
    background: var(--fox-orange-soft);
    color: var(--fox-orange);
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-mega-trigger:hover {
    background: var(--fox-orange);
    color: #fff;
    border-color: var(--fox-orange);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.25);
}
.btn-mega-trigger:hover .mega-trigger-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}
.mega-trigger-badge {
    font-size: 0.72rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: rgba(255, 107, 0, 0.15);
    color: var(--fox-orange);
    font-weight: 600;
}
.mega-trigger-chevron {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

/* Active Category Trail in Mega Bar */
.mega-active-trail {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    flex-wrap: wrap;
}
.trail-label {
    color: var(--text-muted);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.trail-crumbs {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-alt);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}
.trail-crumb.current {
    font-weight: 700;
    color: var(--fox-orange);
}
.trail-sep {
    color: var(--text-muted);
    opacity: 0.6;
}
.trail-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #DC2626;
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.15s ease;
}
.trail-clear-btn:hover {
    background: rgba(220, 38, 38, 0.1);
}

/* Mega Explorer Backdrop & Dialog */
.mega-explorer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.mega-explorer-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.mega-explorer-dialog {
    position: fixed;
    top: 5vh;
    left: 50%;
    transform: translate(-50%, -20px) scale(0.98);
    width: 94%;
    max-width: 1280px;
    max-height: 88vh;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.mega-explorer-dialog.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0) scale(1);
}

/* Dialog Header */
.mega-sheet-handle-bar {
    display: none;
}
.mega-explorer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}
.mega-explorer-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.mega-explorer-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    line-height: 1.2;
}
.mega-explorer-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0.15rem 0 0;
}
.mega-explorer-search {
    position: relative;
    flex: 1;
    max-width: 420px;
}
.mega-explorer-search i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}
.mega-explorer-search input {
    width: 100%;
    padding: 0.5rem 0.85rem 0.5rem 2.25rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-main);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.15s ease;
}
.mega-explorer-search input:focus {
    border-color: var(--fox-orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.12);
}
.mega-explorer-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-alt);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.mega-explorer-close:hover {
    background: var(--fox-orange);
    color: #fff;
    border-color: var(--fox-orange);
}

/* All products shortcut bar */
.mega-all-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.5rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border-color);
}
.mega-all-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}
.mega-all-link:hover, .mega-all-link.active {
    color: var(--fox-orange);
    background: var(--fox-orange-soft);
}
.mega-all-count {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
}
html[data-theme="dark"] .mega-all-count {
    background: rgba(255, 255, 255, 0.08);
}

/* Dialog Body - Department Store Grid (Advice Frameless Style) */
.mega-explorer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.75rem 2rem;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-card);
}
.mega-dept-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.25rem 2.25rem;
    align-items: start;
}
@media (max-width: 1099px) {
    .mega-dept-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.85rem 1.75rem;
    }
}
@media (max-width: 768px) {
    .mega-dept-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}
.mega-dept-box {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    transition: opacity 0.2s ease;
}
.mega-dept-box.has-active {
    background: transparent !important;
}

/* Dept Head (Tier 1) - Advice Style with Nowrap */
.mega-dept-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    padding-bottom: 0.45rem;
    margin-bottom: 0.65rem;
    border-bottom: 1.5px solid var(--border-color);
}
.mega-dept-title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    min-width: 0;
    flex: 1;
    transition: color 0.15s ease;
}
.mega-dept-title .dept-icon {
    color: var(--fox-orange);
    font-size: 0.95rem;
    flex-shrink: 0;
}
.mega-dept-title .dept-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.mega-dept-title:hover, .mega-dept-title.active {
    color: var(--fox-orange);
}
.mega-dept-count {
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.08rem 0.45rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    flex-shrink: 0;
    line-height: 1.2;
    transition: all 0.15s ease;
}
html[data-theme="dark"] .mega-dept-count {
    background: rgba(255, 255, 255, 0.08);
}
.mega-dept-box:hover .mega-dept-count {
    background: var(--fox-orange-soft);
    color: var(--fox-orange);
}

/* Tier 2 Sub-tree & Block */
.mega-sub-tree {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.mega-sub-block {
    display: flex;
    flex-direction: column;
}
.mega-t2-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
}
.mega-t2-title {
    display: block;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    min-width: 0;
    flex: 1;
    transition: color 0.15s ease;
}
.mega-t2-title .t2-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.mega-t2-title:hover, .mega-t2-title.active {
    color: var(--fox-orange);
}
.mega-sub-viewall {
    font-size: 0.72rem;
    font-weight: 500;
    color: #0284C7;
    text-decoration: none;
    flex-shrink: 0;
    white-space: nowrap;
    transition: color 0.15s ease;
}
html[data-theme="dark"] .mega-sub-viewall {
    color: #38BDF8;
}
.mega-sub-viewall:hover {
    color: var(--fox-orange);
    text-decoration: underline;
}
.mega-count-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.6;
    flex-shrink: 0;
}

/* Tier 3 & Tier 4 Vertical List - Advice Minimalist Nowrap Style */
.mega-t3-list {
    list-style: none;
    padding: 0;
    margin: 0.1rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.mega-leaf-item {
    display: block;
}
.mega-leaf-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    color: var(--text-muted);
    font-size: 0.81rem;
    text-decoration: none;
    padding: 0.18rem 0.3rem;
    border-radius: 4px;
    transition: all 0.15s ease;
}
.mega-leaf-link:hover {
    color: var(--fox-orange);
    background: var(--fox-orange-soft);
}
.mega-leaf-link.active {
    color: var(--fox-orange);
    font-weight: 600;
    background: var(--fox-orange-soft);
}
.mega-leaf-link .leaf-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}
.mega-leaf-link .leaf-count {
    font-size: 0.68rem;
    opacity: 0.55;
    flex-shrink: 0;
}
.mega-leaf-item.tier-4 .leaf-name {
    padding-left: 0.4rem;
    opacity: 0.85;
}

/* Mobile Bottom Sheet Drawer (<= 768px) */
@media (max-width: 768px) {
    .mega-explorer-dialog {
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        transform: translateY(100%) !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 85vh !important;
        border-radius: 18px 18px 0 0 !important;
        border-bottom: none !important;
        border-left: none !important;
        border-right: none !important;
        box-sizing: border-box !important;
    }
    .mega-explorer-dialog.show {
        transform: translateY(0) !important;
    }
    .mega-sheet-handle-bar {
        display: flex !important;
        justify-content: center !important;
        padding: 0.65rem 0 0.2rem !important;
        cursor: pointer !important;
    }
    .mega-sheet-handle {
        width: 44px !important;
        height: 4px !important;
        background: var(--border-color) !important;
        border-radius: 999px !important;
    }
    .mega-explorer-header {
        padding: 0.75rem 1rem !important;
        flex-wrap: wrap !important;
        gap: 0.65rem !important;
    }
    .mega-explorer-search {
        order: 3 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    .mega-explorer-title {
        font-size: 1.05rem !important;
    }
    .mega-explorer-body {
        padding: 1.25rem 1rem !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    .mega-dept-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .mega-dept-box {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .shop-mega-bar {
        padding: 0.65rem 0.85rem !important;
    }
    .btn-mega-trigger {
        width: 100% !important;
        justify-content: center !important;
    }
}
