/* Modern Design System Tokens */
:root {
  --primary-color: #1e293b;
  --primary-hover: #0f172a;
  --secondary-color: #f8f9fa;
  --accent-color: #28a745;
  --text-dark: #333333;
  --text-muted: #6c757d;
  --card-bg: #ffffff;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --transition-base: all 0.3s ease;
}

/* Fix for Dropdown visibility */
.dropdown-menu.active {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
  display: block !important;
}

/* Fix for Scroll Up Button */
#scrollUp {
  background-color: var(--primary-color) !important;
  color: white !important;
}

#scrollUp:hover {
  background-color: var(--primary-hover) !important;
}

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text-dark);
  background-color: #f4f7f6;
}

/* Category Navigation */
.nav-tabs {
  border-bottom: none;
  margin-bottom: 2rem;
  gap: 10px;
  justify-content: center;
}

.filter-btn {
  border: none;
  background: white;
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 500;
  color: var(--text-dark);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Product Card Modernization */
.product-grid {
  display: flex;
  /* Fallback */
  height: 100%;
}

.product-card {
  background: var(--card-bg);
  border: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.product-img-wrapper {
  position: relative;
  overflow: hidden;
  padding-top: 100%;
  /* 1:1 Aspect Ratio */
  background: var(--secondary-color);
}

.product-img-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Changed from contain to cover for better aesthetics */
  transition: transform 0.5s ease;
}

.product-card:hover .product-img-wrapper img {
  transform: scale(1.05);
}

.hover-img {
  opacity: 0;
  z-index: 1;
}

.product-card:hover .hover-img {
  opacity: 1;
}

/* Action Buttons Overlay */
.product-action {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transform: translateX(10px);
  transition: var(--transition-base);
}

.product-card:hover .product-action {
  opacity: 1;
  transform: translateX(0);
}

.action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: 0.2s;
  text-decoration: none;
}

.action-btn:hover {
  background: var(--primary-color);
  color: white;
}

.badge-new,
.badge-hot {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 5;
  color: white;
}

.badge-new {
  background-color: var(--accent-color);
}

.badge-hot {
  background-color: #dc3545;
}

/* Product Info Section */
.product-info {
  padding: 1.5rem;
  background: white;
  text-align: left;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-category {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  display: block;
  text-decoration: none;
  transition: 0.2s;
}

.product-title:hover {
  color: var(--primary-color);
}

.price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* Buttons */
.add-to-cart-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  font-weight: 600;
  text-align: center;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: 0.2s;
  cursor: pointer;
}

.add-to-cart-btn:hover {
  background: var(--primary-color);
  color: white;
}

/* Favorite Button */
.favorite-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #cccccc;
  transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  padding: 0;
}

.favorite-btn:hover {
  transform: scale(1.2);
}

.liked {
  color: #e25555;
  animation: heartBeat 0.5s;
}

@keyframes heartBeat {
  0% {
    transform: scale(1);
  }

  25% {
    transform: scale(1.3);
  }

  50% {
    transform: scale(1);
  }

  75% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
  }
}

/* Footer Interaction */
.action-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
}


@media (max-width: 768px) {
  .product-grid {
    margin-bottom: 20px;
  }

  .filter-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
}

@media (max-width:420px) {
  .product-grid-4 .col-12 {
    width: 100% !important;
  }

  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Modal Styles */
.modal-content {
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 1px solid #f0f0f0;
}

.modal-product-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
}

.modal-link {
  display: inline-block;
  margin-top: 15px;
  background-color: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition-base);
}

.modal-link:hover {
  background-color: var(--primary-hover);
  color: white;
}

/* =========================
   User Profile Section 
   ========================= */
.profile-card {
  background: white;
  padding: 2rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 3px solid var(--primary-color);
}

.profile-container {
  background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
  padding: 2rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  text-align: center;
}

.profile-img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: var(--shadow-md);
  margin-bottom: 1rem;
}

.profile-info h3 {
  margin: 0;
  color: var(--text-dark);
  font-weight: 700;
  font-size: 1.5rem;
}

.profile-info p {
  margin: 5px 0 0;
  color: var(--text-muted);
}

/* =========================
   Product Details Page 
   ========================= */
.seller-box {
  background: white;
  border: none;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
}

.seller-box:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.seller-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--secondary-color);
}

.gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
  overflow-x: auto;
  padding-bottom: 5px;
}

.gallery-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  object-fit: cover;
  border: 2px solid transparent;
  transition: var(--transition-base);
}

.gallery-thumb:hover,
.gallery-thumb.active {
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.main-image-container {
  background: white;
  padding: 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
  margin-bottom: 1rem;
  overflow: hidden;
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-image {
  max-width: 100%;
  max-height: 500px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.product-specs-table {
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: white;
}

.product-specs-table th {
  background-color: var(--secondary-color);
  color: var(--text-dark);
  font-weight: 600;
  width: 30%;
  padding: 1rem;
}

.product-specs-table td {
  padding: 1rem;
  color: var(--text-muted);
}

/* =========================
   Form Styles (Post Page) 
   ========================= */
.form-card {
  background: white;
  padding: 2.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border-top: 5px solid var(--primary-color);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  display: block;
}

.form-control {
  border: 2px solid #e9ecef;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  transition: var(--transition-base);
  background-color: #fcfcfc;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(11, 96, 181, 0.1);
  outline: none;
  background-color: white;
}

.textarea-style textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 2px solid #e9ecef;
  border-radius: var(--radius-sm);
  padding: 1rem;
  background-color: #fcfcfc;
}

.file-upload-wrapper {
  position: relative;
  border: 2px dashed #ddd;
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  background: #fafafa;
  cursor: pointer;
  transition: var(--transition-base);
}

.file-upload-wrapper:hover {
  border-color: var(--primary-color);
  background: #f0f7ff;
}

.btn-primary-custom {
  background-color: var(--primary-color);
  color: white;
  padding: 12px 30px;
  border-radius: 30px;
  border: none;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: var(--transition-base);
  box-shadow: var(--shadow-md);
}

.btn-primary-custom:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}