:root {
    --purple: #50c4ed;
    --purple-dark: #2da8d4;
    --purple-light: #8ad8f4;
}

/* Utility colors */
.bg-purple { background-color: var(--purple) !important; }
.text-purple { color: var(--purple) !important; }
.border-purple { border-color: var(--purple) !important; }

/* Buttons */
.btn-purple {
    background-color: #226ede;
    color: #fff;
    border: none;
}
.btn-purple:hover, .btn-purple:focus {
    background-color: #1c5bc0;
    color: #fff;
    box-shadow: 0 4px 12px rgba(34, 110, 222, 0.4);
}
.btn-purple:disabled {
    background-color: #226ede;
    color: #fff;
    opacity: 0.65;
}
.btn-outline-purple {
    border: 2px solid #226ede;
    color: #226ede;
    background: transparent;
}
.btn-outline-purple:hover, .btn-outline-purple:focus {
    background-color: #226ede;
    color: #fff;
}

/* Navbar */
.navbar.bg-purple {
    background-color: var(--purple) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, #50c4ed 0%, #2da8d4 100%);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(80, 196, 237, 0.3);
}

/* Product cards */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 0.75rem;
    overflow: hidden;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
}

/* Product images */
.product-img-wrapper {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: #f8f9fa;
}
.product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.4s ease;
}
.product-img-hover {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}
.product-card:hover .product-img:not(.product-img-hover) {
    opacity: 0;
}
.product-card:hover .product-img-hover {
    opacity: 1;
}

/* Product tags overlay */
.product-tags-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    z-index: 1;
}
.product-tags-overlay .badge {
    font-size: 0.7rem;
}

/* Category cards */
.category-card {
    border-radius: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(80, 196, 237, 0.15) !important;
}

/* Section titles */
.section-title {
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--purple);
    margin-top: 8px;
    border-radius: 2px;
}

/* Product detail */
.product-detail-img-wrapper img {
    max-height: 450px;
    width: 100%;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 0.75rem;
}

/* Pagination */
.page-item.active .page-link {
    background-color: var(--purple);
    border-color: var(--purple);
}
.page-link {
    color: var(--purple);
}
.page-link:hover {
    color: var(--purple-dark);
}
.page-link:focus {
    box-shadow: 0 0 0 0.25rem rgba(80, 196, 237, 0.25);
}

/* Admin stat cards */
.card.bg-purple {
    background-color: var(--purple) !important;
}

/* Badges */
.badge.bg-purple {
    background-color: var(--purple) !important;
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--purple-light);
    box-shadow: 0 0 0 0.25rem rgba(80, 196, 237, 0.25);
}

/* General card improvements */
.card {
    border-radius: 0.75rem;
}

/* Footer */
footer a:hover {
    color: var(--purple-light) !important;
}

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--purple-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple); }

/* Navbar logo */
.navbar-logo {
    height: 36px;
    width: auto;
}

.footer-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.th-nav-grid {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas:
        "brand mobile-actions toggler toggler"
        "content content content content";
    gap: 0.5rem 1rem;
    align-items: center;
}

.th-mobile-actions {
    grid-area: mobile-actions;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.th-mobile-actions .nav-link {
    color: #fff !important;
    padding: 0.25rem;
    font-size: 1.1rem;
    position: relative;
}

.th-mobile-actions .badge {
    position: absolute;
    top: -4px;
    right: -8px;
    font-size: 0.6rem;
    padding: 0.2em 0.4em;
}

.th-brand {
    grid-area: brand;
    align-self: stretch;
    margin: 0;
    display: flex;
    align-items: center;
    padding: 0;
    padding-left: 2rem;
}

.th-brand .navbar-logo {
    height: 104px;
    width: auto;
    object-fit: contain;
}

.navbar-toggler {
    grid-area: toggler;
    justify-self: end;
}

.th-nav-content {
    grid-area: content;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.th-nav-top,
.th-nav-bottom {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
}

.th-header-search {
    flex: 1 1 auto;
    max-width: 640px;
    margin: 0 auto;
}

.th-header-search .form-control {
    border: none;
}

.th-header-search .btn {
    border: none;
    color: var(--purple-dark);
}

.th-quick-links,
.th-main-menu {
    gap: 0.25rem;
}

.th-quick-links {
    margin-left: auto;
}

.th-main-menu {
    margin-left: 0;
    margin-right: auto;
    padding-left: 0;
    position: relative;
}

.th-menu-item {
    position: relative;
    list-style: none;
}

.th-menu-link-wrap {
    display: flex;
    align-items: center;
}

.th-menu-link {
    white-space: nowrap;
}

.th-submenu-toggle {
    border: none;
    background: transparent;
    color: #000;
    padding: 0.25rem 0.4rem;
    font-size: 0.8rem;
}

.th-submenu {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
}

.th-submenu .th-menu-item {
    width: 100%;
}

.th-submenu .th-menu-link-wrap {
    width: 100%;
}

.th-submenu .th-menu-link {
    display: block;
    width: 100%;
    padding: 0.4rem 0.9rem;
    color: #1f1f1f !important;
    text-decoration: none;
}

.th-submenu .th-menu-link:hover {
    background: #e9f7fc;
}

.th-quick-links .nav-link,
.th-main-menu .nav-link {
    color: #000 !important;
}

.th-lang-links {
    display: flex;
    align-items: center;
}

.th-lang-links .nav-link {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

.th-lang-links .nav-link.active {
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 700;
}

.th-lang-sep {
    opacity: 0.8;
}

@media (min-width: 992px) {
    .th-nav-grid {
        grid-template-columns: auto 1fr;
        grid-template-areas: "brand content";
        align-items: stretch;
    }

    .th-mobile-actions {
        display: none !important;
    }

    .navbar-toggler {
        display: none;
    }

    .th-nav-content {
        display: flex !important;
        min-height: 74px;
        justify-content: center;
        padding-left: 1rem;
        width: 100%;
    }

    .th-nav-top {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(420px, 640px) auto;
        align-items: center;
        width: 100%;
        gap: 0.75rem;
    }

    .th-header-search {
        grid-column: 2;
        max-width: none;
        width: 100%;
        margin: 0;
    }

    .th-quick-links {
        grid-column: 3;
        justify-self: end;
        margin-left: 0;
    }

    .th-nav-bottom {
        justify-content: flex-start;
        width: 100%;
    }

    .th-main-menu {
        margin: 0;
        justify-content: flex-start;
    }

    .th-main-menu > .th-menu-item > .th-submenu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 220px;
        background: #fff;
        border-radius: 0.5rem;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
        z-index: 1200;
    }

    .th-main-menu > .th-menu-item:hover > .th-submenu {
        display: block;
    }

    .th-main-menu > .th-menu-item.has-submenu > .th-menu-link-wrap > .th-menu-link::after {
        content: '▾';
        margin-left: 0.35rem;
        font-size: 0.7rem;
    }

    .th-submenu-toggle {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .th-brand .navbar-logo {
        height: 64px;
    }

    .th-nav-top,
    .th-nav-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .th-header-search {
        max-width: none;
    }

    .th-quick-links,
    .th-main-menu {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
    }

    .th-main-menu {
        flex-direction: column;
    }

    .th-main-menu > .th-menu-item {
        width: 100%;
    }

    .th-main-menu > .th-menu-item > .th-menu-link-wrap {
        justify-content: space-between;
        width: 100%;
    }

    .th-main-menu > .th-menu-item > .th-submenu {
        display: none;
        width: 100%;
        background: rgba(255, 255, 255, 0.84);
        border-radius: 0.5rem;
        margin-bottom: 0.35rem;
    }

    .th-main-menu > .th-menu-item.open > .th-submenu {
        display: block;
    }

    .th-quick-links {
        margin-left: 0;
        justify-content: flex-end;
    }
}

/* ══════════════════════════════════════════════════════════════
   TOP BAR
   ══════════════════════════════════════════════════════════════ */
.top-bar {
    background-color: #000 !important;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}
.top-bar,
.top-bar * {
    color: #fff !important;
}
.top-bar-social a {
    transition: opacity 0.2s;
}
.top-bar-social a:hover {
    opacity: 0.7;
}

/* ══════════════════════════════════════════════════════════════
   HERO CAROUSEL
   ══════════════════════════════════════════════════════════════ */
.hero-carousel {
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.hero-slide {
    min-height: 420px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #0f1115;
}
.hero-slide-link {
    display: block;
    text-decoration: none;
}
.hero-slide-overlay {
    min-height: 420px;
    background: transparent;
    padding: 2rem;
}
.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    width: 5%;
}

/* ══════════════════════════════════════════════════════════════
   BRANDS MARQUEE
   ══════════════════════════════════════════════════════════════ */
.brands-marquee {
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 0.75rem 0;
}
.brands-marquee::before,
.brands-marquee::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 2;
    pointer-events: none;
}
.brands-marquee::before {
    left: 0;
    background: linear-gradient(to right, #f8f9fa, transparent);
}
.brands-marquee::after {
    right: 0;
    background: linear-gradient(to left, #f8f9fa, transparent);
}
.brands-track {
    display: flex;
    gap: 1.5rem;
    animation: marquee-scroll 180s linear infinite;
    width: max-content;
}
.brands-track:hover {
    animation-play-state: paused;
}
.brand-item {
    text-decoration: none;
    flex-shrink: 0;
}
.brand-pill {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border-radius: 2rem;
    background: white;
    color: #333;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #e0e0e0;
    white-space: nowrap;
    transition: all 0.2s;
}
.brand-pill:hover {
    background: var(--purple);
    color: #fff;
    border-color: var(--purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(80, 196, 237, 0.3);
}
@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ══════════════════════════════════════════════════════════════
   CENTERED SECTION TITLE
   ══════════════════════════════════════════════════════════════ */
.section-title-center {
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
}
.section-title-center::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--purple);
    margin: 8px auto 0;
    border-radius: 2px;
}

/* ══════════════════════════════════════════════════════════════
   CATEGORY BLOCKS
   ══════════════════════════════════════════════════════════════ */
.category-block {
    display: block;
    padding: 0.6rem 0.25rem;
    border-radius: 0.75rem;
    background: var(--purple);
    transition: all 0.25s;
}
.category-block:hover {
    background: #43b7e2;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(80, 196, 237, 0.25);
}
.category-block .category-icon-wrapper {
    color: #fff;
}
.category-block p {
    color: #fff !important;
}
.category-icon-wrapper {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: var(--purple);
    transition: all 0.25s;
}

.category-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ══════════════════════════════════════════════════════════════
   FEATURED TABS
   ══════════════════════════════════════════════════════════════ */
.featured-tabs .nav-link {
    border-radius: 2rem;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    color: #555;
    background: transparent;
    border: 2px solid transparent;
    margin: 0 0.25rem;
    transition: all 0.2s;
}
.featured-tabs .nav-link:hover {
    color: var(--purple);
    border-color: var(--purple-light);
}

/* ========== Search Autocomplete Dropdown ========== */
.search-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 400px;
    overflow-y: auto;
}
.search-dropdown-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: #888;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    text-transform: uppercase;
}
.search-dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}
.search-dropdown-item:hover {
    background: #f8f4ff;
    color: var(--purple);
}
.search-dropdown-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 0.75rem;
    flex-shrink: 0;
}
.search-dropdown-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.search-dropdown-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-dropdown-price {
    font-size: 0.8rem;
    color: var(--purple);
    font-weight: 600;
}
.search-dropdown-viewall {
    display: block;
    padding: 0.6rem 0.75rem;
    text-align: center;
    color: var(--purple);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    border-top: 1px solid #eee;
    transition: background 0.15s;
}
.search-dropdown-viewall:hover {
    background: #f8f4ff;
}
.search-dropdown-empty {
    padding: 1rem 0.75rem;
    text-align: center;
    color: #888;
    font-size: 0.85rem;
}
.featured-tabs .nav-link.active {
    background: var(--purple);
    color: #fff;
    border-color: var(--purple);
}

/* Product badges */
.product-badge-new {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.65rem;
    z-index: 1;
}
.product-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

/* ══════════════════════════════════════════════════════════════
   TRUST BADGES
   ══════════════════════════════════════════════════════════════ */
.trust-badges {
    background: #f8f9fa;
    border-radius: 0.75rem;
}
.trust-badge-item {
    padding: 1rem 0.5rem;
}
.trust-badge-item i {
    display: block;
}

/* ══════════════════════════════════════════════════════════════
   SEO SECTION
   ══════════════════════════════════════════════════════════════ */
.seo-section {
    padding: 2rem 0;
}

/* ══════════════════════════════════════════════════════════════
   NEWSLETTER
   ══════════════════════════════════════════════════════════════ */
.newsletter-section {
    background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple) 100%);
    box-shadow: 0 8px 32px rgba(80, 196, 237, 0.3);
}
.newsletter-section .form-control {
    border: none;
    border-radius: 0.5rem 0 0 0.5rem;
}
.newsletter-section .btn {
    border-radius: 0 0.5rem 0.5rem 0;
    color: var(--purple);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .hero-slide {
        min-height: 280px;
    }
    .hero-slide-overlay {
        min-height: 280px;
    }
    .hero-slide-overlay h1 {
        font-size: 1.6rem;
    }
    .hero-slide-overlay h2 {
        font-size: 1.4rem;
    }
    .hero-slide-overlay .lead {
        font-size: 0.95rem;
    }
}
