/* --- CSS VARIABLES & THEME --- */
:root {
    /* Light Theme (Default) */
    --seo-tpl-bg-body: #ffffff;
    --seo-tpl-bg-header: #ffffff;
    --seo-tpl-text-main: #333333;
    --seo-tpl-text-muted: #666666;
    --seo-tpl-border: #e0e0e0;
    --seo-tpl-primary: #2563eb; /* SEO Blue */
    --seo-tpl-primary-hover: #1d4ed8;
    --seo-tpl-bg-input: #f3f4f6;
    --seo-tpl-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --seo-tpl-shadow-header: 0 1px 3px rgba(0,0,0,0.1);
    --seo-tpl-mobile-footer-bg: #ffffff;
    --seo-tpl-mobile-footer-border: #e5e7eb;
    --seo-tpl-scrollbar-track: #f1f1f1;
    --seo-tpl-scrollbar-thumb: #c1c1c1;
    --seo-tpl-glow-color: rgba(37, 99, 235, 0.5);
}

[data-theme="dark"] {
    --seo-tpl-bg-body: #111827;
    --seo-tpl-bg-header: #1f2937;
    --seo-tpl-text-main: #f9fafb;
    --seo-tpl-text-muted: #9ca3af;
    --seo-tpl-border: #374151;
    --seo-tpl-primary: #3b82f6;
    --seo-tpl-primary-hover: #60a5fa;
    --seo-tpl-bg-input: #374151;
    --seo-tpl-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --seo-tpl-shadow-header: 0 1px 3px rgba(0,0,0,0.5);
    --seo-tpl-mobile-footer-bg: #1f2937;
    --seo-tpl-mobile-footer-border: #374151;
    --seo-tpl-scrollbar-track: #1f2937;
    --seo-tpl-scrollbar-thumb: #4b5563;
    --seo-tpl-glow-color: rgba(59, 130, 246, 0.8);
}

/* --- GLOBAL RESET & TYPOGRAPHY --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--seo-tpl-bg-body);
    color: var(--seo-tpl-text-main);
    font-size: 16px;
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Thin Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--seo-tpl-scrollbar-track);
}
::-webkit-scrollbar-thumb {
    background: var(--seo-tpl-scrollbar-thumb);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--seo-tpl-primary);
}

/* --- HEADER STRUCTURE --- */
.seo-tpl-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--seo-tpl-bg-header);
    border-bottom: 1px solid var(--seo-tpl-border);
    box-shadow: var(--seo-tpl-shadow-header);
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    width: 100%;
    transition: transform 0.3s ease;
}

.seo-tpl-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Left Section: Launcher & Logo */
.seo-tpl-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.seo-tpl-app-launcher {
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--seo-tpl-text-muted);
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
    position: relative;
}

.seo-tpl-app-launcher:hover {
    background-color: var(--seo-tpl-bg-input);
    color: var(--seo-tpl-primary);
}

/* App Launcher Popover */
.seo-tpl-launcher-popover {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    width: 280px;
    background: var(--seo-tpl-bg-header);
    border: 1px solid var(--seo-tpl-border);
    box-shadow: var(--seo-tpl-shadow);
    border-radius: 8px;
    padding: 15px;
    z-index: 1001;
}
.seo-tpl-launcher-popover.active { display: block; }
.seo-tpl-launcher-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.seo-tpl-launcher-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--seo-tpl-text-main);
    text-align: center;
}
.seo-tpl-launcher-item:hover { background-color: var(--seo-tpl-bg-input); }
.seo-tpl-launcher-item i { font-size: 1.5rem; margin-bottom: 5px; color: var(--seo-tpl-primary); }


.seo-tpl-logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--seo-tpl-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Center Section: Menu */
.seo-tpl-header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.seo-tpl-nav-menu {
    display: flex;
    gap: 30px;
}

.seo-tpl-nav-item {
    position: relative;
    font-weight: 500;
    cursor: pointer;
    padding: 10px 0;
}

.seo-tpl-nav-item:hover {
    color: var(--seo-tpl-primary);
}

/* Submenu Demo */
.seo-tpl-submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--seo-tpl-bg-header);
    border: 1px solid var(--seo-tpl-border);
    box-shadow: var(--seo-tpl-shadow);
    border-radius: 6px;
    min-width: 200px;
    padding: 10px 0;
    display: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.seo-tpl-nav-item:hover .seo-tpl-submenu {
    display: block;
    opacity: 1;
}
.seo-tpl-submenu a {
    display: block;
    padding: 8px 20px;
    font-size: 0.9rem;
    color: var(--seo-tpl-text-main);
}
.seo-tpl-submenu a:hover {
    background-color: var(--seo-tpl-bg-input);
}

/* Right Section: Actions */
.seo-tpl-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.seo-tpl-icon-btn {
    position: relative;
    font-size: 1.1rem;
    color: var(--seo-tpl-text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    background: none;
    border: none;
}

.seo-tpl-icon-btn:hover {
    background-color: var(--seo-tpl-bg-input);
    color: var(--seo-tpl-primary);
}

.seo-tpl-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cart & User Dropdown */
.seo-tpl-cart-dropdown {
    display: none;
    position: absolute;
    top: 60px;
    right: 20px;
    width: 300px;
    background: var(--seo-tpl-bg-header);
    border: 1px solid var(--seo-tpl-border);
    box-shadow: var(--seo-tpl-shadow);
    border-radius: 8px;
    padding: 15px;
    z-index: 1002;
}
.seo-tpl-cart-dropdown.active { display: block; }
.seo-tpl-cart-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--seo-tpl-border);
    padding-bottom: 10px;
    font-size: 0.9rem;
}
.seo-tpl-view-cart-btn {
    display: block;
    text-align: center;
    background: var(--seo-tpl-primary);
    color: white;
    padding: 8px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 0.9rem;
}

.seo-tpl-auth-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.seo-tpl-btn-login {
    background: transparent;
    color: var(--seo-tpl-text-main);
    border: 1px solid transparent;
}
.seo-tpl-btn-login:hover {
    background: var(--seo-tpl-bg-input);
}

.seo-tpl-btn-start {
    background-color: var(--seo-tpl-primary);
    color: #ffffff;
    border: 1px solid var(--seo-tpl-primary);
}
.seo-tpl-btn-start:hover {
    background-color: var(--seo-tpl-primary-hover);
}

.seo-tpl-theme-toggle {
    cursor: pointer;
    margin-left: 5px;
    font-size: 1rem;
    color: var(--seo-tpl-text-muted);
}

/* Hamburger for Mobile/Tablet */
.seo-tpl-hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--seo-tpl-text-main);
    z-index: 1100;
}

/* User Profile Specifics */
.seo-user-avatar {
    border-radius: 50%;
    object-fit: cover;
    width: 32px;
    height: 32px;
}
.seo-tpl-user-menu-list {
    padding: 0;
    margin: 0;
    list-style: none;
}
.seo-tpl-user-menu-list li {
    margin-bottom: 0;
}
.seo-tpl-user-menu-list li a {
    display: block;
    padding: 8px 10px;
    color: var(--seo-tpl-text-main);
    border-radius: 4px;
    font-size: 0.9rem;
}
.seo-tpl-user-menu-list li a:hover {
    background-color: var(--seo-tpl-bg-input);
    color: var(--seo-tpl-primary);
}


/* --- SEARCH MODAL --- */
.seo-tpl-search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
    backdrop-filter: blur(2px);
}
.seo-tpl-search-modal.active { display: flex; }

.seo-tpl-search-box {
    background: var(--seo-tpl-bg-header);
    width: 90%;
    max-width: 600px;
    border-radius: 10px;
    box-shadow: var(--seo-tpl-shadow);
    overflow: hidden;
    border: 1px solid var(--seo-tpl-border);
}

.seo-tpl-search-input-wrapper {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--seo-tpl-border);
}
.seo-tpl-search-input-wrapper i { color: var(--seo-tpl-text-muted); margin-right: 10px; }
.seo-tpl-search-input {
    border: none;
    background: transparent;
    flex: 1;
    font-size: 1.1rem;
    color: var(--seo-tpl-text-main);
    outline: none;
}

.seo-tpl-search-results {
    padding: 10px 0;
    display: none; /* Shown via JS */
}
.seo-tpl-search-result-item {
    padding: 10px 20px;
    cursor: pointer;
    color: var(--seo-tpl-text-main);
    display: flex;
    justify-content: space-between;
}
.seo-tpl-search-result-item:hover { background-color: var(--seo-tpl-bg-input); }
.seo-tpl-search-actions {
    padding: 10px 20px;
    border-top: 1px solid var(--seo-tpl-border);
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--seo-tpl-primary);
}
.seo-tpl-search-actions span { cursor: pointer; font-weight: 500; }

/* --- OFF-CANVAS MENU (MOBILE) --- */
.seo-tpl-offcanvas {
    position: fixed;
    top: 70px; /* Below header */
    left: 0;
    width: 70%;
    height: calc(100% - 70px);
    background: var(--seo-tpl-bg-header);
    border-right: 1px solid var(--seo-tpl-border);
    box-shadow: var(--seo-tpl-shadow);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
    overflow: hidden;
}
.seo-tpl-offcanvas.active { transform: translateX(0); }

/* Drilldown Logic */
.seo-tpl-drilldown-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    overflow-x: hidden;
}
.seo-tpl-menu-level {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--seo-tpl-bg-header);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}
.seo-tpl-menu-level-1 { z-index: 1; transform: translateX(0); }
.seo-tpl-menu-level-2 { z-index: 2; transform: translateX(100%); }

/* When Level 2 is Active */
.seo-tpl-offcanvas.level-2-active .seo-tpl-menu-level-1 { transform: translateX(-30%); opacity: 0.5; }
.seo-tpl-offcanvas.level-2-active .seo-tpl-menu-level-2 { transform: translateX(0); }

.seo-tpl-mobile-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--seo-tpl-border);
    color: var(--seo-tpl-text-main);
    font-size: 1rem;
}
.seo-tpl-back-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0 20px 0;
    color: var(--seo-tpl-text-muted);
    cursor: pointer;
    border-bottom: 1px solid var(--seo-tpl-border);
    margin-bottom: 10px;
    font-weight: 600;
}

/* --- MAIN CONTENT --- */
.seo-tpl-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 80vh;
    /* Bottom padding for mobile sticky footer */
    padding-bottom: 80px; 
}

.seo-tpl-breadcrumbs {
    font-size: 0.9rem;
    color: var(--seo-tpl-text-muted);
    margin-bottom: 20px;
}
.seo-tpl-breadcrumbs span { margin: 0 5px; }
.seo-tpl-breadcrumbs a:hover { color: var(--seo-tpl-primary); }

.seo-tpl-content-card {
    background-color: var(--seo-tpl-bg-header); /* Use header bg for card contrast if needed */
    border: 1px solid var(--seo-tpl-border);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin-top: 2px; /* 2px padding in between content as requested */
    margin-bottom: 2px;
}

.seo-tpl-content-placeholder {
    padding: 50px 0;
}
.seo-tpl-content-placeholder h1 { margin-bottom: 10px; }

/* --- FOOTER (PAGE CONTENT FOOTER) --- */
.seo-tpl-main-footer {
    background-color: #000000;
    color: #ffffff;
    padding: 60px 20px 20px 20px;
    margin-top: 50px;
    padding-bottom: 100px; /* Space for mobile sticky nav */
}

.seo-tpl-footer-top {
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto 40px auto;
}

.seo-tpl-footer-col-left {
    width: 30%;
    padding-right: 40px;
}
.seo-tpl-footer-col-right {
    width: 70%;
    display: flex;
    flex-wrap: wrap;
}

.seo-tpl-footer-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 15px;
    display: block;
}
.seo-tpl-footer-desc {
    color: #9ca3af;
    font-size: 0.9rem;
    line-height: 1.6;
}

.seo-tpl-footer-menu-col {
    flex: 1;
    min-width: 150px;
}
.seo-tpl-footer-menu-col h4 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 1rem;
}
.seo-tpl-footer-menu-col ul li { margin-bottom: 10px; }
.seo-tpl-footer-menu-col ul li a { color: #9ca3af; font-size: 0.9rem; transition: color 0.2s; }
.seo-tpl-footer-menu-col ul li a:hover { color: #ffffff; }

.seo-tpl-app-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}
.seo-tpl-app-btn {
    background: #333;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    width: fit-content;
}
.seo-tpl-app-btn i { font-size: 1.2rem; }

/* Footer Bottom */
.seo-tpl-footer-bottom {
    width: 80%;
    margin: 0 auto;
    text-align: center;
}

.seo-tpl-glowing-border {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--seo-tpl-primary), transparent);
    box-shadow: 0 0 10px var(--seo-tpl-glow-color);
    margin-bottom: 20px;
    width: 100%;
}

.seo-tpl-socials a {
    color: #9ca3af;
    margin: 0 10px;
    font-size: 1.2rem;
    transition: color 0.3s;
}
.seo-tpl-socials a:hover { color: var(--seo-tpl-primary); }

.seo-tpl-footer-legal {
    margin-top: 20px;
    font-size: 0.85rem;
    color: #6b7280;
}
.seo-tpl-footer-legal span, .seo-tpl-footer-legal a {
    margin: 0 8px;
}

/* --- MOBILE STICKY FOOTER --- */
.seo-tpl-mobile-sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--seo-tpl-mobile-footer-bg);
    border-top: 1px solid var(--seo-tpl-mobile-footer-border);
    display: none; /* Hidden on desktop */
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.seo-tpl-sticky-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--seo-tpl-text-muted);
    font-size: 0.75rem;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    width: 20%;
}
.seo-tpl-sticky-item i {
    font-size: 1.2rem;
    margin-bottom: 4px;
}
.seo-tpl-sticky-item.active {
    color: var(--seo-tpl-primary);
}
.seo-tpl-sticky-count {
    position: absolute;
    top: -2px;
    right: 15px; /* adjust based on icon width */
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 10px;
}

/* --- RESPONSIVE BREAKPOINTS --- */

/* TABLET & MOBILE (Max 1024px) */
@media (max-width: 1024px) {
    .seo-tpl-header-center,
    .seo-tpl-app-launcher,
    .seo-tpl-btn-start,
    .seo-tpl-btn-login {
        display: none; /* Hide Desktop Elements */
    }
    
    /* Show Hamburger & Mobile Elements */
    .seo-tpl-hamburger { display: block; }
    .seo-tpl-header-left { gap: 10px; }
    .seo-tpl-header-right { gap: 10px; }
    
    /* Add Sign In Button for Mobile/Tablet */
    .seo-tpl-mobile-signin {
        display: block;
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--seo-tpl-primary);
        border: 1px solid var(--seo-tpl-border);
        padding: 6px 12px;
        border-radius: 4px;
    }

    /* Footer Adjustments */
    .seo-tpl-footer-col-left { width: 100%; margin-bottom: 30px; text-align: left; }
    .seo-tpl-footer-col-right { width: 100%; }
}

/* TABLET SPECIFIC (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .seo-tpl-footer-col-right {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

/* MOBILE SPECIFIC (Max 767px) */
@media (max-width: 767px) {
    .seo-tpl-mobile-sticky-footer { display: flex; }
    .seo-tpl-main-footer { padding-bottom: 80px; } /* Ensure content above sticky footer */
    
    .seo-tpl-footer-col-right {
        flex-direction: column;
    }
    .seo-tpl-footer-menu-col { margin-bottom: 25px; }

    /* Mobile Header Specifics */
    .seo-tpl-header { padding: 0 15px; height: 60px; }
    .seo-tpl-offcanvas { top: 60px; height: calc(100% - 60px); }

    /* Fix Cart Dropdown on Mobile */
    .seo-tpl-cart-dropdown {
        position: fixed;
        top: 65px; /* Just below the 60px mobile header */
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 90%;
        max-width: 350px;
    }
}

/* Utility for desktop hiding mobile signin */
@media (min-width: 1025px) {
    .seo-tpl-mobile-signin { display: none; }
}

/* --- Default Styles (Mobile View) --- */
.desktop-img {
    width: 190px;
    display: none; /* Hide desktop image on small screens */
}
.mobile-img {
    width: 40px;
    display: block; /* Show mobile image */
}

/* --- Desktop View (Triggered at 768px width) --- */
@media (min-width: 768px) {
    .desktop-img {
        width: 190px;
        display: block; /* Show desktop image */
    }
    .mobile-img {
        width: 40px;
        display: none; /* Hide mobile image */
    }
}