/* Custom CSS for Ashwamedh Ayurveda */

/* Font styling */
body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
}

.navbar-brand h4 {
    font-family: 'Crimson Text', serif;
    font-weight: 600;
}

/* Navigation improvements */
.nav-link {
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    transform: translateY(-1px);
    color: #198754 !important;
}

.navbar-nav .nav-link i {
    margin-right: 5px;
}

/* Search bar styling */
.input-group .form-control:focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

/* Button styling */
.btn-success {
    background-color: #198754;
    border-color: #198754;
}

.btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
}

.btn-outline-success {
    color: #198754;
    border-color: #198754;
}

.btn-outline-success:hover {
    background-color: #198754;
    border-color: #198754;
}

/* Badge styling */
.badge {
    font-size: 0.6rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Footer styling */
footer a:hover {
    color: #198754 !important;
    transition: color 0.3s ease;
}

/* Toast messages */
.toast {
    min-width: 300px;
}

/* Logo fallback styling */
.navbar-brand img {
    border-radius: 8px;
}

/* Dropdown styling */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #198754;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .navbar-brand h4 {
        font-size: 1.2rem;
    }
    
    .navbar-brand small {
        font-size: 0.7rem;
    }
    
    .input-group {
        width: 200px !important;
    }
    
    .nav-link {
        padding: 0.5rem 1rem;
    }
}

/* Product Image Styling */
.product-image-container {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background-color: #f8f9fa;
    border-radius: 0.375rem 0.375rem 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* Changed from cover to contain to show full image */
    object-position: center;
    transition: transform 0.3s ease;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Hover effect for product images */
.product-card:hover .product-image {
    transform: scale(1.05);
}

/* Fallback styling for missing images */
.product-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 1.2rem;
    text-align: center;
    border-radius: 0.375rem 0.375rem 0 0;
}

/* Featured product sidebar images */
.featured-product-image {
    width: 60px;
    height: 60px;
    object-fit: contain; /* Changed from cover to contain */
    object-position: center;
    background-color: white;
    border: 1px solid #dee2e6;
    padding: 2px;
}

/* Ensure consistent card heights */
.product-card .card-img-top {
    border-radius: 0.375rem 0.375rem 0 0;
}

/* Product cards should have consistent height and layout */
.product-card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* Image loading animation */
.product-image {
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.product-image.loaded {
    opacity: 1;
}

/* Gallery thumbnails styling */
.gallery-thumb-container:hover {
    border-color: var(--ayurveda-green) !important;
}

/* Main product image container */
.main-image-container {
    border: 1px solid #dee2e6;
}

/* Cart image containers */
.cart-image-container {
    border: 1px solid #dee2e6;
}

/* Ensure product images don't get distorted */
@media (max-width: 768px) {
    .product-image-container {
        height: 200px; /* Smaller height on mobile */
    }
    
    .main-image-container {
        height: 300px !important; /* Smaller on mobile */
    }
}

/* Loading state */
.product-image-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #6c757d;
}

/* Better image aspect ratio handling */
.product-image-container::before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-image-container::before {
    opacity: 1;
}

/* Ayurveda theme colors */
:root {
    --ayurveda-green: #198754;
    --ayurveda-dark-green: #146c43;
    --ayurveda-gold: #ffc107;
    --ayurveda-brown: #795548;
}
