:root {
    --primary-orange: #F86F00;
    --hover-orange: #e6621a;
    --bg-gray: #F8FAFB;
    --border-color: #E9EAEB;
    --text-dark: #414651;
    --text-light: #A4A7AE;
}

body {
    background-color: #fff;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-dark);
}

/* Header Top */
.header-top {
    background-color: #2b2d42; /* Dark distinct color */
    padding: 8px 0;
    font-size: 12px;
}
.header-top a {
    color: #e0e0e0;
    margin-left: 20px;
    text-decoration: none;
}
.header-top a:hover {
    color: #fff;
}
.header-top .text-success {
    color: #ffc107 !important; /* Warning/Yellow color to pop on dark bg */
    font-size: 13px;
}
.header-top .orange-link {
    background-color: var(--primary-orange);
    color: #fff !important;
    padding: 3px 12px;
    border-radius: 15px;
    font-weight: bold;
}

/* Main Header */
.main-header {
    background-color: #fff;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.brand-logo {
    font-size: 32px;
    font-weight: 800;
    color: #333;
    text-decoration: none;
    letter-spacing: -1px;
}
.brand-logo span {
    color: var(--primary-orange);
}

/* Search Bar */
.search-wrapper {
    display: flex;
    background-color: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: 48px;
    align-items: center;
    padding-left: 15px;
    overflow: hidden;
}
.search-wrapper input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    padding-left: 10px;
    font-size: 14px;
}
.search-wrapper button {
    background-color: var(--primary-orange);
    color: white;
    border: none;
    height: 100%;
    padding: 0 25px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.search-wrapper button:hover {
    background-color: var(--hover-orange);
}

/* Header Buttons (Account & Cart) */
.header-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-dark);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    gap: 4px;
    position: relative;
    text-decoration: none;
}
.header-btn i {
    font-size: 20px;
    color: #333;
}
.header-btn:hover {
    color: var(--primary-orange);
}
.header-btn:hover i {
    color: var(--primary-orange);
}
.cart-badge {
    position: absolute;
    top: -5px;
    right: 5px;
    background-color: var(--primary-orange);
    color: white;
    font-size: 10px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
}

/* Layout */
.main-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

/* Sidebar Categories */
.sidebar {
    width: 250px;
    flex-shrink: 0;
}
.category-menu {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}
.category-menu .menu-header {
    background-color: var(--primary-orange);
    color: white;
    padding: 15px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.category-list li {
    border-bottom: 1px solid var(--border-color);
}
.category-list li:last-child {
    border-bottom: none;
}
.category-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.category-list a:hover, .category-list a.active {
    background-color: var(--bg-gray);
    color: var(--primary-orange);
}

/* Main Content Area */
.content-area {
    flex-grow: 1;
    min-width: 0;
}

/* Hero Banner Replica */
.toptan-banner {
    background: url('https://imagedelivery.net/Dp1lIf5jOJmvQ9N2YPEaog/4d0a5160-5a50-4d37-8468-b710777e4000/full') center/cover no-repeat;
    border-radius: 12px;
    height: 300px;
    margin-bottom: 30px;
    background-color: #f1f1f1;
    position: relative;
    overflow: hidden;
}
.toptan-banner-content {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 40px;
}
.toptan-banner h2 {
    color: #fff;
    font-weight: 800;
    font-size: 32px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* Section Title */
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.section-title a {
    font-size: 13px;
    color: var(--primary-orange);
    text-decoration: none;
    font-weight: 600;
}

/* Product Cards EXACT Replica */
.product-card {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #FFF;
    transition: all 0.2s ease;
    height: 100%;
    position: relative;
    text-decoration: none;
}
.product-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    border-color: #dcdcdc;
    transform: translateY(-2px);
}
.product-image {
    width: 100%;
    aspect-ratio: 1;
    background-color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    padding: 10px;
}
.product-image i {
    font-size: 60px;
    color: #e0e0e0;
}
.product-category-label {
    font-size: 10px;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 4px;
}
.product-name {
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 15px;
    height: 36px;
}
.product-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.price-block {
    display: flex;
    flex-direction: column;
}
.old-price {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 11px;
}
.current-price {
    color: var(--primary-orange);
    font-size: 18px;
    font-weight: 700;
}
.add-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--primary-orange);
    background: #fff;
    color: var(--primary-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.add-btn i {
    font-size: 14px;
    pointer-events: none;
}
.add-btn:hover {
    background: var(--primary-orange);
    color: #fff;
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        margin-top: 10px;
    }
    .sidebar {
        display: none; /* Hide sidebar on mobile in favor of top dropdown */
    }
    .mobile-category-wrap {
        display: block !important;
    }
    
    /* Hero Banner Mobile */
    .toptan-banner {
        height: 180px;
        margin-bottom: 20px;
        border-radius: 8px;
    }
    .toptan-banner-content {
        left: 20px;
    }
    .toptan-banner h2 {
        font-size: 22px;
    }
    .toptan-banner .btn {
        font-size: 14px;
        padding: 5px 15px;
        margin-top: 10px !important;
    }
    
    /* Header Mobile */
    .main-header {
        padding: 10px 0;
    }
    .brand-logo {
        font-size: 24px;
    }
    .search-wrapper {
        height: 40px;
    }
    .search-wrapper input {
        font-size: 13px;
    }
    .search-wrapper button {
        padding: 0 15px;
    }
    
    /* Product Cards Mobile */
    .product-card {
        padding: 8px;
    }
    .product-image {
        padding: 5px;
        margin-bottom: 8px;
    }
    .product-image i {
        font-size: 40px;
    }
    .product-name {
        font-size: 11px;
        margin-bottom: 10px;
        height: 30px;
    }
    .current-price {
        font-size: 15px;
    }
    .old-price {
        font-size: 10px;
    }
    .add-btn {
        width: 28px;
        height: 28px;
    }
    .add-btn i {
        font-size: 12px;
    }
    
    /* Sections Mobile */
    .section-title {
        font-size: 15px;
        margin-top: 30px !important;
        margin-bottom: 15px;
    }
}
.mobile-category-wrap {
    display: none;
}

/* Cart Items */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.cart-item-info strong {
    font-size: 14px;
    color: var(--text-dark);
}
.cart-item-actions button {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 18px;
    cursor: pointer;
}

/* Floating Cart Button */
.floating-cart-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-orange);
    color: white;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 4px 15px rgba(248, 111, 0, 0.4);
    cursor: pointer;
    z-index: 1030;
    transition: all 0.3s ease;
    border: none;
}
.floating-cart-btn:hover {
    transform: scale(1.1);
    background-color: var(--hover-orange);
    color: white;
}
.floating-cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #dc3545;
    color: white;
    font-size: 13px;
    font-weight: bold;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Sticky Mobile CTA */
.sticky-mobile-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #fff;
    padding: 10px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1040;
}
body {
    padding-bottom: 0; /* Changed to 0, will be handled by JS or just let it overlay */
}
@media (max-width: 768px) {
    .floating-cart-btn {
        display: none !important; /* Hide floating on mobile, use sticky CTA instead */
    }
}

/* Page Loader */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-gray);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.loader-animation-area {
    position: relative;
    width: 80px;
    height: 70px;
}
.loader-hammer {
    font-size: 50px;
    color: var(--primary-orange);
    position: absolute;
    top: -5px;
    left: 0;
    transform-origin: bottom left;
    animation: hammer-hit 0.35s infinite alternate cubic-bezier(0.5, 0, 1, 1);
}
.loader-nail {
    width: 8px;
    height: 35px;
    background-color: #888;
    position: absolute;
    bottom: 0;
    right: 18px;
    border-radius: 2px;
}
.loader-nail::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 16px;
    height: 4px;
    background-color: #666;
    border-radius: 2px;
}
.loader-text {
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 1px;
    font-size: 15px;
    text-align: center;
    line-height: 1.4;
}
@keyframes hammer-hit {
    0% { transform: rotate(-35deg); }
    100% { transform: rotate(15deg); }
}
.loader-hidden {
    opacity: 0;
    visibility: hidden;
}

/* Hide number input arrows */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}
.hover-orange:hover {
    color: var(--primary-orange) !important;
}

/* Fix footer text visibility */
footer .text-muted {
    color: #ced4da !important;
}

/* Horizontal Category Navbar */
.category-item.active {
    color: var(--primary-orange) !important;
    border-bottom: 2px solid var(--primary-orange) !important;
}
.category-scroll-container::-webkit-scrollbar {
    height: 6px;
}
.category-scroll-container::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
}

/* Story Infinite Marquee */
.story-marquee-wrapper {
    width: 100%;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
    mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
}
.story-marquee-track {
    width: max-content;
    animation: marquee-scroll 25s linear infinite;
}
.story-marquee-track:hover {
    animation-play-state: paused;
}
@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    /* Since we have 3 identical groups, moving by 33.333% loops it seamlessly */
    100% { transform: translateX(-33.333333%); }
}
