/* General Styles */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --navbar-bg: #FFFFFF;
    --dark-color: #2d3748;
    --light-color: #f7fafc;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark-color);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Top Bar */
.top-bar {
    font-size: 0.9rem;
}

.top-bar a:hover {
    opacity: 0.8;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--navbar-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar {
    background: transparent !important;
    padding: 1rem 0;
}

.navbar-brand {
    display: inline-block;
    line-height: 0;
    padding: 0;
    vertical-align: middle;
    overflow: hidden;
    max-height: 100px;
}

.navbar-brand .navbar-logo {
    height: 100px !important;
    width: 100px !important;
    min-height: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
    max-height: 100px !important;
    object-fit: contain !important;
    display: block !important;
    vertical-align: middle !important;
    transition: transform 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
}

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

.navbar-brand h3 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.navbar-light .navbar-nav .nav-link {
    color: #231F20 !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
}

.navbar-light .navbar-nav .nav-link:hover {
    color: #231F20 !important;
    background: rgba(35, 31, 32, 0.1);
    border-radius: 5px;
}

.navbar-light .navbar-toggler {
    border-color: rgba(35, 31, 32, 0.3);
}

.navbar-light .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(35, 31, 32, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-icons a {
    font-size: 1.2rem;
    position: relative;
    color: #231F20 !important;
}

.navbar-icons a:hover {
    color: #444444 !important;
}

.navbar-icons .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.5rem;
    background-color: #ff6b6b;
}

/* Hero Section */
.hero-section {
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Video Background */
.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.video-background iframe {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
}

.hero-overlay {
    z-index: 1;
}

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

/* Category Cards */
.category-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2) !important;
}

.category-card img {
    height: 200px;
    object-fit: cover;
}

/* Product Cards */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2) !important;
}

.product-card img {
    height: 250px;
    object-fit: cover;
}

.product-card .card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card .card-title {
    min-height: 48px;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card .d-flex.gap-2 {
    margin-top: auto;
}

.product-card .btn {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
}

/* Brand Cards */
.brand-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e2e8f0;
}

.brand-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
}

/* Features Section */
.feature-box {
    padding: 20px;
}

.feature-box i {
    transition: transform 0.3s ease;
}

.feature-box:hover i {
    transform: scale(1.1);
}

/* Footer */
.footer a {
    transition: opacity 0.3s ease;
}

.footer a:hover {
    opacity: 0.8;
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.bottom-nav a {
    display: block;
    padding: 5px;
    transition: color 0.3s ease;
}

.bottom-nav a:hover {
    color: var(--primary-color) !important;
}

/* Cart Page */
.cart-table img {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.quantity-input {
    width: 80px;
}

/* Product Detail Page */
.product-detail-image {
    max-height: 500px;
    object-fit: contain;
}

.product-images-thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.product-images-thumbnails img:hover,
.product-images-thumbnails img.active {
    border-color: var(--primary-color);
}

/* Wishlist */
.wishlist-item {
    position: relative;
}

.wishlist-item .remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
}

.btn-primary:hover {
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 991px) {
    .bottom-nav {
        display: block !important;
    }
    
    body {
        padding-bottom: 80px;
    }
}

@media (min-width: 992px) {
    .bottom-nav {
        display: none !important;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
}

/* Search Modal */
#searchModal .modal-content {
    border-radius: 10px;
}

/* Filter Sidebar */
.filter-sidebar {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.filter-sidebar .form-check {
    margin-bottom: 10px;
}

/* Price Range */
.price-display {
    font-weight: bold;
    color: var(--primary-color);
}

/* Star Rating */
.star-rating {
    color: #ffc107;
}

/* Badge */
.badge-sale {
    background: #e53e3e;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
}

/* Order Status */
.status-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-processing {
    background: #dbeafe;
    color: #1e40af;
}

.status-shipped {
    background: #e0e7ff;
    color: #3730a3;
}

.status-delivered {
    background: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* RTL Support for Arabic */
html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] body {
    text-align: right;
}

html[dir="rtl"] .navbar-nav {
    margin-right: auto !important;
    margin-left: 0 !important;
}

html[dir="rtl"] .navbar-icons {
    margin-right: 0 !important;
    margin-left: 1rem !important;
}

html[dir="rtl"] .me-3 {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}

html[dir="rtl"] .ms-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

html[dir="rtl"] .ms-3 {
    margin-right: 1rem !important;
    margin-left: 0 !important;
}

html[dir="rtl"] .text-end {
    text-align: left !important;
}

html[dir="rtl"] .float-end {
    float: left !important;
}

html[dir="rtl"] .badge {
    left: auto;
    right: -5px;
}

/* Language Switcher */
.language-selector a {
    transition: all 0.3s ease;
}

.language-selector a:hover {
    opacity: 0.8;
}

.language-selector a.fw-bold {
    text-decoration: underline;
}

/* ============================================
   WhatsApp Floating Button
   ============================================ */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-float:hover {
    background-color: #128c7e;
    color: #FFF;
    transform: scale(1.1);
    box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.4);
}

.whatsapp-icon {
    margin-top: 3px;
    animation: pulse 2s infinite;
}

/* RTL positioning for WhatsApp button */
[dir="rtl"] .whatsapp-float {
    right: auto;
    left: 30px;
}

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

/* Mobile responsive */
@media screen and (max-width: 768px) {
    /* Navbar Logo - Smaller on mobile */
    .navbar-brand {
        max-height: 70px;
    }
    
    .navbar-brand .navbar-logo {
        height: 70px !important;
        width: 70px !important;
        min-height: 70px !important;
        min-width: 70px !important;
        max-width: 70px !important;
        max-height: 70px !important;
        display: block !important;
        aspect-ratio: 1 / 1;
        flex-shrink: 0;
    }
    
    /* Navbar padding adjustments */
    .navbar {
        padding: 0.75rem 0;
    }
    
    /* Mobile menu styling */
    .navbar-collapse {
        background: #ffffff;
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-nav .nav-item {
        padding: 0.5rem 0;
    }
    
    .navbar-nav .nav-link {
        color: var(--dark-color) !important;
    }
    
    /* Icons on mobile */
    .navbar-icons {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .navbar-icons a {
        color: var(--dark-color) !important;
    }
    
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 25px;
    }
    
    [dir="rtl"] .whatsapp-float {
        right: auto;
        left: 20px;
    }
}

/* Tablet responsive */
@media screen and (min-width: 769px) and (max-width: 991px) {
    .navbar-brand {
        max-height: 85px;
    }
    
    .navbar-brand .navbar-logo {
        height: 85px !important;
        width: 85px !important;
        min-height: 85px !important;
        min-width: 85px !important;
        max-width: 85px !important;
        max-height: 85px !important;
        display: block !important;
        aspect-ratio: 1 / 1;
        flex-shrink: 0;
    }
    
    .navbar {
        padding: 0.85rem 0;
    }
}
