/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,138.7C960,139,1056,117,1152,112C1248,107,1344,117,1392,122.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
}

.hero-image {
    text-align: center;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Category Cards */
.category-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: #007bff;
}

/* Product Cards */
.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    background: white;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.product-image {
    height: 200px;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.badge-new {
    background: #28a745;
    color: white;
}

.badge-sale {
    background: #dc3545;
    color: white;
}

.badge-hot {
    background: #fd7e14;
    color: white;
}

.product-body {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.product-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 0.5rem;
}

.product-price .original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 1rem;
    margin-left: 0.5rem;
}

.product-rating {
    margin-bottom: 1rem;
}

.star {
    color: #ffc107;
}

.star.empty {
    color: #e0e0e0;
}

/* Cart Styles */
.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    border-radius: 5px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: #007bff;
    font-weight: bold;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-control button {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
}

.quantity-control button:hover {
    background: #f8f9fa;
}

.quantity-control input {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Filter Sidebar */
.filter-sidebar {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.filter-section {
    margin-bottom: 2rem;
}

.filter-section h5 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.filter-option {
    margin-bottom: 0.5rem;
}

.filter-option label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-range {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.price-range input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section .display-3 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .category-card {
        margin-bottom: 1rem;
    }
    
    .product-card {
        margin-bottom: 1rem;
    }
    
    .filter-sidebar {
        margin-bottom: 2rem;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

.custom-toast {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-bottom: 1rem;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

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

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

/* Search Results */
.search-results {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    display: none;
    min-width: 100%;
    margin-top: 5px;
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Category Grid Base Styles */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.category-grid > div {
  width: 100%;
}

/* Responsive Design Fixes */
@media (max-width: 1024px) {
  .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }
  
  .navbar {
    padding: 0.5rem 0 !important;
  }
  
  .navbar-nav {
    padding-top: 0.5rem;
  }
  
  .navbar-nav .nav-link {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.95rem;
  }
  
  .hero-section {
    padding: 2rem 0;
  }
  
  .hero-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
  }
  
  .hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }
  
  .btn-hero {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    gap: 1rem;
  }
  
  .hero-visual {
    display: none;
  }
  
  .products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0 10px;
  }
  
  .product-card {
    margin-bottom: 0;
  }
  
  .product-image {
    height: 180px;
  }
  
  .product-body {
    padding: 0.75rem;
  }
  
  .product-title {
    font-size: 0.95rem;
    line-height: 1.2;
  }
  
  .product-description {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0.5rem;
  }
  
  .product-price {
    margin: 0.5rem 0;
  }
  
  .price-current {
    font-size: 1.1rem;
  }
  
  .price-original {
    font-size: 0.9rem;
  }
  
  .product-actions {
    gap: 0.3rem;
  }
  
  .btn-product {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }
  
  .category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .category-card {
    padding: 1.25rem 0.75rem;
  }
  
  .category-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
  }
  
  .category-title {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
  }
  
  .category-description {
    font-size: 0.8rem;
  }
  
  .section-title {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
  }
  
  .section-header {
    padding: 0;
  }
  
  .section-subtitle {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  .navbar-brand i {
    font-size: 1.3rem;
  }
  
  .navbar-nav .nav-link {
    padding: 0.3rem 0.5rem !important;
    font-size: 0.8rem;
  }
  
  .hero-title {
    font-size: 1.3rem;
  }
  
  .hero-subtitle {
    font-size: 0.85rem;
  }
  
  .btn-hero {
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0 5px;
  }
  
  .product-image {
    height: 150px;
  }
  
  .product-body {
    padding: 0.6rem;
  }
  
  .product-title {
    font-size: 0.85rem;
  }
  
  .product-description {
    font-size: 0.75rem;
    -webkit-line-clamp: 1;
  }
  
  .price-current {
    font-size: 0.95rem;
  }
  
  .category-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .category-card {
    padding: 1rem 0.75rem;
  }
  
  .category-icon {
    font-size: 2rem;
  }
  
  .section-title {
    font-size: 1.35rem;
    margin-bottom: 1rem;
  }
}

/* Review Styles */
.product-reviews {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e0e0e0;
}

.review-stats {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
}

.review-stats .display-4 {
  color: #ff9800;
  margin-bottom: 0.5rem;
}

.review-distribution {
  margin-top: 2rem;
}

.review-distribution .progress {
  background-color: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.review-card {
  background: white;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.review-card:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
}

.review-card .card-title {
  color: #333;
  font-weight: 600;
}

.review-card .card-text {
  color: #666;
  line-height: 1.6;
}

.star {
  color: #ff9800;
  font-size: 1rem;
}

.star.empty {
  color: #ddd;
}

#reviewForm textarea {
  resize: vertical;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#reviewForm .form-label {
  font-weight: 600;
  color: #333;
}

#reviewForm .form-range {
  height: 8px;
  border-radius: 4px;
}

#reviewForm .form-range::-webkit-slider-thumb {
  background: #ff9800;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
}

#reviewForm .form-range::-moz-range-thumb {
  background: #ff9800;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
}

.reviews-list {
  max-height: 600px;
  overflow-y: auto;
  padding-right: 1rem;
}

.reviews-list::-webkit-scrollbar {
  width: 8px;
}

.reviews-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.reviews-list::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.reviews-list::-webkit-scrollbar-thumb:hover {
  background: #555;
}
