/* Custom Variables */
:root {
    --primary-color: #f84183;
    --primary-hover: #e63675;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --font-poppins: 'Poppins', sans-serif;
    --font-montserrat: 'Montserrat', sans-serif;
    --border-radius: 10px;
    --transition: all 0.3s ease;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --box-shadow-hover: 0 10px 30px rgba(0,0,0,0.15);
}

/* Cross-browser compatibility */
* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Smooth scrolling for all browsers */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Remove default margin/padding */
body, h1, h2, h3, h4, h5, h6, p, ul, ol, dl, li, dt, dd {
    margin: 0;
    padding: 0;
}

/* Global Styles */
body {
    font-family: var(--font-poppins);
    background-color: #f8f9fa;
    line-height: 1.6;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-montserrat);
    font-weight: 600;
    line-height: 1.3;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    -webkit-transition: var(--transition);
    -moz-transition: var(--transition);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    -webkit-transition: var(--transition);
    -moz-transition: var(--transition);
    transition: var(--transition);
}

/* Responsive typography */
h1 { font-size: clamp(1.5rem, 4vw, 3rem); }
h2 { font-size: clamp(1.25rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.125rem, 2.5vw, 2rem); }
h4 { font-size: clamp(1rem, 2vw, 1.5rem); }
h5 { font-size: clamp(0.875rem, 1.5vw, 1.25rem); }
h6 { font-size: clamp(0.75rem, 1.25vw, 1rem); }

/* Custom Primary Color */
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

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

.bg-primary {
    background-color: var(--primary-color) !important;
}

a {
    color: var(--primary-color);
}

a:hover {
    color: var(--primary-hover);
}

/* Navbar Brand Logo */
a.navbar-brand img {
    width: 180px;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 100px 0;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
}

/* Product Cards */
.product-card {
    -webkit-transition: var(--transition);
    -moz-transition: var(--transition);
    transition: var(--transition);
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: white;
    -webkit-box-shadow: var(--box-shadow);
    -moz-box-shadow: var(--box-shadow);
    box-shadow: var(--box-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    -webkit-transform: translateY(-5px);
    -moz-transform: translateY(-5px);
    transform: translateY(-5px);
    -webkit-box-shadow: var(--box-shadow-hover);
    -moz-box-shadow: var(--box-shadow-hover);
    box-shadow: var(--box-shadow-hover);
}

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

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

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: auto;
}

/* Category Cards */
.category-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    border-radius: 10px;
    overflow: hidden;
}

.category-card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}

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

.category-card .card-img-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

/* Cart Items */
.cart-item {
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    background: white;
}

.cart-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
}

/* Form Styles */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(248, 65, 131, 0.25);
}

/* Admin Sidebar */
.admin-sidebar {
    min-height: 100vh;
    color: white;
    background-color: #000000 !important;
}

/* Hero Slideshow */
#heroCarousel {
    min-height: 500px;
}

#heroCarousel .carousel-item {
    min-height: 500px;
}

#heroCarousel .carousel-item img {
    max-height: 400px;
    object-fit: contain;
    width: 100%;
}

.hero-section {
    min-height: 500px;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 15px 20px;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: white;
    background-color: rgba(255,255,255,0.1);
    border-left: 4px solid var(--primary-color);
}

/* Stats Cards */
.stat-card {
    border: none;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

/* Gallery Thumbnails */
.gallery-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.gallery-thumbnail:hover,
.gallery-thumbnail.active {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* Coupon Badge */
.coupon-badge {
    background-color: var(--success-color);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.875rem;
}

/* Order Status Badges */
.status-pending {
    background-color: var(--warning-color);
    color: #000;
}

.status-processing {
    background-color: var(--info-color);
    color: white;
}

.status-delivered {
    background-color: var(--success-color);
    color: white;
}

.status-cancelled {
    background-color: var(--danger-color);
    color: white;
}

/* Blog post content styling */
.blog-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #343a40;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.blog-content p {
    margin-bottom: 1rem;
}

.blog-content strong,
.blog-content b {
    font-weight: 700;
}

.blog-content mark {
    background-color: #ffe58f;
    padding: 0.15em 0.3em;
    border-radius: 0.2em;
}

.blog-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.blog-content a:hover {
    color: var(--primary-hover);
}

/* Responsive Design - Mobile First Approach */

/* Extra Small Devices (phones, 575px and down) */
@media (max-width: 575.98px) {
    /* Hero Section */
    .hero-section {
        padding: 60px 0;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-section p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    /* Product Cards */
    .product-card img {
        height: 200px;
    }
    
    .product-card .card-body {
        padding: 1rem;
    }
    
    .product-price {
        font-size: 1.25rem;
    }
    
    /* Category Cards */
    .category-card img {
        height: 150px;
    }
    
    /* Cart Items */
    .cart-item {
        padding: 15px;
        flex-direction: column;
        text-align: center;
    }
    
    .cart-item img {
        width: 100%;
        height: 200px;
        margin-bottom: 1rem;
    }
    
    /* Navigation */
    .navbar-brand img {
        width: 140px;
    }
    
    .navbar-nav {
        text-align: center;
        padding: 1rem 0;
    }
    
    .navbar-nav .nav-link {
        margin: 0.5rem 0;
    }
    
    /* Forms */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Buttons */
    .btn {
        min-height: 44px; /* Touch-friendly size */
        padding: 0.75rem 1.5rem;
    }
    
    /* Admin Sidebar */
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: -250px;
        width: 250px;
        height: 100vh;
        z-index: 1050;
        -webkit-transition: left 0.3s ease;
        -moz-transition: left 0.3s ease;
        transition: left 0.3s ease;
    }
    
    .admin-sidebar.show {
        left: 0;
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    /* Mobile menu toggle */
    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1051;
        background: var(--primary-color);
        color: white;
        border: none;
        padding: 0.5rem;
        border-radius: 5px;
        cursor: pointer;
    }
    
    /* Tables */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table-responsive table {
        min-width: 600px;
    }
    
    /* Stats Cards */
    .stat-card {
        margin-bottom: 1rem;
    }
    
    /* Gallery Thumbnails */
    .gallery-thumbnail {
        width: 60px;
        height: 60px;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .product-card img {
        height: 220px;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .cart-item img {
        width: 80px;
        height: 80px;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .product-card img {
        height: 230px;
    }
    
    .hero-section h1 {
        font-size: 2.8rem;
    }
    
    .admin-sidebar {
        width: 200px;
    }
    
    .admin-content {
        margin-left: 200px;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .product-card img {
        height: 240px;
    }
    
    .admin-content {
        margin-left: 250px;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .hero-section h1 {
        font-size: 3.5rem;
    }
    
    .container {
        max-width: 1140px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .navbar-brand img {
        -webkit-transform: scale(0.9);
        transform: scale(0.9);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .card {
        background-color: #2d2d2d;
        border-color: #404040;
    }
    
    .form-control {
        background-color: #2d2d2d;
        border-color: #404040;
        color: #e0e0e0;
    }
    
    .form-control:focus {
        background-color: #2d2d2d;
        border-color: var(--primary-color);
        color: #e0e0e0;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .admin-sidebar,
    .btn,
    .cart-actions {
        display: none !important;
    }
    
    .container {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    .product-card,
    .card {
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        -webkit-animation-duration: 0.01ms !important;
        -moz-animation-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        -webkit-animation-iteration-count: 1 !important;
        -moz-animation-iteration-count: 1 !important;
        animation-iteration-count: 1 !important;
        -webkit-transition-duration: 0.01ms !important;
        -moz-transition-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus styles for accessibility */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to content link for screen readers */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-to-content:focus {
    top: 6px;
}

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

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

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

/* Badge Customization */
.badge-custom {
    background-color: var(--primary-color);
    color: white;
}
