:root {
    --primary-color: #0d6efd;
    /* Bootstrap primary, but deeper */
    --secondary-color: #0a58ca;
    /* Electronics Red Accent */
    --tech-red: #ff3333;
    --accent-color: #ffc107;

    --dark-bg: #11111f;
    /* Slightly darker/more blue-black */
    --light-bg: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #6c757d;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --hover-transform: translateY(-5px);
    --neon-glow: 0 0 15px rgba(13, 110, 253, 0.3);
    --red-glow: 0 0 10px rgba(255, 51, 51, 0.4);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    /* Tech Background Image with Overlay */
    background-image:
        linear-gradient(rgba(240, 242, 245, 0.85), rgba(240, 242, 245, 0.85)),
        url('../img/tech-bg.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background-color: #fff !important;
    border-bottom: 2px solid var(--primary-color);
}

.navbar-brand img {
    height: 120px;
    object-fit: contain;
}

.nav-link {
    font-weight: 600;
    color: #444 !important;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
    border-bottom-color: var(--tech-red);
}

/* Cart Icon */
.cart-icon-container {
    position: relative;
    cursor: pointer;
    margin-left: 20px;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: var(--tech-red);
    /* Updated to Red */
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 0 5px var(--tech-red);
}

/* Hero Section */
.hero-section {
    position: relative;
    background-size: cover;
    background-position: center;
    color: white;
    padding: 120px 0;
    margin-bottom: 2rem;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
    /* Angled bottom */
    overflow: hidden;
    /* Ensure video doesn't overflow */
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* Overlay for hero */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Darker tech gradient - Reduced opacity for video visibility */
    background: linear-gradient(135deg, rgba(10, 25, 47, 0.85), rgba(13, 110, 253, 0.5));
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    font-size: 4rem;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(13, 110, 253, 0.8);
}

.hero-section .btn-primary {
    background-color: var(--tech-red);
    border-color: var(--tech-red);
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.5);
}

.hero-section .btn-primary:hover {
    background-color: #cc0000;
    border-color: #cc0000;
    transform: translateY(-2px);
}

/* Feature Cards (Why Choose Us) - Updated for tech look */
.feature {
    padding: 2rem;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Subtle border */
    border-bottom: 4px solid var(--primary-color);
    /* Color accent */
    border-radius: 4px;
    /* Less rounded */
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: var(--neon-glow);
    border-bottom-color: var(--tech-red);
}

.feature i {
    color: var(--primary-color);
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 5px rgba(13, 110, 253, 0.3));
}

/* Product Cards */
.card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    /* Slightly squarer */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
    background: white;
}

.card:hover {
    transform: var(--hover-transform);
    box-shadow: var(--neon-glow);
    border-color: var(--primary-color);
}

.card-img-top {
    height: 220px;
    object-fit: contain;
    padding: 1.5rem;
    background-color: #fff;
    border-bottom: 1px solid #eee;
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-weight: 700;
    /* Bolder */
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    /* Reduced from 1.2rem */
    line-height: 1.3;
    min-height: 2.6em;
    /* Space for 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* Limit to 3 lines */
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-grow: 1;
}

.price-tag {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--tech-red);
    /* Red Price */
    margin: 1rem 0;
    font-family: 'Rajdhani', sans-serif;
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    /* Tech button */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.5);
}

/* Footer */
footer {
    background-color: #0b0b14 !important;
    /* Extremely dark */
    color: #e0e0e0;
    border-top: 3px solid var(--tech-red);
}

footer h5 {
    color: white;
    letter-spacing: 1px;
}

footer a:hover {
    color: var(--tech-red) !important;
    padding-left: 5px;
    /* Slide effect */
    transition: all 0.2s;
}

/* Cart Modal/Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    height: 100vh;
    background: white;
    z-index: 2050;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border-left: 4px solid var(--primary-color);
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    background: #fff;
    /* White header for cleanliness */
    color: #333;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.cart-header h5 {
    font-weight: 700;
    color: var(--primary-color);
}

.btn-close {
    filter: none;
    /* Reset if previously white */
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #f8f9fa;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    background: #fff;
}

.cart-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    background: white;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-title {
    font-size: 0.85rem;
    /* Reduced from 0.95rem */
    font-weight: 700;
    margin-bottom: 2px;
}

.cart-item-price {
    font-size: 0.8rem;
    /* Reduced from 0.9rem */
    font-weight: 700;
    color: var(--tech-red);
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;

    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    z-index: 2000;
    display: none;
}

.cart-overlay.show {
    display: block;
}

/* ============================
   Checkout Modal Styling
   ============================ */

/* Custom Small Width for Checkout */
.modal-checkout {
    max-width: 420px;
    /* Smaller, professional width */
    margin: 1.75rem auto;
}

.modal-content.type-modal {
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
}

.type-modal .modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    /* Deep tech gradient */
    border-bottom: 2px solid var(--tech-red) !important;
    padding: 1.2rem 1.5rem;
}

.type-modal .modal-title {
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.type-modal .modal-body {
    padding: 1.5rem;
    background-color: #f8f9fa;
    min-height: 550px;
    /* Prevent resizing on toggle */
    display: flex;
    flex-direction: column;
}

.type-modal .form-label {
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #666;
    margin-bottom: 0.3rem;
}

.type-modal .form-control,
.type-modal .form-select {
    border-radius: 6px;
    border: 1px solid #dee2e6;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    background-color: white;
    box-shadow: none;
    transition: all 0.2s;
}

.type-modal .form-control:focus,
.type-modal .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* Payment Options */
.payment-option {
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    background: white;
}

.payment-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border-color: #adb5bd;
}

.btn-check:checked+.payment-option {
    background-color: #e7f1ff;
    /* Slightly darker blue background */
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
    /* Thicker border */
    color: var(--primary-color);
    font-weight: 800;
    /* Extra Bold */
    transform: scale(1.02);
    /* Slight pop */
}

.btn-check:checked+.payment-option[for="payOnline"] {
    color: #052c65;
    /* Dark blue contrast */
}

.btn-check:checked+.payment-option[for="payWhatsapp"] {
    background-color: #f0fff4;
    border-color: #198754;
    box-shadow: 0 0 0 1px #198754;
    color: #145535;
    /* Contrast Text */
}

/* Smart Support Widget */
.chat-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    font-family: 'Poppins', sans-serif;
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--tech-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 4px 15px rgba(255, 51, 51, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    position: relative;
    z-index: 1002;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid #eee;
    z-index: 1001;
}

.chat-window.open {
    transform: scale(1);
    opacity: 1;
}

.chat-header {
    background: #1a1a1a;
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 2px solid var(--tech-red);
}

.chat-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
    background: white;
}

.chat-body {
    padding: 20px;
    background: #f8f9fa;
    height: 250px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.chat-message {
    background: white;
    padding: 15px;
    border-radius: 10px 10px 10px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: auto;
    font-size: 0.9rem;
    color: #444;
    line-height: 1.5;
}

.chat-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.chat-option-btn {
    padding: 12px;
    border-radius: 8px;
    background: white;
    border: 1px solid #ddd;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.chat-option-btn:hover {
    background: #fff;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.chat-option-btn.whatsapp {
    border-left: 4px solid #25d366;
    color: #128C7E;
}

.chat-option-btn.ai {
    border-left: 4px solid var(--tech-red);
    color: var(--primary-color);
}

/* Mobile Responsive Chat */
@media (max-width: 576px) {
    .chat-window {
        width: 90%;
        right: 5%;
        bottom: 80px;
        height: auto;
        max-height: 50vh;
    }

    .chat-body {
        height: 35vh;
    }
}

/* Carousel Styles */
.carousel-item {
    height: 400px;
}


.carousel-item img {
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6);
    /* Darkens image for better text readability */
}

/* Product Placeholder */
.product-placeholder {
    height: 220px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #eee;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.product-placeholder img {
    max-height: 100px;
    opacity: 0.5;
    filter: grayscale(100%);
    transition: all 0.3s;
}

.card:hover .product-placeholder img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

/* Scroll Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, visibility;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}

/* Original Carousel Caption Style - preserved */
.carousel-caption {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 20px;
    bottom: 20%;
}

.carousel-caption h2 {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 400px;
    background: white;
    overflow-y: auto;
    z-index: 1060;
    /* Higher than navbar */
    display: none;
    border: 1px solid #ddd;
    border-top: none;
}

.search-results-dropdown.show {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-right: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
}

.search-result-info {
    flex-grow: 1;
}

.search-result-title {
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
    color: #333;
}

.search-result-price {
    font-size: 0.85rem;
    color: var(--tech-red);
    font-weight: 700;
}

#searchClear:hover {
    color: var(--tech-red) !important;
}

.text-tech-red {
    color: var(--tech-red) !important;
}

/* Fix Modal Layering above Cart (2050) */
.modal {
    z-index: 3000 !important;
}

.modal-backdrop {
    z-index: 2900 !important;
}

/* Fix Toast Visibility above Sidebar (2050) and Modal (3000) */
.toast-container {
    z-index: 3100 !important;
}