/* Custom Styles for ECommerce Website */

/* Hero Section */
.hero-slider {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

.hero-content {
    text-align: center;
    color: white;
    z-index: 2;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* Banner Navigation */
.hero-navigation {
    position: absolute;
    top: 50%;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 3;
    pointer-events: none;
}

.hero-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
}

.hero-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Banner Indicators */
.hero-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: white;
}

.indicator:hover {
    transform: scale(1.2);
}

/* Product Cards */
.product-image {
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.product-old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9rem;
}

/* Category Cards */
.category-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 40px 20px;
    border-radius: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-card i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.category-card:hover {
    transform: scale(1.05);
}

/* Cart Page */
.cart-item {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
}

.cart-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
}

.quantity-input {
    width: 80px;
}

/* Checkout Form */
.checkout-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* User Dashboard */
.dashboard-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.order-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-processing {
    background-color: #cce5ff;
    color: #004085;
}

.status-shipped {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-delivered {
    background-color: #d4edda;
    color: #155724;
}

.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

/* Admin Panel */
.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
}

/* Product Image Styles */
.product-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.product-img-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.stats-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .hero-slider {
        height: 450px;
    }
    
    .product-image {
        height: 220px;
    }
}

@media (max-width: 992px) {
    .hero-slider {
        height: 400px;
    }
    
    .product-image {
        height: 200px;
    }
    
    .cart-item img {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 768px) {
    .hero-slider {
        height: 350px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .product-image {
        height: 180px;
    }
    
    .cart-item img {
        width: 60px;
        height: 60px;
    }
    
    .admin-sidebar {
        position: fixed;
        z-index: 1000;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .admin-sidebar.show {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    .checkout-section {
        padding: 20px;
    }
    
    .dashboard-card {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .hero-slider {
        height: 300px;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-content .btn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-card .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .cart-item {
        padding: 15px 0;
    }
    
    .cart-item img {
        width: 50px;
        height: 50px;
    }
    
    .quantity-input {
        width: 60px;
    }
    
    .checkout-section {
        padding: 15px;
    }
    
    .dashboard-card {
        padding: 15px;
    }
    
    .footer {
        padding: 30px 0 15px;
    }
    
    .footer h5 {
        font-size: 1rem;
    }
    
    .footer p {
        font-size: 0.8rem;
    }
}

/* Product Image Styles */
.product-img {
    width: 60px !important;
    height: 60px !important;
    object-fit: cover !important;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.product-img-placeholder {
    width: 60px !important;
    height: 60px !important;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

/* Admin table product images */
.admin-products .product-img {
    width: 50px !important;
    height: 50px !important;
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.cart-badge:empty {
    display: none;
}

/* Form Validation */
.is-invalid {
    border-color: var(--danger-color);
}

.invalid-feedback {
    display: block;
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Product Detail Page */
.product-detail-image {
    max-height: 500px;
    object-fit: contain;
}

.review-card {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
}

.rating {
    color: #ffc107;
}

/* Search Results */
.search-highlight {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Toast Notifications */
.custom-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Image Upload Preview */
.image-preview {
    max-width: 200px;
    max-height: 200px;
    margin-top: 10px;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 10px;
}

/* Quick View Modal */
.quick-view-modal .modal-dialog {
    max-width: 900px;
}

/* Wishlist Button */
.wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.wishlist-btn:hover {
    transform: scale(1.1);
}

.wishlist-btn.active {
    color: var(--danger-color);
}

/* Filter Sidebar */
.filter-sidebar {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.filter-section {
    margin-bottom: 30px;
}

.filter-section h6 {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-dark);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 20px;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--text-light);
}

/* Badge Styles */
.badge-new {
    background-color: var(--success-color);
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-sale {
    background-color: var(--danger-color);
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-link {
        padding: 10px 0;
    }
    
    .btn-lg {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .modal-dialog {
        margin: 10px;
    }
}

/* Touch-friendly buttons for mobile */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .product-card .btn {
        padding: 12px;
    }
    
    .add-to-cart {
        min-height: 44px;
    }
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .admin-sidebar {
        display: none !important;
    }
    
    .admin-content {
        margin-left: 0 !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
