/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Navbar Styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Desktop Navbar - Fixed Position */
@media (min-width: 768px) {
    .navbar.d-none.d-md-block {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1030;
        background: linear-gradient(45deg, #ff6b00, #ff8533);
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    /* Add top margin to body to account for fixed navbar */
    body {
        padding-top: 70px; /* Adjust based on navbar height */
    }

    /* Ensure main content doesn't overlap with fixed navbar */
    .main-content {
        margin-top: 20px;
    }

    .row.g-4 {
        gap: 20px !important;
    }
}

/* Ensure nav links are white in dark navbars */
.navbar-dark .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-dark .nav-link:hover {
    color: white !important;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Card Styles */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

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

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* Sidebar Styles */
.list-group-item {
    border: none;
    padding: 0.75rem 1.25rem;
}

.list-group-item a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.list-group-item a:hover {
    color: #007bff;
}

/* Form Styles */
.form-control:focus {
    box-shadow: none;
    border-color: #007bff;
}

.btn-primary {
    background-color: #007bff;
    border: none;
    padding: 0.5rem 1.5rem;
}

.btn-primary:hover {
    background-color: #0056b3;
}

/* Footer Styles */
footer {
    margin-top: auto;
}

footer a {
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #007bff !important;
}

/* Product Card Styles */
.product-card {
    margin-bottom: 1.5rem;
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease;
}

/* Animation class that will be added by JavaScript */
.product-card.animate-in {
    opacity: 0;
    transform: translateX(100px);
    animation: slideInFromRight 0.6s ease-out forwards;
}

.product-card.animate-in:nth-child(1) { animation-delay: 0.1s; }
.product-card.animate-in:nth-child(2) { animation-delay: 0.2s; }
.product-card.animate-in:nth-child(3) { animation-delay: 0.3s; }
.product-card.animate-in:nth-child(4) { animation-delay: 0.4s; }
.product-card.animate-in:nth-child(5) { animation-delay: 0.5s; }
.product-card.animate-in:nth-child(6) { animation-delay: 0.6s; }
.product-card.animate-in:nth-child(7) { animation-delay: 0.7s; }
.product-card.animate-in:nth-child(8) { animation-delay: 0.8s; }
.product-card.animate-in:nth-child(9) { animation-delay: 0.9s; }
.product-card.animate-in:nth-child(10) { animation-delay: 1.0s; }
.product-card.animate-in:nth-child(11) { animation-delay: 1.1s; }
.product-card.animate-in:nth-child(12) { animation-delay: 1.2s; }

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

.product-card .card-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.product-card .price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #007bff;
}

/* Mobile Product Card Animation */
.mobile-product-card {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease;
    background: white;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    position: relative;
    margin-bottom: 0.5rem;
}

/* Animation class that will be added by JavaScript */
.mobile-product-card.animate-in {
    opacity: 0;
    transform: translateX(50px);
    animation: slideInFromRightMobile 0.5s ease-out forwards;
}

.mobile-product-card.animate-in:nth-child(1) { animation-delay: 0.05s; }
.mobile-product-card.animate-in:nth-child(2) { animation-delay: 0.1s; }
.mobile-product-card.animate-in:nth-child(3) { animation-delay: 0.15s; }
.mobile-product-card.animate-in:nth-child(4) { animation-delay: 0.2s; }
.mobile-product-card.animate-in:nth-child(5) { animation-delay: 0.25s; }
.mobile-product-card.animate-in:nth-child(6) { animation-delay: 0.3s; }
.mobile-product-card.animate-in:nth-child(7) { animation-delay: 0.35s; }
.mobile-product-card.animate-in:nth-child(8) { animation-delay: 0.4s; }

/* Mobile specific styles */
@media (max-width: 767px) {
    .mobile-product-card {
        min-height: 275px; /* Reduced by 5px from 280px */
        margin-bottom: 0.5rem;
        width: calc(100% + 1in);
        box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    }

    .mobile-product-card .card-img-top {
        height: 1.5in; /* Set to 1.5 inches as requested */
        object-fit: cover;
        border-bottom: 1px solid #f0f0f0;
    }

    .mobile-product-card .card-body {
        padding: 0.5rem 0.5rem 0.2rem 0.5rem; /* Reduced padding further */
        min-height: 85px; /* Reduced by 5px from 90px */
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .mobile-product-card .card-title {
        font-size: 0.8rem;
        margin-bottom: 0.3rem; /* Reduced margin */
        height: 2.2em; /* Reduced height */
        line-height: 1.2;
        color: #333;
        font-weight: 600;
    }

    .mobile-product-card .product-badges {
        margin-bottom: 0.2rem; /* Reduced margin */
    }

    .mobile-product-card .product-badges .badge {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
    }

    .mobile-product-card .product-info {
        margin-bottom: 0.2rem; /* Reduced margin */
    }

    .mobile-product-card .product-info small {
        font-size: 0.7rem;
        margin-bottom: 0.1rem; /* Reduced margin */
    }

    .mobile-product-card .card-text {
        font-size: 0.9rem;
        margin-bottom: 0.3rem; /* Reduced margin */
        color: #ff6b00;
        font-weight: 700;
    }

    .mobile-product-card .rating {
        font-size: 0.7rem;
    }

    .mobile-product-card .sales-count {
        font-size: 0.7rem;
    }

    .mobile-product-card .btn-sm {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
        border-radius: 6px;
        font-weight: 600;
    }

    .mobile-product-card .rating-badge {
        top: 8px;
        left: 8px;
        padding: 4px 8px;
        font-size: 0.7rem;
        font-weight: 600;
        background: rgba(0, 0, 0, 0.8);
        border-radius: 6px;
    }

    .mobile-product-card .rating-badge i {
        color: #ffd700;
        margin-right: 3px;
    }

    /* Grid layout for mobile */
    .row-cols-2 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.6rem !important;
        padding: 0.3rem !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        justify-items: center !important;
    }

    .row-cols-2 > .col {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        justify-content: center !important;
    }

    /* Main content centering */
    .main-content {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        flex-direction: column !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .container-fluid {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

@media (max-width: 480px) {
    .mobile-product-card {
        min-height: 255px; /* Reduced by 5px from 260px */
        width: calc(100% + 0.8in);
        box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    }

    .mobile-product-card .card-img-top {
        height: 1.5in; /* Set to 1.5 inches as requested */
    }

    .mobile-product-card .card-body {
        padding: 0.4rem 0.4rem 0.15rem 0.4rem; /* Reduced padding */
        min-height: 75px; /* Reduced by 5px from 80px */
    }

    .mobile-product-card .card-title {
        font-size: 0.75rem;
        margin-bottom: 0.25rem; /* Reduced margin */
        height: 2em; /* Reduced height */
    }

    .mobile-product-card .product-badges .badge {
        font-size: 0.55rem;
        padding: 0.15rem 0.3rem;
    }

    .mobile-product-card .product-info small {
        font-size: 0.65rem;
        margin-bottom: 0.1rem; /* Reduced margin */
    }

    .mobile-product-card .card-text {
        font-size: 0.85rem;
        margin-bottom: 0.25rem; /* Reduced margin */
    }

    .mobile-product-card .rating,
    .mobile-product-card .sales-count {
        font-size: 0.65rem;
    }

    .mobile-product-card .btn-sm {
        font-size: 0.65rem;
        padding: 0.25rem 0.4rem;
    }

    .mobile-product-card .rating-badge {
        top: 6px;
        left: 6px;
        padding: 3px 6px;
        font-size: 0.65rem;
    }

    .row-cols-2 {
        gap: 0.5rem !important;
        padding: 0.25rem !important;
        width: 100% !important;
    }
}

@media (max-width: 360px) {
    .mobile-product-card {
        min-height: 235px; /* Reduced by 5px from 240px */
        width: calc(100% + 0.6in);
        box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    }

    .mobile-product-card .card-img-top {
        height: 1.5in; /* Set to 1.5 inches as requested */
    }

    .mobile-product-card .card-body {
        padding: 0.3rem 0.3rem 0.1rem 0.3rem; /* Reduced padding */
        min-height: 65px; /* Reduced by 5px from 70px */
    }

    .mobile-product-card .card-title {
        font-size: 0.7rem;
        margin-bottom: 0.2rem; /* Reduced margin */
        height: 1.8em; /* Reduced height */
    }

    .mobile-product-card .product-badges .badge {
        font-size: 0.5rem;
        padding: 0.1rem 0.25rem;
    }

    .mobile-product-card .product-info small {
        font-size: 0.6rem;
        margin-bottom: 0.08rem; /* Reduced margin */
    }

    .mobile-product-card .card-text {
        font-size: 0.8rem;
        margin-bottom: 0.2rem; /* Reduced margin */
    }

    .mobile-product-card .rating,
    .mobile-product-card .sales-count {
        font-size: 0.6rem;
    }

    .mobile-product-card .btn-sm {
        font-size: 0.6rem;
        padding: 0.2rem 0.3rem;
    }

    .row-cols-2 {
        gap: 0.4rem !important;
        padding: 0.2rem !important;
        width: 100% !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        margin-bottom: 2rem;
    }

    .product-card img {
        height: 150px;
    }
}

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

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRightMobile {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Hover effects for cards */
.product-card:hover,
.mobile-product-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

/* Banner Styles */
.banner-carousel {
    margin-bottom: 2rem;
}

.banner-carousel .carousel-item {
    height: 400px;
}

.banner-carousel .carousel-item img {
    object-fit: cover;
    height: 100%;
    width: 100%;
}

.carousel-caption {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
}

/* Mobile Banner Styles */
@media (max-width: 768px) {
    .banner-carousel {
        margin-bottom: 1rem;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
    }

    .banner-carousel .carousel-item {
        height: 1.5in; /* 1.5 inches height */
    }

    .banner-carousel .carousel-item img {
        object-fit: cover;
        height: 1.5in !important; /* Force 1.5 inches height */
        width: 100vw !important; /* Force full width */
        border-radius: 0;
    }

    .mobile-banner {
        height: 1.5in !important; /* Force 1.5 inches height */
        width: 100vw !important; /* Force full width */
        object-fit: cover;
        border-radius: 0;
    }

    .banner-image {
        height: 1.5in !important; /* 1.5 inches height */
        width: 100vw !important; /* Full viewport width */
        border-radius: 0;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
    }
}

@media (max-width: 480px) {
    .banner-carousel .carousel-item {
        height: 1.5in; /* Maintain 1.5 inches even on smaller screens */
    }

    .banner-carousel .carousel-item img {
        height: 1.5in !important;
        width: 100vw !important;
    }

    .mobile-banner {
        height: 1.5in !important;
        width: 100vw !important;
    }
}
