/* ================ BASE STYLES ================ */
:root {
  --primary-color: #2a5d67;
  --secondary-color: #3a8c96;
  --accent-color: #f4a261;
  --dark-color: #1e3d42;
  --light-color: #f8f9fa;
  --text-color: #333;
  --text-light: #777;
  --border-color: #e0e0e0;
  --success-color: #28a745;
  --error-color: #dc3545;
  --warning-color: #ffc107;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #fff;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: white;
}

/* ================ HEADER STYLES ================ */
.header {
  background-color: white;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.logo i {
  margin-right: 0.5rem;
}

.navbar ul {
  display: flex;
  gap: 2rem;
}

.navbar a {
  font-weight: 600;
  transition: var(--transition);
}

.navbar a:hover {
  color: var(--secondary-color);
}

.portal {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.cart-icon, .user-icon {
  position: relative;
  font-size: 1.25rem;
  color: var(--text-color);
  transition: var(--transition);
}

.cart-icon:hover, .user-icon:hover {
  color: var(--primary-color);
}

.cart-count {
  position: absolute;
  top: -10px;
  right: -10px;
  background-color: var(--accent-color);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

.cart-count.animate {
  animation: bounce 0.5s;
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* ================ HERO BANNER ================ */
.hero-banner {
  height: 500px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  position: relative;
  margin-bottom: 4rem;
}

.hero-content {
  max-width: 600px;
  color: white;
  z-index: 1;
}

.hero-title {
  font-size: 3rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.search-container {
  margin-top: 2rem;
}

.search-form {
  width: 100%;
}

.search-input-group {
  display: flex;
  align-items: center;
  background-color: white;
  border-radius: 50px;
  padding: 0.5rem 1rem;
  box-shadow: var(--shadow-md);
}

.search-icon {
  color: var(--text-light);
  margin-right: 0.5rem;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.75rem 0;
  font-size: 1rem;
}

.search-button {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
}

.admin-banner-controls {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  background-color: rgba(255,255,255,0.9);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.file-upload-label {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--light-color);
  border-radius: 4px;
  cursor: pointer;
  margin-right: 1rem;
}

.file-upload-input {
  display: none;
}

/* ================ PRODUCTS SECTION ================ */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2rem;
  color: var(--dark-color);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.sorting-options {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.sort-select {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: white;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.product-card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.product-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: var(--accent-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 1;
}

.discount-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: var(--error-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 1;
}

.product-image-container {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1/1;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-actions {
  position: absolute;
  bottom: 1rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  transition: var(--transition);
}

.product-card:hover .product-actions {
  opacity: 1;
}

.action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: white;
  color: var(--primary-color);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.action-btn:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-3px);
}

.product-info {
  padding: 1.5rem;
}

.product-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.product-rating {
  color: var(--accent-color);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.rating-count {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-left: 0.25rem;
}

.product-price {
  margin-bottom: 1rem;
}

.current-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
}

.original-price {
  font-size: 1rem;
  text-decoration: line-through;
  color: var(--text-light);
  margin-left: 0.5rem;
}

.add-to-cart {
  width: 100%;
}

.view-all-container {
  text-align: center;
  margin-top: 3rem;
}

.view-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ================ MODAL STYLES ================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal.show {
  display: flex;
}

.modal-container {
  max-width: 900px;
  width: 100%;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
  z-index: 1;
}

.modal-close:hover {
  color: var(--primary-color);
}

.quick-view-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.quick-view-image {
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-view-image img {
  max-height: 400px;
  object-fit: contain;
}

.quick-view-details {
  padding: 2rem;
}

.quick-view-details h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

.product-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.availability {
  padding: 0.25rem 0.75rem;
  background-color: var(--success-color);
  color: white;
  border-radius: 50px;
  font-size: 0.85rem;
}

.product-description {
  margin-bottom: 1.5rem;
  color: var(--text-light);
  line-height: 1.7;
}

.product-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.quantity-selector {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.quantity-btn {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-input {
  width: 50px;
  height: 40px;
  border: none;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  text-align: center;
  -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.product-specs h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

.product-specs ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.5rem;
}

.product-specs li {
  display: flex;
  gap: 0.5rem;
}

.product-specs strong {
  font-weight: 600;
}

/* ================ TOAST NOTIFICATION ================ */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--dark-color);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 1rem;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
  z-index: 3000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background-color: var(--success-color);
}

.toast.error {
  background-color: var(--error-color);
}

.toast.warning {
  background-color: var(--warning-color);
  color: var(--text-color);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.toast-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
}

/* ================ EMPTY STATE ================ */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background-color: var(--light-color);
  border-radius: 8px;
}

.empty-icon {
  font-size: 3rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

.empty-state p {
  color: var(--text-light);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ================ RESPONSIVE STYLES ================ */
@media (max-width: 992px) {
  .quick-view-container {
    grid-template-columns: 1fr;
  }
  
  .quick-view-image {
    padding: 1rem;
  }
  
  .quick-view-details {
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
  
  .product-specs ul {
    grid-template-columns: 1fr;
  }
  
  .navbar ul {
    gap: 1.5rem;
  }
}

@media (max-width: 576px) {
  .header .container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .logo {
    margin-bottom: 0.5rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-banner {
    height: 400px;
  }
  
  .admin-banner-controls {
    position: static;
    margin-top: 2rem;
  }
  
  .product-card {
    max-width: 320px;
    margin: 0 auto;
  }
  
  
  .toast {
    width: calc(100% - 2rem);
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}