/* ============================================
   DARK MODE / LIGHT MODE - COMPLETE STYLES
   ============================================ */

/* DARK MODE - OVERRIDE EVERYTHING */
html[data-theme="dark"] body,
html[data-theme="dark"] body *:not(input):not(textarea):not(select):not(button):not(.btn):not(img):not(.dark-mode-toggle):not(.dark-mode-toggle-nav):not(#darkModeToggleMobile) {
    color: #e0e0e0 !important;
}

/* DARK MODE - Background Colors */
html[data-theme="dark"] body {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
}

html[data-theme="dark"] .aiz-main-wrapper,
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .card,
html[data-theme="dark"] .card-body,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .modal-body,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] footer {
    background-color: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}

html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-gray {
    background-color: #333 !important;
    color: #e0e0e0 !important;
}

html[data-theme="dark"] .top-navbar,
html[data-theme="dark"] .navbar,
html[data-theme="dark"] .aiz-topbar {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}

/* DARK MODE - All Text Elements */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] p,
html[data-theme="dark"] span,
html[data-theme="dark"] label,
html[data-theme="dark"] div,
html[data-theme="dark"] td,
html[data-theme="dark"] th,
html[data-theme="dark"] li,
html[data-theme="dark"] a,
html[data-theme="dark"] strong,
html[data-theme="dark"] em,
html[data-theme="dark"] small,
html[data-theme="dark"] .fw-600,
html[data-theme="dark"] .fw-700,
html[data-theme="dark"] .fs-14,
html[data-theme="dark"] .fs-15,
html[data-theme="dark"] .fs-16,
html[data-theme="dark"] .opacity-60,
html[data-theme="dark"] .opacity-80,
html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .card-text {
    color: #e0e0e0 !important;
}

/* DARK MODE - Navigation */
html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .nav-item,
html[data-theme="dark"] .navbar-nav,
html[data-theme="dark"] .breadcrumb-item,
html[data-theme="dark"] .breadcrumb-item a {
    color: #e0e0e0 !important;
}

html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] a:hover {
    color: #ff6b35 !important;
}

/* DARK MODE - Tables */
html[data-theme="dark"] .table,
html[data-theme="dark"] .table td,
html[data-theme="dark"] .table th,
html[data-theme="dark"] .table thead {
    color: #e0e0e0 !important;
    background-color: #2a2a2a !important;
    border-color: #444 !important;
}

html[data-theme="dark"] .table thead th {
    background-color: #333 !important;
    color: #e0e0e0 !important;
}

/* DARK MODE - Forms */
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .form-control {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #666 !important;
}

/* DARK MODE - Form Labels */
html[data-theme="dark"] .form-group label,
html[data-theme="dark"] .form-label,
html[data-theme="dark"] label {
    color: #e0e0e0 !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #666 !important;
}

/* DARK MODE - Buttons */
html[data-theme="dark"] .btn {
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-primary {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-secondary {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-success {
    background-color: #198754 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-danger {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-warning {
    background-color: #ffc107 !important;
    color: #000000 !important;
}

html[data-theme="dark"] .btn-info {
    background-color: #0dcaf0 !important;
    color: #000000 !important;
}

/* DARK MODE - Links */
html[data-theme="dark"] a,
html[data-theme="dark"] .link {
    color: #6db3f2 !important;
}

html[data-theme="dark"] a:hover,
html[data-theme="dark"] .link:hover {
    color: #ff6b35 !important;
}

/* DARK MODE - Badges & Labels */
html[data-theme="dark"] .badge,
html[data-theme="dark"] .badge-primary,
html[data-theme="dark"] .badge-success,
html[data-theme="dark"] .badge-danger {
    color: #ffffff !important;
}

/* DARK MODE - Product Page */
html[data-theme="dark"] .product-gallery,
html[data-theme="dark"] .product-gallery-thumb,
html[data-theme="dark"] .product-details,
html[data-theme="dark"] .product-info {
    color: #e0e0e0 !important;
}

/* DARK MODE - Price */
html[data-theme="dark"] .price,
html[data-theme="dark"] .product-price,
html[data-theme="dark"] .fw-600 {
    color: #ff6b35 !important;
}

/* DARK MODE - Search Box */
html[data-theme="dark"] .typed-search-box,
html[data-theme="dark"] .search-preloader {
    background-color: #2a2a2a !important;
    color: #e0e0e0 !important;
}

/* DARK MODE - Payment Options */
html[data-theme="dark"] .aiz-megabox-elem {
    background-color: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}

/* DARK MODE - Attribute Select Boxes (aiz-megabox) */
html[data-theme="dark"] .aiz-megabox {
    border-color: #555 !important;
}

html[data-theme="dark"] .aiz-megabox input[type="radio"],
html[data-theme="dark"] .aiz-megabox input[type="checkbox"] {
    accent-color: #0d6efd !important;
}

/* Unchecked aiz-megabox-elem border visible in dark mode */
html[data-theme="dark"] .aiz-megabox-elem {
    border-color: #555 !important;
}

/* Checked state - blue border with glow to make it clearly visible in dark mode */
html[data-theme="dark"] .aiz-megabox > input[type="radio"]:checked ~ .aiz-megabox-elem,
html[data-theme="dark"] .aiz-megabox > input[type="checkbox"]:checked ~ .aiz-megabox-elem {
    background-color: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 2px #0d6efd40 !important;
}

/* DARK MODE - Select Dropdown Borders */
html[data-theme="dark"] select.form-control,
html[data-theme="dark"] .form-select {
    border-color: #555 !important;
}

/* DARK MODE - Customer Account Section */
html[data-theme="dark"] .aiz-user-sidenav-wrap,
html[data-theme="dark"] .aiz-user-panel,
html[data-theme="dark"] .aiz-user-panel .card,
html[data-theme="dark"] .aiz-user-panel .card-header,
html[data-theme="dark"] .aiz-user-panel .card-body,
html[data-theme="dark"] .aiz-side-nav-link,
html[data-theme="dark"] .aiz-side-nav-text,
html[data-theme="dark"] .aiz-titlebar h1,
html[data-theme="dark"] .aiz-titlebar h2,
html[data-theme="dark"] .aiz-titlebar h3,
html[data-theme="dark"] .col-form-label,
html[data-theme="dark"] .widget-balance,
html[data-theme="dark"] .heading-4,
html[data-theme="dark"] .table td,
html[data-theme="dark"] .table th {
    color: #e0e0e0 !important;
}

html[data-theme="dark"] .aiz-user-sidenav-wrap {
    background-color: #2a2a2a !important;
}

html[data-theme="dark"] .aiz-user-panel .card {
    background-color: #2a2a2a !important;
    border-color: #444 !important;
}

html[data-theme="dark"] .aiz-user-panel .card-header {
    background-color: #333 !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}

html[data-theme="dark"] .aiz-side-nav-link:hover {
    color: #ff6b35 !important;
    background-color: #333 !important;
}

html[data-theme="dark"] .aiz-side-nav-link.active {
    color: #ff6b35 !important;
    background-color: #333 !important;
}

html[data-theme="dark"] .widget-balance {
    background-color: #333 !important;
    border-color: #444 !important;
}

html[data-theme="dark"] .heading-4 {
    color: #e0e0e0 !important;
}

html[data-theme="dark"] .btn-primary {
    color: #ffffff !important;
}

/* LIGHT MODE - Customer Account Section */
html[data-theme="light"] .aiz-user-sidenav-wrap,
html[data-theme="light"] .aiz-user-panel,
html[data-theme="light"] .aiz-user-panel .card,
html[data-theme="light"] .aiz-user-panel .card-header,
html[data-theme="light"] .aiz-user-panel .card-body,
html[data-theme="light"] .aiz-side-nav-link,
html[data-theme="light"] .aiz-side-nav-text,
html[data-theme="light"] .aiz-titlebar h1,
html[data-theme="light"] .aiz-titlebar h2,
html[data-theme="light"] .aiz-titlebar h3,
html[data-theme="light"] .col-form-label,
html[data-theme="light"] .widget-balance,
html[data-theme="light"] .heading-4,
html[data-theme="light"] .table td,
html[data-theme="light"] .table th {
    color: #000000 !important;
}

html[data-theme="light"] .aiz-side-nav-link:hover {
    color: #ff6b35 !important;
    background-color: #f0f0f0 !important;
}

html[data-theme="light"] .aiz-side-nav-link.active {
    color: #ff6b35 !important;
    background-color: #f0f0f0 !important;
}

/* DARK MODE - Footer */
html[data-theme="dark"] footer,
html[data-theme="dark"] footer * {
    color: #e0e0e0 !important;
}

html[data-theme="dark"] footer a {
    color: #6db3f2 !important;
}

/* LIGHT MODE - Override Bootstrap dark classes */
html[data-theme="light"] .bg-dark {
    background-color: #212529 !important;
}

html[data-theme="light"] .text-white {
    color: #ffffff !important;
}

/* FORM INPUTS - ALWAYS BLACK TEXT */
#new-address-modal input,
#new-address-modal textarea,
#new-address-modal select,
.modal input,
.modal textarea,
.modal select,
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
textarea,
select {
    color: #000000 !important;
    background-color: #ffffff !important;
}

/* ============================================
   DARK MODE TOGGLE BUTTON STYLES
   ============================================ */

/* Fixed Bottom Right Button */
.dark-mode-toggle {
    position: fixed;
    bottom: 80px;
    right: 15px;
    z-index: 9999;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Light Mode Button - Dark background with golden moon */
html[data-theme="light"] .dark-mode-toggle {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffd700 !important;
}

/* Dark Mode Button - Golden background with dark sun */
html[data-theme="dark"] .dark-mode-toggle {
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    color: #1a1a2e !important;
}

/* Nav Toggle Buttons */
.dark-mode-toggle-nav,
#darkModeToggleMobile {
    font-size: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Nav Toggle - Light Mode (Dark icon on white navbar) */
html[data-theme="light"] .dark-mode-toggle-nav,
html[data-theme="light"] #darkModeToggleMobile {
    color: #1a1a2e !important;
    background: none !important;
}

/* Nav Toggle - Dark Mode (Light icon on dark navbar) */
html[data-theme="dark"] .dark-mode-toggle-nav,
html[data-theme="dark"] #darkModeToggleMobile {
    color: #ffd700 !important;
    background: none !important;
}

/* ============================================
   QUANTITY CONTROLS - LIGHT/DARK MODE
   ============================================ */

/* Light mode - dark text */
.qty-label,
.qty-btn,
.qty-input {
    color: #333 !important;
}

.qty-btn {
    background-color: #f0f0f0 !important;
    border-color: #ddd !important;
}

.qty-input {
    background-color: #fff !important;
}

/* Dark mode - light text */
html[data-theme="dark"] .qty-label,
html[data-theme="dark"] .qty-btn,
html[data-theme="dark"] .qty-input {
    color: #e0e0e0 !important;
}

html[data-theme="dark"] .qty-btn {
    background-color: #444 !important;
    border-color: #555 !important;
}

html[data-theme="dark"] .qty-input {
    background-color: #333 !important;
}

/* ============================================
   MOBILE - PRODUCT BUTTONS SAME SIZE
   ============================================ */

@media (max-width: 767px) {
    .col-xl-7 .mt-3 {
        display: flex !important;
        gap: 10px !important;
    }

    .col-xl-7 .add-to-cart,
    .col-xl-7 .buy-now,
    .col-xl-7 .mt-3 .btn:not(.out-of-stock) {
        flex: 1 !important;
        height: 46px !important;
        font-size: 14px !important;
        padding: 10px 8px !important;
        line-height: 1.2 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

/* ============================================
   PRODUCT PAGE - SQUARE IMAGES
   ============================================ */

/* Product Gallery Main Image - Square */
.product-gallery .carousel-box {
    width: 100% !important;
    padding-bottom: 100% !important;
    position: relative !important;
    overflow: hidden !important;
}

.product-gallery .carousel-box img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Product Gallery Thumbnails - Square */
.product-gallery-thumb .carousel-box {
    width: 70px !important;
    height: 70px !important;
    padding-bottom: 0 !important;
    position: relative !important;
    overflow: hidden !important;
}

.product-gallery-thumb .carousel-box img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Product Card Images on Homepage - Square */
.product-card .img-zoom,
.product-box .img-zoom,
.product-thumb .img-zoom {
    width: 100% !important;
    padding-bottom: 100% !important;
    position: relative !important;
    overflow: hidden !important;
}

.product-card .img-zoom img,
.product-box .img-zoom img,
.product-thumb .img-zoom img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* ============================================
   MOBILE PRODUCT IMAGE FIX
   ============================================ */

@media (max-width: 768px) {
    .product-gallery .carousel-box {
        max-height: 350px;
        overflow: hidden;
    }

    .product-gallery .carousel-box img {
        max-height: 350px;
        width: 100%;
        object-fit: contain;
    }

    .product-gallery-thumb .carousel-box {
        max-width: 60px;
        max-height: 60px;
    }

    .product-gallery-thumb .carousel-box img {
        max-width: 60px;
        max-height: 60px;
        object-fit: cover;
    }

    .product-card img,
    .product-box img,
    .product-thumb img {
        max-height: 200px;
        width: 100%;
        object-fit: contain;
    }

    .img-zoom {
        max-height: 350px;
        overflow: hidden;
    }

    .aiz-carousel .carousel-box {
        max-height: 350px;
    }
}

@media (max-width: 480px) {
    .product-gallery .carousel-box img,
    .product-gallery .carousel-box,
    .img-zoom,
    .aiz-carousel .carousel-box {
        max-height: 280px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .product-gallery .carousel-box img,
    .product-gallery .carousel-box {
        max-height: 450px;
    }
}

/* Feature Category Section - 50/50 responsive layout */
.feature-category-section {
    margin-top: 1.5rem;
}

/* Feature Category - Full image without cropping */
.feature-category-section .feature-category-card img {
    width: 100% !important;
    height: auto !important;
    max-height: 200px !important;
    object-fit: contain !important;
    object-position: center top !important;
    background: #f8f9fa;
}

/* Ensure overlay covers the full area */
.feature-category-section .category-overlay {
    width: 100% !important;
    height: 100% !important;
}

/* Mobile - smaller height for category images */
@media (max-width: 575.98px) {
    .feature-category-section .feature-category-card img {
        max-height: 150px !important;
    }
}

/* Scroll Line / News Ticker */
.scroll-line-bar {
    padding: 8px 0;
    font-size: 14px;
    overflow: hidden;
}
.scroll-line-bar .scroll-line-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.scroll-line-bar .scroll-line-content marquee {
    font-size: 14px;
    line-height: 1.4;
}
.scroll-line-bar a {
    color: inherit;
    text-decoration: underline;
}
.scroll-line-bar a:hover {
    text-decoration: none;
}

/* WhatsApp icon */
.social .whatsapp i:before {
    content: "\f232";
}

.feature-category-section .row {
    margin-left: 0;
    margin-right: 0;
}

.feature-category-card {
    display: block;
    transition: transform 0.2s ease;
}

.feature-category-card:hover {
    transform: translateY(-3px);
}

/* Feature Category Section - 50/50 responsive layout on ALL screens */
.feature-category-section {
    margin-top: 1.5rem;
}

.feature-category-section .row {
    margin-left: 0;
    margin-right: 0;
}

.feature-category-card {
    display: block;
    transition: transform 0.2s ease;
}

.feature-category-card:hover {
    transform: translateY(-3px);
}

/* 50/50 layout on all screens (col-6 = 50% width) */
.feature-category-section .col-6 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Object-fit for consistent image display */
.object-fit-cover {
    object-fit: cover;
}

.object-fit-contain {
    object-fit: contain;
}

/* Category overlay */
.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure overlay is inside the container */
.feature-category-card .position-relative {
    position: relative;
}

.feature-category-card .category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Text styling for overlay */
.feature-category-section h3 {
    color: white;
    font-weight: bold;
    margin: 0;
    text-align: center;
    padding: 0 15px;
    font-size: 1.125rem; /* fs-4 equivalent */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 575.98px) {
    .feature-category-section .col-6 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .feature-category-section h3 {
        font-size: 1rem !important;
    }

    .feature-category-section .position-relative {
        height: 150px !important;
    }
}
