/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #e17108;
  --primary-dark: #c85f06;
  --primary-light: #ff8f2b;
  --secondary-color: #2c3e50;
  --accent-color: #3498db;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --error-color: #e74c3c;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --text-light: #bdc3c7;
  --background-light: #f8f9fa;
  --background-white: #ffffff;
  --border-color: #e9ecef;
  --border-light: #f1f3f4;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 4px 15px rgba(0, 0, 0, 0.15);
  --border-radius: 8px;
  --border-radius-sm: 6px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--background-light);
  font-size: 14px;
}

html {
  scroll-behavior: smooth;
}

/* Search Bar Styling */
.search-bar-container {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  padding: 120px 20px 30px;
  margin-bottom: 0;
}

.search-wrapper {
  max-width: 700px;
  margin: 0 auto;
}

.search-bar {
  display: flex;
  background: var(--background-white);
  border-radius: 40px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.search-bar:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.search-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-secondary);
  font-size: 16px;
  z-index: 2;
}

.search-bar input[type="text"] {
  width: 100%;
  padding: 14px 16px 14px 45px;
  border: none;
  background: transparent;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-secondary);
}

.search-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 14px 24px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-btn:hover {
  background: var(--primary-dark);
}

.search-btn span {
  display: inline;
}

/* Main Layout */
.category-page {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  gap: 24px;
  padding: 24px 16px;
  min-height: calc(100vh - 180px);
}

/* Sidebar Styling */
.sidebar {
  flex: 0 0 240px;
  background: var(--background-white);
  border-radius: var(--border-radius);
  padding: 0;
  height: fit-content;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 24px;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
}

.mobile-menu-toggle {
  display: none;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-weight: 600;
  transition: var(--transition);
  font-size: 14px;
}

.mobile-menu-toggle:hover {
  background: var(--primary-dark);
}

.mobile-menu-toggle i {
  margin-right: 8px;
}

.category-section {
  padding: 20px;
}

.category-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-list {
  list-style: none;
}

.category-list > li {
  margin-bottom: 6px;
}

.category-list a {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--text-primary);
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
  font-weight: 500;
  gap: 10px;
  font-size: 14px;
}

.category-list a:hover {
  background: var(--background-light);
  color: var(--primary-color);
  transform: translateX(3px);
}

.category-list li.active > a {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
}

.category-list a i {
  width: 18px;
  text-align: center;
  font-size: 14px;
}

/* Dropdown Styling */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  position: relative;
}

.dropdown-arrow {
  margin-left: auto !important;
  width: auto !important;
  transition: var(--transition);
}

.dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  list-style: none;
  margin: 6px 0 0 0;
  padding: 0;
  background: var(--background-light);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

.dropdown:hover .dropdown-menu {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu a {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 0;
}

.dropdown-menu a:hover {
  background: var(--primary-color);
  color: white;
  transform: none;
}

/* Main Content */
.main-content {
  flex: 1;
}

.content-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.results-count {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* Product Card */
.product-card {
  background: var(--background-white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.product-card.no-hover:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

.product-image-container {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--background-light);
}

.product-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.product-card:hover .product-image-container img {
  transform: scale(1.03);
}

.product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.product-card:hover .product-overlay {
  opacity: 1;
}

.quick-view-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  font-size: 13px;
}

.quick-view-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.product-info {
  padding: 16px;
}

.product-category {
  font-size: 11px;
  color: var(--primary-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.product-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 6px;
}

.product-stock {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Modal Styling */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 999;
  backdrop-filter: blur(3px);
}

.modal-overlay.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.product-description-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  overflow: hidden;
}

.product-description-modal.show {
  display: block;
  animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.modal-content {
  background: var(--background-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  transition: var(--transition);
}

.close-btn:hover {
  background: var(--error-color);
  color: white;
}

.product-details-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 24px;
}

/* Product Images Section */
.product-images-section {
  display: flex;
  gap: 16px;
}

.product-details-image {
  flex: 1;
  width: 100%;
  height: 400px;
  border-radius: var(--border-radius);
  overflow: hidden;
  background: var(--background-light);
  border: 1px solid var(--border-color);
}

.product-details-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.product-thumbnails {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 70px;
}

.product-thumbnail {
  width: 70px;
  height: 70px;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.product-thumbnail:hover,
.product-thumbnail.active {
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.product-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Product Details Info */
.product-details-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-header {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
}

.product-category-badge {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.product-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.3;
}

.product-price-large {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
}

.product-description {
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 14px;
}

.product-specs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.spec-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.spec-value {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
}

/* Size Selection */
.size-selection {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.size-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.size-selector {
  padding: 10px 14px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--background-white);
  font-size: 14px;
  color: var(--text-primary);
  transition: var(--transition);
  cursor: pointer;
}

.size-selector:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(225, 113, 8, 0.1);
}

.out-of-stock {
  color: var(--error-color);
  font-weight: 600;
  padding: 10px;
  background: rgba(231, 76, 60, 0.1);
  border-radius: var(--border-radius-sm);
  text-align: center;
  font-size: 14px;
}

/* Quantity Section */
.quantity-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quantity-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0;
  width: fit-content;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

.quantity-btn {
  background: var(--background-light);
  border: none;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text-primary);
}

.quantity-btn:hover {
  background: var(--primary-color);
  color: white;
}

.quantity-input {
  border: none;
  width: 70px;
  height: 40px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--background-white);
}

.quantity-input:focus {
  outline: none;
}

.stock-info {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.add-to-cart-btn {
  flex: 1;
  background: linear-gradient(135deg, var(--success-color), #2ecc71);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.add-to-cart-btn:hover {
  background: linear-gradient(135deg, #229954, var(--success-color));
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.add-to-cart-btn:disabled,
.add-to-cart-btn.disabled {
  background: var(--text-light);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* No Products */
.no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  background: var(--background-white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.no-products-icon {
  font-size: 48px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.no-products h3 {
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.no-products p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 14px;
}

.browse-all-btn {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border-radius: var(--border-radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  font-size: 14px;
}

.browse-all-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--background-white);
  border-radius: var(--border-radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10000;
  min-width: 280px;
  animation: slideInRight 0.3s ease;
  font-size: 14px;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.notification-success {
  border-left: 4px solid var(--success-color);
}

.notification-error {
  border-left: 4px solid var(--error-color);
}

.notification-warning {
  border-left: 4px solid var(--warning-color);
}

.notification-info {
  border-left: 4px solid var(--accent-color);
}

.notification i {
  font-size: 16px;
}

.notification-success i {
  color: var(--success-color);
}

.notification-error i {
  color: var(--error-color);
}

.notification-warning i {
  color: var(--warning-color);
}

.notification-info i {
  color: var(--accent-color);
}

.notification-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  margin-left: auto;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.notification-close:hover {
  background: var(--background-light);
  color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .category-page {
    gap: 16px;
    padding: 16px 12px;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }
  
  .product-details-container {
    gap: 24px;
    padding: 20px;
  }

  .product-details-image {
    height: 350px;
  }
}

@media (max-width: 768px) {
  .search-bar-container {
    padding: 100px 12px 24px;
  }
  
  .search-btn span {
    display: none;
  }
  
  .search-btn {
    padding: 14px 16px;
  }
  
  .category-page {
    flex-direction: column;
    padding: 12px;
    gap: 16px;
  }

  .sidebar {
    position: static;
    flex: none;
    order: 1;
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .category-list {
    display: none;
  }

  .category-list.show {
    display: block;
    animation: slideDown 0.3s ease;
  }

  .main-content {
    order: 2;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .page-title {
    font-size: 20px;
  }

  /* Modal adjustments for mobile */
  .product-description-modal {
    width: 100%;
    height: 100%;
    max-height: 100%;
    top: 0;
    left: 0;
    transform: none;
    border-radius: 0;
  }

  .modal-content {
    border-radius: 0;
    height: 100%;
  }

  .product-details-container {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 16px;
    padding-top: 50px;
  }

  .product-images-section {
    flex-direction: column-reverse;
    gap: 12px;
  }

  .product-thumbnails {
    flex-direction: row;
    width: 100%;
    overflow-x: auto;
    padding: 4px 0;
  }

  .product-thumbnail {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    margin-right: 8px;
  }

  .product-details-image {
    height: 280px;
  }

  .product-title {
    font-size: 18px;
  }

  .product-price-large {
    font-size: 22px;
  }

  .action-buttons {
    flex-direction: column;
  }

  .notification {
    right: 8px;
    left: 8px;
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .search-bar-container {
    padding: 90px 8px 16px;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .product-info {
    padding: 12px;
  }

  .product-name {
    font-size: 13px;
  }

  .product-price {
    font-size: 16px;
  }

  .product-details-container {
    padding: 12px;
    padding-top: 45px;
  }

  .product-details-image {
    height: 240px;
  }

  .product-title {
    font-size: 16px;
  }

  .product-price-large {
    font-size: 20px;
  }

  .close-btn {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
  }

  .quantity-controls {
    width: 100%;
    justify-content: center;
  }

  .quantity-input {
    flex: 1;
    max-width: 60px;
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid var(--primary-color);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for better accessibility */
button:focus,
input:focus,
select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 15px rgba(0, 0, 0, 0.5);
  }
}