/* ============================================
   Al Malaabis - Main Stylesheet
   ============================================ */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --border-color: #dee2e6;
}

/* ============================================
   Global Styles
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
}

/* ============================================
   Header Styles
   ============================================ */

.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: white;
}

.navbar {
    padding: 1rem 0;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.navbar-nav .nav-link {
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.3s;
}

.navbar-nav .nav-link:hover {
    color: var(--secondary-color);
}

.btn-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    padding: 0.5rem;
    position: relative;
}

.btn-cart:hover {
    color: var(--secondary-color);
}

.cart-badge {
    font-size: 0.7rem;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Menu */
.offcanvas-start {
    width: 280px;
}

/* ============================================
   Hero Slider
   ============================================ */

.hero-slider {
    margin-top: 0;
}

.hero-slider .carousel-item {
    height: 500px;
    overflow: hidden;
}

.hero-slider .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slider .carousel-caption {
    background: rgba(0, 0, 0, 0.5);
    padding: 2rem;
    border-radius: 10px;
}

.hero-slider .carousel-caption h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .hero-slider .carousel-item {
        height: 300px;
    }
    
    .hero-slider .carousel-caption h2 {
        font-size: 1.5rem;
    }
}

/* ============================================
   Category Cards
   ============================================ */

.category-card {
    border: none;
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.category-image {
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s;
}

.category-card:hover .category-image {
    transform: scale(1.05);
}

/* ============================================
   Product Cards
   ============================================ */

.product-card {
    border: none;
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.product-image-wrapper {
    height: 400px;
    overflow: hidden;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

/* Size Pills */
.size-pills {
    margin-bottom: 1rem;
}

.size-pill {
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.3s;
}

.size-pill:hover {
    transform: scale(1.05);
}

.size-pill.active {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.add-to-cart-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Cart Sidebar
   ============================================ */

.offcanvas-end {
    width: 400px;
}

@media (max-width: 576px) {
    .offcanvas-end {
        width: 100%;
    }
}

.cart-items {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.cart-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-size {
    font-size: 0.875rem;
    color: var(--text-light);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-input {
    width: 60px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 0.25rem;
}

.btn-remove-item {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 1.2rem;
    padding: 0.25rem;
    cursor: pointer;
}

.btn-remove-item:hover {
    color: #c0392b;
}

.offcanvas-footer {
    position: sticky;
    bottom: 0;
    background: white;
}

/* ============================================
   Footer
   ============================================ */

.main-footer {
    margin-top: auto;
}

.footer-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.main-footer a {
    transition: color 0.3s;
}

.main-footer a:hover {
    color: white !important;
}

.social-links a {
    display: inline-block;
    transition: transform 0.3s;
}

.social-links a:hover {
    transform: scale(1.2);
}

/* ============================================
   Enquiry Form
   ============================================ */

.enquiry-section {
    min-height: 60vh;
}

#enquiryCartItems {
    max-height: 300px;
    overflow-y: auto;
}

/* ============================================
   Utility Classes
   ============================================ */

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.text-muted {
    color: var(--text-light) !important;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    .navbar-brand {
        margin: 0 auto;
    }
    
    .product-image-wrapper {
        height: 300px;
    }
    
    .category-image {
        height: 200px;
    }
}

/* ============================================
   Image Optimization
   ============================================ */

img {
    max-width: 100%;
    height: auto;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Placeholder for broken images */
img::before {
    content: '';
    display: block;
    background: var(--bg-light);
    width: 100%;
    height: 100%;
}

/* ============================================
   Loading States
   ============================================ */

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

