/* =========================
   DESIGN SYSTEM & VARIABLES
   ========================= */
:root {
    /* Colors - Light Pastel / Mature Theme */
    --bg-color: #faf9f6;
    /* Off-white / beige */
    --bg-secondary: #f0efeb;
    --text-primary: #2b2b2b;
    --text-secondary: #595959;
    --accent-color: #7b8a78;
    /* Sage green / mature accent */
    --border-color: #e5e4e2;

    /* Typography */
    --font-main: 'Inter', sans-serif;

    /* Spacing & Layout */
    --container-width: 900px;
    /* Narrower for a more refined reading experience */
    --section-spacing: 100px;

    /* Animations */
    --transition-fast: 0.3s ease;
    --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================
   RESET & BASE STYLES
   ========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.8;
    overflow-x: hidden;
    font-weight: 300;
    /* Thinner base font */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

img {
    max-width: 100%;
    display: block;
}

/* =========================
   TYPOGRAPHY
   ========================= */
h1,
h2,
h3 {
    font-weight: 300;
    /* Light, elegant weight */
    line-height: 1.3;
    color: #1a1a1a;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

h2.section-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    margin-bottom: 48px;
    text-align: center;
    position: relative;
    padding-bottom: 16px;
}

h2.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 1px;
    background-color: var(--text-secondary);
}

p {
    font-size: 1.05rem;
    color: var(--text-secondary);
}

/* =========================
   NAVIGATION (HEADER)
   ========================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 24px 0;
    transition: all var(--transition-fast);
}

.navbar.scrolled {
    padding: 16px 0;
    background-color: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 1px;
}

.logo-dot {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-weight: 300;
    font-size: 0.95rem;
    position: relative;
    color: var(--text-secondary);
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* =========================
   HERO SECTION
   ========================= */
\.hero-section {
    background-color: var(--bg-color);
    display: flex;
    align-items: center;
    text-align: center;
    padding-top: 80px !important;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-bottom: 24px;
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 48px;
    max-width: 500px;
}

/* Clock Card */
.clock-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    /* Softer, simpler border radius */
    padding: 24px 40px;
    background-color: var(--bg-color);
    display: inline-block;
}

.clock-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.clock-time {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}

.clock-date {
    font-size: 0.95rem;
}

/* =========================
   ABOUT SECTION
   ========================= */
.about-section {
    padding: var(--section-spacing) 0;
    background-color: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.skills-list {
    margin-top: 24px;
}

.skills-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 1rem;
    color: var(--text-secondary);
}

.skills-list li::before {
    content: '-';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.card-simple {
    border-left: 2px solid var(--accent-color);
    padding: 24px 32px;
    background-color: var(--bg-color);
}

.card-simple h3 {
    margin-bottom: 12px;
    font-size: 1.2rem;
}

/* =========================
   PROJECTS SECTION
   ========================= */
.projects-section {
    padding: var(--section-padding) 0;
    background-color: var(--bg-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.project-card {
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    transition: transform var(--transition-fast);
}

.project-card:hover {
    transform: translateY(-4px);
}

.project-img {
    width: 100%;
    height: 200px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.1);
    /* Adds to the sketch/mature feel */
    opacity: 0.85;
    transition: filter var(--transition-fast), opacity var(--transition-fast);
}

.project-card:hover .project-img img {
    filter: grayscale(0%);
    opacity: 1;
}

.project-info {
    padding: 24px;
}

.project-info h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.project-info p {
    font-size: 0.95rem;
}

/* =========================
   NEWS SECTION (TABS)
   ========================= */
.news-section {
    padding: var(--section-padding) 0;
    background-color: var(--bg-secondary);
}

.tabs-container {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 32px;
}

.tabs-header-wrapper {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
    /* Firefox */

    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}



.tabs-header {
    display: inline-flex;
    min-width: 100%;
}

.tab-btn {
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    background: none;
    border: none;
    padding: 12px 24px;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
}





.tab-pane {
    display: none;
    animation: fadeIn var(--transition-fast);
}

.tab-pane.active {
    display: block;
}

.news-item {
    margin-bottom: 32px;
}

.news-item:last-child {
    margin-bottom: 0;
}

.news-item h3 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.news-date {
    display: block;
    font-size: 0.85rem;
    color: var(--accent-color);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   FOOTER
   ========================= */
.footer {
    padding: 48px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
}

.social-links a {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.social-links a:hover {
    color: var(--text-primary);
}

/* =========================
   ANIMATIONS (Intersection Observer)
   ========================= */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

/* =========================
   RESPONSIVE DESIGN
   ========================= */
@media (max-width: 1024px) {
    .nav-links {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .tabs-container {
        padding: 24px 16px;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .news-item h3 {
        font-size: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* =========================
   DARK THEME OVERRIDES
   ========================= */
[data-theme='dark'] {
    --bg-color: #0f1115;
    --bg-secondary: #1a1d24;
    --text-primary: #f8f9fa;
    --text-secondary: #a0aec0;
    --border-color: #2a2e35;
}

[data-theme='dark'] h1,
[data-theme='dark'] h2,
[data-theme='dark'] h3 {
    color: #ffffff;
}

[data-theme='dark'] .clock-card {
    background-color: var(--bg-secondary);
}

[data-theme='dark'] .card-simple {
    background-color: var(--bg-secondary);
}

[data-theme='dark'] .tabs-container {
    background-color: var(--bg-secondary);
}

[data-theme='dark'] .navbar.scrolled {
    background-color: rgba(15, 17, 21, 0.95);
}

/* =========================
   UI/UX UPGRADES
   ========================= */

/* Theme Toggle Button */
.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
    padding: 4px;
}

.theme-toggle-btn:hover {
    color: var(--accent-color);
}

.theme-toggle-btn .sun-icon {
    display: none;
}

[data-theme='dark'] .theme-toggle-btn .moon-icon {
    display: none;
}

[data-theme='dark'] .theme-toggle-btn .sun-icon {
    display: block;
}

/* Custom Cursor */
@media (pointer: fine) {

    body,
    a,
    button {
        cursor: none;
    }

    .custom-cursor {
        position: fixed;
        top: 0;
        left: 0;
        width: 20px;
        height: 20px;
        border: 2px solid var(--accent-color);
        border-radius: 50%;
        pointer-events: none;
        z-index: 99999;
        transform: translate(-50%, -50%);
        transition: width 0.2s, height 0.2s, background-color 0.2s;
        mix-blend-mode: difference;
    }

    .custom-cursor.hovering {
        width: 50px;
        height: 50px;
        background-color: rgba(123, 138, 120, 0.1);
    }
}

/* Scroll Progress Bar */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background-color: var(--accent-color);
    width: 0%;
    z-index: 10000;
    transition: width 0.1s;
}

/* Parallax Clock */
#parallax-clock {
    transition: transform 0.1s ease-out;
    will-change: transform;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-primary);
    color: var(--bg-color);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 400;
    z-index: 99999;
    transition: bottom 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.toast.show {
    bottom: 40px;
}

/* =========================
   PRODUCTS SECTION
   ========================= */
.products-section {
    padding: var(--section-padding) 0;
    background-color: var(--bg-color);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Old grid */
.old-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.product-category {
    background-color: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.product-category h3 {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 20px;
    color: var(--text-primary);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.product-card {
    display: block;
    text-decoration: none;
    color: var(--text-primary);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
    position: relative;
    background-color: var(--bg-color);
}

.product-card:last-child {
    margin-bottom: 0;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--text-secondary);
}

[data-theme="dark"] .product-card:hover {
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

.product-card h4 {
    font-size: 1.05rem;
    font-weight: 400;
    margin-bottom: 6px;
}

.product-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.status-tag {
    display: inline-block;
    font-size: 0.7rem;
    padding: 3px 8px;
    background-color: rgba(123, 138, 120, 0.1);
    color: var(--accent-color);
    border-radius: 20px;
    border: 1px solid rgba(123, 138, 120, 0.3);
}



/* =========================
   REFINEMENTS & CONTACT
   ========================= */
.news-item h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05rem;
    gap: 10px;
}

.news-item p {
    font-size: 0.85rem;
    line-height: 1.5;
}

.source-icon {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
}

.source-icon:hover {
    color: var(--accent-color);
}

.contact-info {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.contact-info p {
    margin: 4px 0;
}

/* Desktop Scroll Snapping */
@media (min-width: 1025px) {
    html {
        scroll-snap-type: y mandatory;
    }

    section {
        min-height: 100vh;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 15vh !important;
        /* 15% from top */
        padding-bottom: 5vh !important;
        overflow: hidden;
    }

    section::-webkit-scrollbar {
        display: none;
    }

    .hero-section {
        justify-content: center;
        padding-top: 80px !important;
    }
}

/* =========================
   PRICING CARDS
   ========================= */
.pricing-card {
    height: 100%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 20px;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

[data-theme='dark'] .pricing-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}



.pricing-card h4 {
    font-size: 1.25rem;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.price-section {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 20px;
}

.old-price {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.new-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
}

.duration {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.features-list li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.features-list li::before {
    content: '✓';
    color: #2ed573;
    font-weight: bold;
}

.warranty-status {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.buy-btn {
    display: block;
    text-align: center;
    background-color: var(--text-primary);
    color: var(--bg-color);
    padding: 12px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color var(--transition-fast);
}

.buy-btn:hover {
    background-color: var(--accent-color);
    color: white;
}

/* =========================
   CHECKOUT MODALS
   ========================= */
.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.checkout-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    background-color: var(--bg-color);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    z-index: 1;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast);
    z-index: 10;
}

.close-modal:hover {
    color: var(--accent-color);
}

.modal-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 0;
}

.modal-info {
    padding: 40px;
    background-color: var(--bg-color);
}

.modal-info h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.modal-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.modal-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-features li {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
    position: relative;
    padding-left: 20px;
}

.modal-features li::before {
    content: '•';
    color: var(--accent-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.modal-features li strong {
    color: var(--text-primary);
}

.modal-qr {
    background-color: #f8f9fa;
    /* Always light background for QR to be scanned easily */
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-left: 1px solid var(--border-color);
}

.modal-qr img {
    width: 100%;
    max-width: 200px;
    height: auto;
    object-fit: contain;
    background: transparent;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.modal-qr p {
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.5;
    font-weight: 500;
}

/* Mobile Adjustments for Modal */
@media (max-width: 1024px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }

    .modal-info {
        padding: 30px;
    }

    .modal-qr {
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding: 30px;
    }

    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}


/* Fix jumping tabs */
.tabs-content {
    min-height: 400px;
    /* Prevent jumping */
    max-height: 72vh;
    /* Don't exceed 60% of viewport */
    overflow-y: auto;
    /* Scroll internally if content is too large */
    padding-bottom: 20px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.tabs-content::-webkit-scrollbar {
    display: none;
}

/* Shrink pricing card */
.pricing-card {
    height: 100%;
    padding: 15px !important;
    gap: 8px !important;
}

.pricing-card h4 {
    font-size: 1rem !important;
    margin-bottom: 0;
}

.price-section .new-price {
    font-size: 1.5rem !important;
}

.price-section .old-price {
    font-size: 0.8rem !important;
}

.features-list {
    gap: 4px !important;
}

.features-list li {
    font-size: 0.8rem !important;
}

.warranty-status {
    font-size: 0.75rem !important;
    margin-top: 5px !important;
}

.buy-btn {
    padding: 8px !important;
    margin-top: auto !important;
    font-size: 0.9rem !important;
}

/* Shrink pricing card */
.pricing-card {
    height: 100%;
    padding: 15px !important;
    gap: 8px !important;
}

.pricing-card h4 {
    font-size: 1rem !important;
    margin-bottom: 0;
}

.price-section .new-price {
    font-size: 1.5rem !important;
}

.price-section .old-price {
    font-size: 0.8rem !important;
}

.features-list {
    gap: 4px !important;
}

.features-list li {
    font-size: 0.8rem !important;
}

.warranty-status {
    font-size: 0.75rem !important;
    margin-top: 5px !important;
}

.buy-btn {
    padding: 8px !important;
    margin-top: auto !important;
    font-size: 0.9rem !important;
}

/* Fix ribbon cutoff */


/* Flex fixes to prevent section overflow */
#products .container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#products .tabs-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#products .tabs-content {
    flex: 1;
    min-height: 0;
    max-height: none;
    /* override previous max-height */
    overflow-y: auto;
}

#news .container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#news .tabs-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#news .tabs-content {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

/* === TARGETED FIXES: Ribbon, Button alignment, Tab slide colors === */

/* Fix ribbon so text is never cut off */


/* Buy button always pinned to bottom of card */
.buy-btn {
    margin-top: auto !important;
    flex-shrink: 0 !important;
}

/* Tab header highlight */
.tabs-header-wrapper {
    background: linear-gradient(to bottom, var(--bg-secondary), var(--bg-color)) !important;
}





/* Slide colours per tab - subtle background tint */
#product-soft {
    background: #f7f5f0;
}

#product-premium {
    background: #f4f7f4;
}

#product-media {
    background: #f4f4f7;
}

#product-tech {
    background: #f7f4f4;
}

#product-smarthome {
    background: #f4f7f7;
}

#product-cosmetics {
    background: #f7f4f7;
}

/* Section title: keep original, just add left accent bar */
/* .products-section .section-title::before removed */

/* Ensure the tabs-content scrolls internally and tabs-container stays in viewport */
.products-section .tabs-content {
    max-height: 65vh !important;
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.products-section .tabs-content::-webkit-scrollbar {
    width: 4px;
}

.products-section .tabs-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* Shrink card internals to fit 65vh without scrolling for typical content */
.products-section .pricing-card {
    padding: 16px !important;
    gap: 8px !important;
}

.products-section .pricing-card h4 {
    font-size: 0.95rem !important;
    padding-right: 44px;
}

.products-section .new-price {
    font-size: 1.35rem !important;
}

.products-section .old-price {
    font-size: 0.75rem !important;
}

.products-section .features-list li {
    font-size: 0.78rem !important;
    line-height: 1.4 !important;
}

.products-section .warranty-status {
    font-size: 0.72rem !important;
    padding-top: 6px !important;
}

.products-section .buy-btn {
    padding: 9px !important;
    font-size: 0.85rem !important;
}

.products-section .price-section {
    margin-bottom: 4px !important;
}


/* === FIX: Ribbon fully visible - no text cut off === */


/* === FIX: Buy button always at bottom of card === */
.pricing-card {
    display: flex !important;
    flex-direction: column !important;
}

.buy-btn {
    margin-top: auto !important;
}

/* === FIX: Scrollable sections when content overflows === */
.products-section .tabs-content,
.news-section .tabs-content {
    max-height: 62vh !important;
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.products-section .tabs-content::-webkit-scrollbar,
.news-section .tabs-content::-webkit-scrollbar {
    width: 4px;
}

.products-section .tabs-content::-webkit-scrollbar-thumb,
.news-section .tabs-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* Projects section also scrollable */
.projects-section .projects-grid {
    max-height: 62vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.projects-section .projects-grid::-webkit-scrollbar {
    width: 4px;
}

.projects-section .projects-grid::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* === VISUAL: Tab header subtle highlight === */
.tabs-header-wrapper {
    background: var(--bg-secondary) !important;
}



/* === VISUAL: Slide colours per tab pane === */
#product-soft {
    background: rgba(247, 245, 240, 0.8);
    border-radius: 8px;
}

#product-premium {
    background: rgba(244, 247, 244, 0.8);
    border-radius: 8px;
}

#product-media {
    background: rgba(244, 244, 247, 0.8);
    border-radius: 8px;
}

#product-tech {
    background: rgba(247, 244, 244, 0.8);
    border-radius: 8px;
}


#product-cosmetics {
    background: rgba(247, 244, 247, 0.8);
    border-radius: 8px;
}

/* === DEFINITIVE Ribbon Badge Fix ===
   overflow: visible on .pricing-card lets the ribbon show fully.
   This is the ONE source of truth for this rule. */
.pricing-badge {
    position: absolute;
    top: 10px;
    right: -30px;
    background: #e8453c;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 5px 36px;
    transform: rotate(45deg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    z-index: 1;
    letter-spacing: 0.2px;
}


/* ============================================================
   SMART SCROLLBARS - Appear only when needed, elegant style
   Layout never changes, sections stay full-screen
   ============================================================ */

/* --- Global thin scrollbar style (Chromium) --- */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* --- Firefox --- */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

/* --- Tabs content: vertical scroll when content too tall --- */
.tabs-content {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: 60vh !important;
    min-height: 0;
}

/* --- Tab header: horizontal scroll when many tabs --- */
.tabs-header-wrapper {
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

/* --- About section content --- */
.about-section .container {
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

/* --- Projects grid: vertical scroll if many projects --- */
.projects-grid {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: 70vh !important;
}

/* --- Every section stays locked to full-height, no layout shift --- */
section {
    overflow: hidden !important;
    /* section itself never scrolls - internal elements do */
}

/* Except: allow content inside section to scroll via inner containers above */
.about-section,
.projects-section,
.products-section,
.news-section {
    overflow: hidden !important;
}

/* === FIX: Clear underline for active tabs === */


/* Hide the old pseudo-element to prevent conflicts */


.tab-btn.active {
    font-weight: 500 !important;
    color: var(--accent-color) !important;
    border-bottom: 3px solid var(--accent-color) !important;
}

/* === HERO SECTION ELEGANT TINT === */
.hero-section {
    background: linear-gradient(135deg, rgba(240, 239, 235, 0.7) 0%, rgba(250, 249, 246, 1) 100%) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.hero-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto;
}

/* Ensure the clock card is also centered nicely */
.clock-card {
    margin-left: auto;
    margin-right: auto;
}

/* === DARK MODE === */
[data-theme="dark"] {
    --bg-color: #161616;
    --bg-secondary: #202020;
    --text-primary: #e0e0e0;
    --text-secondary: #909090;
    --accent-color: #7b8a78;
    --border-color: #2d2d2d;
}

[data-theme="dark"] .hero-section {
    background: linear-gradient(135deg, rgba(28, 28, 28, 0.8) 0%, rgba(22, 22, 22, 1) 100%) !important;
}

[data-theme="dark"] #product-soft {
    background: rgba(35, 33, 30, 0.6) !important;
    border-radius: 8px;
}

[data-theme="dark"] #product-premium {
    background: rgba(30, 35, 33, 0.6) !important;
    border-radius: 8px;
}

[data-theme="dark"] #product-media {
    background: rgba(32, 32, 36, 0.6) !important;
    border-radius: 8px;
}

[data-theme="dark"] #product-tech {
    background: rgba(35, 30, 30, 0.6) !important;
    border-radius: 8px;
}


[data-theme="dark"] #product-cosmetics {
    background: rgba(35, 29, 34, 0.6) !important;
    border-radius: 8px;
}

[data-theme="dark"] .pricing-card {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

/* === FIX: Uniform Card Heights === */
.product-grid {
    align-items: stretch !important;
}

.product-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    margin-bottom: 0 !important;
    /* Let the grid gap handle spacing */
}

.product-card .status-tag {
    margin-top: auto !important;
    align-self: flex-start !important;
}

/* === SMART HORIZONTAL SCROLLBAR FOR TABS === */
.tabs-header-wrapper {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
    padding-bottom: 5px;
}

[data-theme="dark"] .tabs-header-wrapper {
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.tabs-header-wrapper::-webkit-scrollbar {
    height: 4px;
    display: block !important;
}

.tabs-header-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.tabs-header-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

[data-theme="dark"] .tabs-header-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

/* Force 2-column layout for product grids on desktop */
@media (min-width: 1025px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}


/* Dynamic News Styles */
.news-container {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 15px;
    margin-right: -15px;
}

.news-container::-webkit-scrollbar {
    width: 6px;
}

.news-container::-webkit-scrollbar-track {
    background: transparent;
}

.news-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.news-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.news-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-style: italic;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

/* =========================================================================
   COMPREHENSIVE MOBILE DEEP OPTIMIZATION (IOS/ANDROID) - V2
   ========================================================================= */
@media (max-width: 1024px) {

        /* 1. Global Reset & Typography */
        body {
            font-size: 14px !important;
            /* Thu nhỏ chữ cơ bản */
            line-height: 1.5 !important;
        }

        .section-title {
            font-size: 1.6rem !important;
            /* Thu nhỏ tiêu đề */
            margin-bottom: 25px !important;
            line-height: 1.3 !important;
        }

        p,
        h1,
        h2,
        h3,
        h4,
        h5,
        h6,
        .features-list li,
        .warranty-status {
            word-wrap: break-word !important;
            white-space: normal !important;
        }

        /* 2. Header & Navigation (Từng level chức năng) */
        .navbar {
            background-color: rgba(250, 249, 246, 0.98) !important;
            /* Nền luôn đặc trên mobile để chống đè chữ */
            padding: 15px 0 10px 0 !important;
            border-bottom: 1px solid var(--border-color) !important;
        }

        [data-theme='dark'] .navbar {
            background-color: rgba(15, 17, 21, 0.98) !important;
        }

        .nav-content {
            display: flex !important;
            flex-direction: column !important;
            /* Ép xuống dòng */
            align-items: center !important;
            gap: 15px !important;
            /* Khoảng cách giữa logo và menu */
            position: relative !important;
        }

        .nav-content .logo {
            font-size: 1.4rem !important;
            /* Thu nhỏ logo */
            margin: 0 !important;
        }

        .theme-toggle-btn {
            position: absolute !important;
            /* Đặt nút mặt trăng góc phải trên cùng */
            top: 0 !important;
            right: 0 !important;
            margin: 0 !important;
        }

        .nav-links {
            display: flex !important;
            width: 100% !important;
            justify-content: flex-start !important;
            gap: 20px !important;
            overflow-x: auto !important;
            /* Menu vuốt ngang */
            white-space: nowrap !important;
            padding-bottom: 5px !important;
            scrollbar-width: none !important;
            -webkit-overflow-scrolling: touch !important;
        }

        .nav-links::-webkit-scrollbar {
            display: none !important;
        }

        .nav-links a {
            font-size: 0.9rem !important;
            /* Thu nhỏ chữ menu */
        }

        /* 3. Hero Section & Clock */
        .hero-content {
            padding-top: 150px !important;
            /* Đẩy nội dung xuống xa navbar */
        }

        .hero-content h1 {
            font-size: 1.8rem !important;
            /* Thu nhỏ chữ H1 */
            line-height: 1.3 !important;
        }

        .hero-content .eyebrow {
            font-size: 0.85rem !important;
            /* Thu nhỏ chữ Chào mừng */
            letter-spacing: 2px !important;
        }

        .hero-content .subtitle {
            font-size: 0.95rem !important;
        }

        .clock-card {
            padding: 15px !important;
            width: 100% !important;
            max-width: 320px !important;
            box-sizing: border-box !important;
            margin: 20px auto 0 auto !important;
        }

        .clock-time {
            font-size: 2.2rem !important;
            /* Thu nhỏ đồng hồ */
        }

        /* 4. Tabs Navigation (Horizontal Slide) */
        .tabs-header-wrapper {
            overflow-x: auto !important;
            -webkit-overflow-scrolling: touch !important;
            padding-bottom: 5px !important;
            border-bottom: 1px solid var(--border-color) !important;
            background: transparent !important;
        }

        .tabs-header {
            display: inline-flex !important;
            flex-direction: row !important;
            gap: 15px !important;
            width: max-content !important;
            min-width: 100% !important;
        }

        .tab-btn {
            flex: 0 0 auto !important;
            width: auto !important;
            white-space: nowrap !important;
            text-align: center !important;
            padding: 10px 18px !important;
            font-size: 0.95rem !important;
            border: none !important;
            border-bottom: 3px solid transparent !important;
            border-radius: 0 !important;
            background: transparent !important;
        }

        .tab-btn.active {
            background: transparent !important;
            color: var(--text-primary) !important;
            border-bottom: 3px solid var(--text-primary) !important;
        }

        /* 5. Product & Project Grids (Horizontal Swipe) */
        .product-grid,
        .projects-grid,
        .about-grid {
            display: flex !important;
            flex-direction: row !important;
            flex-wrap: nowrap !important;
            overflow-x: auto !important;
            gap: 15px !important;
            width: 100% !important;
            padding-bottom: 20px !important;
            /* Tạo khoảng trống cho thanh cuộn */
            scroll-snap-type: x mandatory !important;
            -webkit-overflow-scrolling: touch !important;
        }

        .product-grid::-webkit-scrollbar,
        .projects-grid::-webkit-scrollbar,
        .about-grid::-webkit-scrollbar {
            height: 4px !important;
        }

        .product-grid::-webkit-scrollbar-thumb,
        .projects-grid::-webkit-scrollbar-thumb,
        .about-grid::-webkit-scrollbar-thumb {
            background: rgba(100, 100, 100, 0.3) !important;
            border-radius: 10px !important;
        }

        .pricing-card,
        .project-card,
        .about-card {
            flex: 0 0 75% !important;
            /* Nhỏ lại để thấy rõ thẻ tiếp theo */
            max-width: 280px !important;
            /* Cố định chiều rộng tối đa gọn gàng */
            padding: 15px !important;
            box-sizing: border-box !important;
            margin: 0 !important;
            scroll-snap-align: center !important;
        }

        /* Thu nhỏ hình ảnh bị ghim cố định trong HTML */
        .pricing-card .product-image-container,
        .project-image {
            height: 150px !important;
            margin-bottom: 12px !important;
        }

        /* Thu nhỏ phông chữ trong thẻ */
        .pricing-card h3,
        .project-card h3,
        .about-card h3 {
            font-size: 1.1rem !important;
            margin-bottom: 8px !important;
        }

        .pricing-card p {
            font-size: 0.85rem !important;
            line-height: 1.4 !important;
        }

        .pricing-card .modal-price {
            font-size: 1.3rem !important;
            margin: 8px 0 !important;
        }

        .pricing-card .btn,
        .project-card .btn {
            padding: 10px 15px !important;
            font-size: 0.85rem !important;
        }

        /* 6. Release Scrolling Constraints */
        .tabs-content,
        .products-section .tabs-content,
        .news-section .tabs-content,
        .projects-section .projects-grid,
        .about-section .container,
        .news-container {
            max-height: none !important;
            min-height: auto !important;
            height: auto !important;
            overflow-y: visible !important;
            overflow-x: hidden !important;
        }

        /* 7. Modals */
        .modal-content {
            width: 92% !important;
            max-width: none !important;
            margin: 20px auto !important;
            padding: 20px !important;
            box-sizing: border-box !important;
            border-radius: 12px !important;
        }

        .modal-grid {
            display: flex !important;
            flex-direction: column !important;
            gap: 20px !important;
        }

        .modal-info,
        .modal-qr {
            padding: 10px 0 !important;
            border: none !important;
        }

        #modal-free-download div[style*="display: flex"] {
            flex-direction: column !important;
            gap: 12px !important;
        }

        #modal-free-download a,
        #modal-free-download button {
            width: 100% !important;
            margin: 0 !important;
            box-sizing: border-box !important;
            padding: 12px !important;
        }
    }

/* Fix footer scroll snap */
.footer {
    scroll-snap-align: end;
}
