/**
 * BDShop Custom Styles
 * Main stylesheet for the cosmetics e-commerce website
 * Primary Brand Color: #083862 (Ocean Blue)
 */

/* Global font size and spacing adjustment - 92% of original size (15% larger than previous 80%) */
html {
    font-size: 92%;
}

/* Ensure consistent font size across the site */
body {
    font-size: 1rem;
    /* This will now be 92% of the default */
    /* Mulish font is applied via mulish-fonts.css */
}

/* Adjust spacing and gaps globally */
* {
    --spacing-scale: 0.92;
}

/* Scale common spacing utilities */
.p-1 {
    padding: calc(0.25rem * 0.92) !important;
}

.p-2 {
    padding: calc(0.5rem * 0.92) !important;
}

.p-3 {
    padding: calc(0.75rem * 0.92) !important;
}

.p-4 {
    padding: calc(1rem * 0.92) !important;
}

.p-5 {
    padding: calc(1.25rem * 0.92) !important;
}

.p-6 {
    padding: calc(1.5rem * 0.92) !important;
}

.p-8 {
    padding: calc(2rem * 0.92) !important;
}

.m-1 {
    margin: calc(0.25rem * 0.92) !important;
}

.m-2 {
    margin: calc(0.5rem * 0.92) !important;
}

.m-3 {
    margin: calc(0.75rem * 0.92) !important;
}

.m-4 {
    margin: calc(1rem * 0.92) !important;
}

.m-5 {
    margin: calc(1.25rem * 0.92) !important;
}

.m-6 {
    margin: calc(1.5rem * 0.92) !important;
}

.m-8 {
    margin: calc(2rem * 0.92) !important;
}

/* Scale gaps */
.gap-1 {
    gap: calc(0.25rem * 0.92) !important;
}

.gap-2 {
    gap: calc(0.5rem * 0.92) !important;
}

.gap-3 {
    gap: calc(0.75rem * 0.92) !important;
}

.gap-4 {
    gap: calc(1rem * 0.92) !important;
}

.gap-5 {
    gap: calc(1.25rem * 0.92) !important;
}

.gap-6 {
    gap: calc(1.5rem * 0.92) !important;
}

.gap-8 {
    gap: calc(2rem * 0.92) !important;
}

/* Scale specific padding/margin directions */
.px-3 {
    padding-left: calc(0.75rem * 0.92) !important;
    padding-right: calc(0.75rem * 0.92) !important;
}

.px-4 {
    padding-left: calc(1rem * 0.92) !important;
    padding-right: calc(1rem * 0.92) !important;
}

.px-6 {
    padding-left: calc(1.5rem * 0.92) !important;
    padding-right: calc(1.5rem * 0.92) !important;
}

.py-2 {
    padding-top: calc(0.5rem * 0.92) !important;
    padding-bottom: calc(0.5rem * 0.92) !important;
}

.py-3 {
    padding-top: calc(0.75rem * 0.92) !important;
    padding-bottom: calc(0.75rem * 0.92) !important;
}

.py-4 {
    padding-top: calc(1rem * 0.92) !important;
    padding-bottom: calc(1rem * 0.92) !important;
}

.mx-4 {
    margin-left: calc(1rem * 0.92) !important;
    margin-right: calc(1rem * 0.92) !important;
}

.my-4 {
    margin-top: calc(1rem * 0.92) !important;
    margin-bottom: calc(1rem * 0.92) !important;
}

.mb-4 {
    margin-bottom: calc(1rem * 0.92) !important;
}

.mt-4 {
    margin-top: calc(1rem * 0.92) !important;
}

/* Scale space between elements */
.space-x-2> :not([hidden])~ :not([hidden]) {
    margin-left: calc(0.5rem * 0.92) !important;
}

.space-x-3> :not([hidden])~ :not([hidden]) {
    margin-left: calc(0.75rem * 0.92) !important;
}

.space-x-4> :not([hidden])~ :not([hidden]) {
    margin-left: calc(1rem * 0.92) !important;
}

.space-y-2> :not([hidden])~ :not([hidden]) {
    margin-top: calc(0.5rem * 0.92) !important;
}

.space-y-3> :not([hidden])~ :not([hidden]) {
    margin-top: calc(0.75rem * 0.92) !important;
}

.space-y-4> :not([hidden])~ :not([hidden]) {
    margin-top: calc(1rem * 0.92) !important;
}

/* Ensure footer is always full width */
footer {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom hover effects */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Custom gradient backgrounds */
.gradient-primary {
    background: linear-gradient(135deg, #083862 0%, #0f5bb8 100%);
}

.gradient-accent {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Product card hover effects */
.product-card {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #e5e7eb;
}

/* Custom button styles */
.btn-primary {
    background-color: #083862;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #0f5bb8;
}

.btn-secondary {
    background-color: #4b5563;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn-secondary:hover {
    background-color: #374151;
}

.btn-accent {
    background-color: #f59e0b;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-accent:hover {
    background-color: #d97706;
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #083862;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Slider specific styles */
.slider-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 0.5rem;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 1;
}

.slide-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Mobile responsive slider */
@media (max-width: 768px) {
    .slider-container {
        height: 300px;
    }
}

/* Notification styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.notification.show {
    transform: translateX(0);
}

/* Dropdown animations */
.group .absolute {
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

/* Custom scrollbar for category menu */
.category-menu::-webkit-scrollbar {
    width: 6px;
}

.category-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.category-menu::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.category-menu::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Form styles */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(8, 56, 98, 0.2);
    border-color: #083862;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-0.25rem);
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background-color: #083862;
    color: white;
}

.badge-accent {
    background-color: #f59e0b;
    color: #1f2937;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-warning {
    background-color: #fef9c3;
    color: #854d0e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Custom scrollbar for category menu */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* For Firefox */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
}

/* Toast notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background-color: #10b981;
}

.toast.error {
    background-color: #ef4444;
}

.toast.warning {
    background-color: #f59e0b;
}

.toast.info {
    background-color: #3b82f6;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* Price styling */
.price-original {
    text-decoration: line-through;
    color: #6b7280;
}

.price-sale {
    color: #ef4444;
    font-weight: 600;
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-sale {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-new {
    background-color: #dcfce7;
    color: #166534;
}

.badge-featured {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Responsive utilities */
@media (max-width: 640px) {
    .mobile-hidden {
        display: none;
    }
}

/* Slider Styles */
.slider-container {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
}

.slide.active {
    opacity: 1;
}

.slide-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}

.slider-btn {
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}

.indicator {
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background-color: white !important;
    transform: scale(1.2);
}

/* Category Menu Hover Effects */
.category-menu-item {
    position: relative;
    overflow: hidden;
}

.category-menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.5s ease;
}

.category-menu-item:hover::before {
    left: 100%;
}

/* Responsive Slider */
@media (max-width: 768px) {
    .slider-container {
        height: 300px;
    }

    /* Match category menu height with mobile slider */
    .lg\:w-1\/5>div {
        height: 300px !important;
    }

    .slide-content .text-3xl {
        font-size: 1.5rem !important;
    }

    .slide-content .lg\:text-5xl {
        font-size: 2rem !important;
    }

    .slide-content .text-lg {
        font-size: 0.875rem !important;
    }

    .slide-content .lg\:text-xl {
        font-size: 1rem !important;
    }
}

/* Category menu specific responsive adjustments */
@media (max-width: 1024px) {
    .lg\:w-1\/5>div {
        height: auto;
        min-height: 400px;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }
}

/* Deals Carousel Styles */
.deals-carousel-container {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.deal-item {
    cursor: grab;
}

.deal-item:active {
    cursor: grabbing;
}

#deals-carousel {
    will-change: transform;
}

/* Mobile carousel fixes */
@media (max-width: 640px) {
    #deals-carousel {
        gap: 0.75rem !important;
        /* Reduce gap on mobile */
    }

    /* Ensure carousel items don't overflow */
    .deals-carousel-container .overflow-hidden {
        margin: 0 -0.5rem;
        /* Negative margin to account for padding */
        padding: 0 0.5rem;
        /* Add padding back */
    }
}

/* Tablet carousel adjustments */
@media (min-width: 641px) and (max-width: 1024px) {
    #deals-carousel {
        gap: 1rem !important;
    }
}

/* Line clamp utilities for text truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile-specific fixes for deal cards */
@media (max-width: 640px) {

    /* Fix deal card titles on mobile */
    .deal-card-title {
        font-size: 0.875rem !important;
        line-height: 1.25rem !important;
        min-height: 2.5rem !important;
        margin-bottom: 0.75rem !important;
        word-wrap: break-word;
        hyphens: auto;
    }

    /* Ensure deal items have proper width on mobile */
    .deal-item {
        min-width: calc(50% - 8px) !important;
        max-width: calc(50% - 8px) !important;
        flex: 0 0 calc(50% - 8px) !important;
    }

    /* Improve deal card layout on mobile */
    .deal-item .bg-white {
        min-height: 320px !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Fix product info section on mobile */
    .deal-item .p-4 {
        padding: 0.75rem !important;
        flex-grow: 1 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Ensure pricing section stays at bottom */
    .deal-item .mt-auto {
        margin-top: auto !important;
    }

    /* Improve button sizing on mobile */
    .deal-item button {
        font-size: 0.75rem !important;
        padding: 0.625rem 0.75rem !important;
        min-height: 2.5rem !important;
    }

    /* Fix image aspect ratio on mobile */
    .deal-item .aspect-square {
        aspect-ratio: 1 / 1 !important;
        min-height: 140px !important;
    }

    /* Improve text readability on mobile */
    .deal-item .text-lg {
        font-size: 1rem !important;
    }

    .deal-item .text-sm {
        font-size: 0.75rem !important;
    }

    .deal-item .text-xs {
        font-size: 0.625rem !important;
    }
}

/* Tablet-specific adjustments */
@media (min-width: 641px) and (max-width: 768px) {
    .deal-item {
        min-width: calc(33.333% - 11px) !important;
        max-width: calc(33.333% - 11px) !important;
        flex: 0 0 calc(33.333% - 11px) !important;
    }

    .deal-card-title {
        font-size: 0.875rem !important;
        line-height: 1.25rem !important;
    }
}

/* Side Cart Styles */
#side-cart {
    max-width: 100vw;
}

@media (max-width: 768px) {
    #side-cart {
        width: 100vw;
        max-width: 100vw;
    }
}

/* Cart animation improvements */
#cart-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

#cart-overlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

/* Cart item hover effects */
.cart-item:hover {
    background-color: #f9fafb;
}

/* Quantity button styles */
.quantity-btn {
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    border-color: #5b21b6;
    color: #5b21b6;
}

/* Coupon input focus styles */
#coupon-input:focus {
    box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.1);
}

/* Cart count badge animation */
#cart-count,
#mobile-cart-count {
    animation: pulse 0.3s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Cart icon hover effects */
#cart-icon:hover {
    transform: translateY(-1px);
}

#mobile-cart-icon:hover {
    background-color: rgba(91, 33, 182, 0.05);
}

/* Ensure cart icon is clickable */
#cart-icon,
#mobile-cart-icon {
    cursor: pointer;
    user-select: none;
}

/* Product page button styles */
.border-3 {
    border-width: 3px;
}

/* Enhanced button hover effects */
#add-to-cart-btn {
    position: relative;
    overflow: hidden;
}

#add-to-cart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(91, 33, 182, 0.1), transparent);
    transition: left 0.5s;
}

#add-to-cart-btn:hover::before {
    left: 100%;
}

#buy-now-btn {
    position: relative;
    overflow: hidden;
}

#buy-now-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#buy-now-btn:hover::after {
    width: 300px;
    height: 300px;
}

/* Dark button specific styles */
#buy-now-btn {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

#buy-now-btn:hover {
    background: linear-gradient(135deg, #111827 0%, #000000 100%);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Button text should stay above the effects */
#add-to-cart-btn span,
#add-to-cart-btn i,
#buy-now-btn span,
#buy-now-btn i {
    position: relative;
    z-index: 1;
}

/* Side cart checkout button styling */
#checkout {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    transition: all 0.3s ease;
}

#checkout:hover {
    background: linear-gradient(135deg, #111827 0%, #000000 100%);
    transform: translateY(-1px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2) !important;
}

#checkout::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#checkout:hover::after {
    width: 300px;
    height: 300px;
}

#checkout span {
    position: relative;
    z-index: 1;
}

/* Place order button styling */
#place-order-btn {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    transition: all 0.3s ease;
}

#place-order-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #111827 0%, #000000 100%);
    transform: translateY(-1px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2) !important;
}

#place-order-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#place-order-btn:hover:not(:disabled)::after {
    width: 300px;
    height: 300px;
}

#place-order-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

#place-order-btn:disabled:hover {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

/* bdshop Ocean Blue Brand Color Overrides */
.bg-primary {
    background-color: #083862 !important;
}

.text-primary {
    color: #083862 !important;
}

.border-primary {
    border-color: #083862 !important;
}

.hover\:bg-primary:hover {
    background-color: #083862 !important;
}

.hover\:text-primary:hover {
    color: #083862 !important;
}

.focus\:ring-primary:focus {
    --tw-ring-color: #083862 !important;
}

.bg-primary-dark {
    background-color: #0f5bb8 !important;
}

.hover\:bg-primary-dark:hover {
    background-color: #0f5bb8 !important;
}

.text-primary-light {
    color: #1a7ee6 !important;
}

/* Accent color updates */
.bg-accent {
    background-color: #f59e0b !important;
}

.text-accent {
    color: #f59e0b !important;
}

.hover\:bg-accent:hover {
    background-color: #f59e0b !important;
}

.hover\:bg-accent-dark:hover {
    background-color: #d97706 !important;
}

.text-accent-light {
    color: #fbbf24 !important;
}

/* Logo styling */
.logo-container img {
    filter: brightness(1.1);
    transition: all 0.3s ease;
}

.logo-container:hover img {
    filter: brightness(1.2);
    transform: scale(1.05);
}

/* Update existing quantity button hover to use new primary color */
.quantity-btn:hover {
    border-color: #083862 !important;
    color: #083862 !important;
}

/* Update coupon input focus to use new primary color */
#coupon-input:focus {
    box-shadow: 0 0 0 3px rgba(8, 56, 98, 0.1) !important;
}

/* Update add to cart button gradient */
#add-to-cart-btn::before {
    background: linear-gradient(90deg, transparent, rgba(8, 56, 98, 0.1), transparent) !important;
}

/* Ensure all primary color classes use #083862 */
.bg-primary,
[style*="background-color: #5b21b6"],
[style*="background: linear-gradient(135deg, #5b21b6"],
[style*="background: linear-gradient(135deg, #7c3aed"] {
    background-color: #083862 !important;
    background: linear-gradient(135deg, #083862 0%, #0f5bb8 100%) !important;
}

.text-primary,
[style*="color: #5b21b6"] {
    color: #083862 !important;
}

.border-primary,
[style*="border-color: #5b21b6"] {
    border-color: #083862 !important;
}

/* Top bar background */
header .bg-primary {
    background-color: #083862 !important;
}

/* Cart button and other primary buttons */
.bg-primary,
button.bg-primary {
    background-color: #083862 !important;
}

.hover\:bg-primary-dark:hover,
button.bg-primary:hover {
    background-color: #0f5bb8 !important;
}

/* Search button */
.bg-primary.text-white {
    background-color: #083862 !important;
}

.bg-primary.text-white:hover {
    background-color: #0f5bb8 !important;
}

/* Mobile cart count badge */
#mobile-cart-count.bg-primary {
    background-color: #083862 !important;
}

/* Chart.js and other dynamic color overrides */
.chart-purple,
[data-color="purple"],
.bg-purple-600,
.bg-purple-700,
.bg-purple-800 {
    background-color: #083862 !important;
}

.text-purple-600,
.text-purple-700,
.text-purple-800 {
    color: #083862 !important;
}

.border-purple-600,
.border-purple-700,
.border-purple-800 {
    border-color: #083862 !important;
}

/* Logo hover effect */
header img[alt="BDShop Logo"]:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Footer specific color overrides */
footer .hover\:text-primary:hover,
footer .text-primary {
    color: #083862 !important;
}

footer .focus\:ring-primary:focus {
    --tw-ring-color: #083862 !important;
}

footer button[style*="background-color: #083862"]:hover {
    background-color: #0f5bb8 !important;
}

/* Ensure all accent colors in footer use primary color */
footer .hover\:text-accent:hover {
    color: #083862 !important;
}

/* Back to top button hover effect */
#back-to-top:hover {
    background-color: #0f5bb8 !important;
    transform: scale(1.1) !important;
}

/* Header topbar background */
header .bg-primary {
    background-color: #083862 !important;
}

/* Search button specific styling */
.bg-primary.text-white,
button.bg-primary {
    background-color: #083862 !important;
}

.bg-primary.text-white:hover,
button.bg-primary:hover,
.hover\:bg-primary-dark:hover {
    background-color: #0f5bb8 !important;
}

/* Cart button - no background, text and icon only */
#cart-icon {
    background-color: transparent !important;
}

#cart-icon:hover {
    background-color: transparent !important;
}

/* Footer background - darker version of primary color */
footer {
    background-color: #062742 !important;
    /* Very dark ocean blue */
}

/* Footer text contrast */
footer h3,
footer h4,
footer h5 {
    color: #ffffff !important;
}

footer p,
footer li a,
footer .text-gray-300 {
    color: #e5e7eb !important;
}

/* Footer hover effects with primary color */
footer a:hover,
footer .hover\:text-primary:hover {
    color: #e8b4b8 !important;
    /* Rose-gold color for better contrast */
}

/* Newsletter button in footer */
footer button[style*="background-color: #083862"] {
    background-color: #083862 !important;
}

footer button[style*="background-color: #083862"]:hover {
    background-color: #0f5bb8 !important;
    /* Lighter primary for contrast */
}

/* Mobile menu toggle button */
#mobile-menu-toggle:hover {
    color: #083862 !important;
}

/* Account dropdown hover */
.hover\:text-primary:hover {
    color: #083862 !important;
}

/* Mobile cart button */
#mobile-cart-icon:hover {
    color: #083862 !important;
}

/* Focus states for form elements */
input:focus,
textarea:focus,
select:focus {
    --tw-ring-color: #083862 !important;
    border-color: #083862 !important;
}

/* Newsletter button in footer */
footer .bg-primary {
    background-color: #083862 !important;
}

footer .hover\:bg-primary-light:hover {
    background-color: #1a7ee6 !important;
}

/* Ensure all primary backgrounds use our color */
.bg-primary,
.bg-primary-500 {
    background-color: #083862 !important;
}

.bg-primary:hover,
.bg-primary-600:hover,
.hover\:bg-primary-dark:hover,
.hover\:bg-primary-600:hover {
    background-color: #0f5bb8 !important;
}

.bg-primary-700 {
    background-color: #0f5bb8 !important;
}

.bg-primary-800 {
    background-color: #083862 !important;
}

.bg-primary-900 {
    background-color: #062742 !important;
}

/* Text primary colors */
.text-primary,
.text-primary-500 {
    color: #083862 !important;
}

.text-primary-600 {
    color: #1a7ee6 !important;
}

.text-primary-700 {
    color: #0f5bb8 !important;
}

/* Custom width utilities for carousels */
.w-1\/8 {
    width: 12.5%;
}

.w-1\/9 {
    width: 11.111111%;
}

.w-1\/10 {
    width: 10%;
}

@media (min-width: 768px) {
    .md\:w-1\/8 {
        width: 12.5%;
    }

    .md\:w-1\/9 {
        width: 11.111111%;
    }

    .md\:w-1\/10 {
        width: 10%;
    }
}

@media (min-width: 1024px) {
    .lg\:w-1\/8 {
        width: 12.5%;
    }

    .lg\:w-1\/9 {
        width: 11.111111%;
    }

    .lg\:w-1\/10 {
        width: 10%;
    }
}

@media (min-width: 1280px) {
    .xl\:w-1\/8 {
        width: 12.5%;
    }

    .xl\:w-1\/9 {
        width: 11.111111%;
    }

    .xl\:w-1\/10 {
        width: 10%;
    }
}

/* Search Box Styling - Less Rounded */
.search-container input[type="text"] {
    border-radius: 6px !important;
    /* Less rounded than default */
    transition: all 0.2s ease;
}

.search-container button {
    border-radius: 4px !important;
    /* Less rounded for search button */
    transition: all 0.2s ease;
}

/* Search Results Styling */
#search-results,
#mobile-search-results {
    border-radius: 6px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(10px);
}

.search-result-item {
    transition: all 0.2s ease;
    cursor: pointer;
}

.search-result-item:hover,
.search-result-item.active {
    background-color: #f8fafc;
    border-left: 3px solid #083862;
    transform: translateX(2px);
}

.search-result-item:first-child {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.search-result-item:last-child {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* Search input focus effect */
.search-container input[type="text"]:focus {
    box-shadow: 0 0 0 3px rgba(8, 56, 98, 0.1);
    border-color: #083862;
    transform: scale(1.01);
}

/* Search button hover effect */
.search-container button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(8, 56, 98, 0.2);
}

/* Search loading spinner */
.search-container .spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #083862;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

/* Search results animation */
#search-results,
#mobile-search-results {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search result item badges */
.search-result-item .badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Mobile search adjustments */
@media (max-width: 768px) {
    #mobile-search-results {
        max-height: 70vh;
    }

    .search-result-item {
        padding: 12px;
    }

    .search-result-item img {
        width: 48px;
        height: 48px;
    }
}

/* Mobile Sliding Menu Styles */
#mobile-sliding-menu {
    max-width: 90vw;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

#mobile-menu-overlay {
    backdrop-filter: blur(2px);
}

#mobile-menu-overlay.opacity-50 {
    opacity: 0.5;
}

/* Mobile menu animations */
#mobile-sliding-menu.translate-x-0 {
    transform: translateX(0);
}

#mobile-sliding-menu.-translate-x-full {
    transform: translateX(-100%);
}

/* Mobile menu item hover effects */
.mobile-menu-item {
    position: relative;
    overflow: hidden;
}

.mobile-menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(8, 56, 98, 0.05), transparent);
    transition: left 0.5s ease;
}

.mobile-menu-item:hover::before {
    left: 100%;
}

/* Mobile menu scrollbar */
#mobile-sliding-menu .overflow-y-auto::-webkit-scrollbar {
    width: 4px;
}

#mobile-sliding-menu .overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#mobile-sliding-menu .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #083862;
    border-radius: 2px;
}

#mobile-sliding-menu .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #0f5bb8;
}

/* Mobile menu header gradient */
#mobile-sliding-menu .bg-primary {
    background: linear-gradient(135deg, #083862 0%, #0f5bb8 100%);
}

/* Mobile menu close button animation */
#close-mobile-menu {
    transition: transform 0.2s ease;
}

#close-mobile-menu:hover {
    transform: rotate(90deg) scale(1.1);
}

/* Mobile menu section headers */
#mobile-sliding-menu h3 {
    letter-spacing: 0.05em;
}

/* Mobile menu icons */
#mobile-sliding-menu .w-5 {
    width: 1.25rem;
    flex-shrink: 0;
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Mobile menu backdrop blur effect */
@supports (backdrop-filter: blur(4px)) {
    #mobile-menu-overlay {
        backdrop-filter: blur(4px);
        background-color: rgba(0, 0, 0, 0.3);
    }
}

/* Mobile menu item active state */
.mobile-menu-item.active {
    background-color: #f0f7ff;
    color: #083862;
    border-left: 3px solid #083862;
}

.mobile-menu-item.active i {
    color: #083862;
}

/* Mobile Menu Tab Styles */
#mobile-sliding-menu .flex.border-b button {
    transition: all 0.2s ease;
    position: relative;
}

#mobile-sliding-menu .flex.border-b button:hover {
    background-color: #f9fafb;
}

#mobile-sliding-menu .flex.border-b button.border-primary {
    background-color: white;
    color: #083862;
    border-bottom-color: #083862;
}

#mobile-sliding-menu .flex.border-b button.border-transparent {
    color: #6b7280;
    border-bottom-color: transparent;
}

/* Category Submenu Styles */
.category-submenu {
    transition: all 0.2s ease;
    border-left: 2px solid #e5e7eb;
    margin-left: 1rem;
    padding-left: 0.5rem;
}

.category-submenu a {
    position: relative;
    transition: all 0.15s ease;
}

.category-submenu a:hover {
    padding-left: 1rem;
}

.category-submenu a::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background-color: #083862;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.category-submenu a:hover::before {
    opacity: 1;
}

/* Category toggle chevron animation */
.category-toggle .fa-chevron-right {
    transition: transform 0.2s ease;
}

/* Tab content animation */
#categories-content,
#navigation-content {
    transition: opacity 0.2s ease;
}

/* Enhanced mobile menu styling */
#mobile-sliding-menu {
    backdrop-filter: blur(10px);
}

/* Tab indicator animation */
#mobile-sliding-menu .flex.border-b button::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #083862;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

#mobile-sliding-menu .flex.border-b button.border-primary::after {
    transform: scaleX(1);
}

/* Category icons with different colors */
.category-toggle i.text-blue-500 {
    color: #3b82f6 !important;
}

.category-toggle i.text-purple-500 {
    color: #8b5cf6 !important;
}

.category-toggle i.text-green-500 {
    color: #10b981 !important;
}

.category-toggle i.text-indigo-500 {
    color: #6366f1 !important;
}

.category-toggle i.text-pink-500 {
    color: #ec4899 !important;
}

/* Submenu slide animation */
.category-submenu.slide-in {
    animation: slideInSubmenu 0.2s ease-out;
}

@keyframes slideInSubmenu {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Header Compact Styles */
@media (max-width: 1023px) {

    /* Reduce header padding */
    header .container {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    /* Compact mobile header */
    .mobile-header-compact {
        min-height: auto;
    }

    /* Reduce search bar padding */
    #mobile-search-input {
        padding-top: 0.625rem;
        padding-bottom: 0.625rem;
    }

    /* Compact button sizes */
    .mobile-compact-btn {
        width: 2.25rem;
        height: 2.25rem;
    }

    /* Smaller logo on mobile */
    .mobile-logo {
        height: 2.25rem;
    }

    /* Reduce border thickness */
    .mobile-search-border {
        border-top-width: 1px;
    }
}

/* Hero section mobile adjustments */
@media (max-width: 1023px) {
    .hero-mobile-full {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .slider-container {
        height: 300px;
    }
}

/* Mobile section spacing optimizations */
@media (max-width: 767px) {

    /* Reduce section gaps on mobile */
    section {
        margin-bottom: 0;
    }

    /* Compact spacing for mobile sections */
    .mobile-section-compact {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    /* Reduce margins between sections */
    section+section {
        margin-top: -0.5rem;
    }

    /* Optimize container spacing */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Reduce header spacing in sections */
    .text-center.mb-8 {
        margin-bottom: 1.5rem;
    }

    .text-center.mb-6 {
        margin-bottom: 1rem;
    }
}

/* Category Carousel Mobile Optimizations */
@media (max-width: 767px) {

    /* Enable smooth scrolling for mobile */
    .category-carousel-container {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE and Edge */
        /* Fix layout shift: Set fixed height to prevent CLS */
        /* Image container: 128px (h-32) + Text section: ~72px (p-4 + text) = ~200px total */
        min-height: 200px;
        height: 200px;
    }

    /* Hide scrollbar for webkit browsers */
    .category-carousel-container::-webkit-scrollbar {
        display: none;
    }

    /* Add padding for better mobile experience */
    #category-carousel {
        padding-left: 1rem;
        padding-right: 1rem;
        /* Ensure consistent height */
        height: 100%;
        display: flex;
        align-items: flex-start;
    }

    /* Optimize category item sizes for mobile */
    .category-item {
        min-width: 120px;
        flex-shrink: 0;
        /* Remove pb-2 padding that causes inconsistency */
        padding-bottom: 0 !important;
        /* Ensure consistent height to prevent layout shift */
        height: 200px;
        display: flex;
        flex-direction: column;
    }

    /* Ensure category item links fill the height */
    .category-item>a {
        height: 100%;
        display: flex;
        flex-direction: column;
        /* Prevent transform hover from causing shift */
        will-change: transform;
    }

    /* Fix image container height to prevent shift - matches h-32 (128px) */
    .category-item .relative {
        min-height: 128px !important;
        height: 128px !important;
        max-height: 128px !important;
        flex-shrink: 0;
    }

    /* Ensure text section has consistent height */
    .category-item .p-4 {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 72px;
    }

    /* Add snap scrolling for better mobile experience */
    .category-carousel-container {
        scroll-snap-type: x mandatory;
    }

    .category-item {
        scroll-snap-align: start;
    }
}

/* Category carousel touch improvements */
.category-carousel-container {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.category-item {
    cursor: grab;
}

.category-item:active {
    cursor: grabbing;
}

/* Smooth transitions for category items */
.category-item a {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-item a:active {
    transform: scale(0.98);
}

/* Header Primary Menu Styles */
.main-desktop-nav-wrapper ul li a {
    color: white !important;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem 1.25rem;
    display: inline-block;
    transition: all 0.2s;
    text-decoration: none;
    line-height: normal !important;
}

.main-desktop-nav-wrapper ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #f3f4f6 !important;
}

.main-desktop-nav-wrapper ul li {
    display: flex;
    align-items: center;
}