: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;
}

/* 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;
    background-color: #fff;
    border: 1px solid #eee !important;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    position: relative;
    text-decoration: none;
}
.product-card .position-relative {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    border-color: var(--primary-orange) !important;
    transform: translateY(-2px);
}

/* Custom Dropdown Styling */
.dropdown-item.active, .dropdown-item:active {
    background-color: #fff4e6 !important;
    color: var(--primary-orange) !important;
    font-weight: 600;
}
.dropdown-item.active i {
    color: var(--primary-orange) !important;
}
.dropdown-item:hover:not(.active) {
    background-color: #f8f9fa;
}

.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;
    }
    /* 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;
    }
}

/* 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: transform 0.3s ease, background-color 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.25s ease, visibility 0.25s ease;
    pointer-events: auto;
}
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.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);
    z-index: 2;
}
.loader-nail {
    width: 8px;
    height: 35px;
    background-color: #888;
    position: absolute;
    bottom: 0;
    right: 18px;
    border-radius: 2px;
    z-index: 1;
    animation: nail-sink 2.1s infinite;
}
.loader-nail::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 16px;
    height: 4px;
    background-color: #666;
    border-radius: 2px;
}
@keyframes hammer-hit {
    0% { transform: rotate(-45deg); }
    100% { transform: rotate(15deg); }
}
@keyframes nail-sink {
    0%, 15% { height: 35px; }
    16.6%, 48% { height: 25px; }
    50%, 81% { height: 15px; }
    83.3%, 95% { height: 5px; }
    98%, 100% { height: 35px; }
}
.loader-text-brand {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.5px;
    animation: pulse-glow 1.5s infinite alternate;
}
@keyframes pulse-glow {
    0% { opacity: 0.6; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1.02); }
}
.loader-text {
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 1px;
    font-size: 15px;
    text-align: center;
    line-height: 1.4;
}
.loader-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* 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 6 identical groups, moving by 16.666666% loops it seamlessly */
    100% { transform: translateX(-16.666666%); }
}

/* Dark Mode */
.dark-mode, .dark-mode body {
    --bg-gray: #121212;
    --border-color: #333333;
    --text-dark: #e0e0e0;
    --text-light: #a0a0a0;
    background-color: #1a1a1a !important;
    color: var(--text-dark);
}
.dark-mode .bg-light {
    background-color: #242424 !important;
}
.dark-mode .bg-white, 
.dark-mode .card, 
.dark-mode .offcanvas, 
.dark-mode .modal-content, 
.dark-mode .list-group-item,
.dark-mode .product-card {
    background-color: #242424 !important;
    color: #e0e0e0 !important;
    border-color: #333333 !important;
}
.dark-mode .form-control, 
.dark-mode .form-select, 
.dark-mode .dropdown-menu {
    background-color: #333333 !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}
.dark-mode .dropdown-item, 
.dark-mode .brand-logo, 
.dark-mode .category-item,
.dark-mode .text-dark,
.dark-mode h1, .dark-mode h2, .dark-mode h3, .dark-mode h4, .dark-mode h5, .dark-mode h6 {
    color: #e0e0e0 !important;
}
.dark-mode .dropdown-item:hover, 
.dark-mode .category-item:hover {
    background-color: #444 !important;
    color: #fff !important;
}
.dark-mode .text-muted {
    color: #999 !important;
}
.dark-mode .sticky-top {
    background-color: #1a1a1a !important;
}
.dark-mode .border-bottom, .dark-mode .border-end {
    border-color: #333 !important;
}
.dark-mode .btn-outline-secondary {
    border-color: #444;
    color: #e0e0e0;
}
.dark-mode .btn-outline-secondary:hover {
    background-color: #444;
}
.dark-mode #page-loader {
    background-color: #1a1a1a;
}
.dark-mode footer.bg-dark {
    background-color: #111 !important;
}

