/**
 * Shreeji Supermarket - Custom Styles
 * Theme Colors: Green (#28a745) and Orange/Yellow (#ffc107)
 */

:root {
    --primary-green: #28a745;
    --primary-orange: #ffc107;
    --secondary-green: #20c997;
    --dark-green: #155724;
    --light-green: #d4edda;
    --light-orange: #fff3cd;
    --text-dark: #212529;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0,0,0,0.15);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding-top: 20px;
    padding-bottom: 40px;
}

/* Top Bar */
.top-bar {
    font-size: 0.875rem;
    border-bottom: 2px solid var(--primary-orange);
}

/* Navigation */
.navbar {
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.75rem !important;
    letter-spacing: -0.5px;
}

.search-form {
    min-width: 400px;
}

.search-form .form-control {
    border-right: none;
    border-color: var(--primary-green);
}

.search-form .form-control:focus {
    box-shadow: none;
    border-color: var(--primary-green);
}

.search-form .btn {
    border-left: none;
}

/* Mega Menu */
.mega-menu {
    min-width: 600px;
    border: none;
    box-shadow: var(--shadow-md);
}

.mega-menu h6 {
    font-weight: 600;
    margin-bottom: 10px;
}

.mega-menu .dropdown-item {
    padding: 5px 15px;
    transition: all 0.3s ease;
}

.mega-menu .dropdown-item:hover {
    background-color: var(--light-green);
    padding-left: 20px;
}

/* Hero Carousel */
.hero-carousel .carousel-item {
    height: 450px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero-carousel .carousel-caption {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.9), rgba(255, 193, 7, 0.9));
    padding: 30px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.hero-carousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* Category Cards */
.category-card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.category-card .card-body {
    padding: 15px;
    text-align: center;
}

.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 10px;
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

/* Product Cards */
.product-card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.product-card:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.product-card .badge-discount {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: var(--primary-orange);
    color: var(--text-dark);
    font-weight: 600;
}

.product-image {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.product-card .card-body {
    padding: 15px;
}

.product-card .product-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card .product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-green);
}

.product-card .product-price .old-price {
    font-size: 0.875rem;
    color: var(--text-light);
    text-decoration: line-through;
    margin-right: 5px;
}

.product-card .btn-group-vertical {
    position: absolute;
    top: 10px;
    left: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .btn-group-vertical {
    opacity: 1;
}

/* Action Buttons */
.btn-add-cart {
    background: var(--primary-green);
    color: white;
    border: none;
    transition: all 0.3s ease;
}

.btn-add-cart:hover {
    background: var(--dark-green);
    transform: scale(1.05);
}

.btn-wishlist {
    background: white;
    color: var(--primary-orange);
    border: 1px solid var(--primary-orange);
}

.btn-wishlist:hover {
    background: var(--primary-orange);
    color: white;
}

/* Section Headers */
.section-header {
    margin-bottom: 30px;
    text-align: center;
}

.section-header h2 {
    font-weight: 700;
    color: var(--text-dark);
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-green), var(--primary-orange));
}

/* Features Section */
.features-section {
    background: white;
    padding: 40px 0;
    margin: 40px 0;
}

.feature-box {
    text-align: center;
    padding: 20px;
    transition: all 0.3s ease;
}

.feature-box:hover {
    transform: translateY(-5px);
}

.feature-box .feature-icon {
    font-size: 3rem;
    color: var(--primary-green);
    margin-bottom: 15px;
}

.feature-box h5 {
    font-weight: 600;
    margin-bottom: 10px;
}

/* Newsletter */
.newsletter-section {
    background: linear-gradient(135deg, var(--primary-orange), #ffdb4d);
}

.newsletter-form .form-control {
    border: 2px solid white;
}

/* Footer */
.footer {
    margin-top: auto;
}

.footer-links a {
    color: #adb5bd;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-orange);
    padding-left: 5px;
}

.social-links a {
    transition: all 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-orange) !important;
    transform: translateY(-3px);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    display: none;
    z-index: 999;
    border: none;
    box-shadow: var(--shadow-md);
}

.back-to-top:hover {
    background: var(--primary-green);
    color: white;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease;
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .search-form {
        min-width: 100%;
        margin-top: 10px;
    }
    
    .hero-carousel .carousel-item {
        height: 300px;
    }
    
    .mega-menu {
        min-width: 100%;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .product-card .btn-group-vertical {
        opacity: 1;
    }
}

@media (max-width: 576px) {
    .top-bar {
        display: none;
    }
    
    .hero-carousel .carousel-item {
        height: 250px;
    }
    
    .hero-carousel .carousel-caption {
        padding: 15px;
    }
    
    .hero-carousel .carousel-caption h1 {
        font-size: 1.5rem;
    }
}

/* Utility Classes */
.text-truncate-2 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* autoprefixer: ignore next */
    -webkit-box-orient: vertical;
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, var(--primary-orange), #ffdb4d);
}