/* Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #f8f6f0;
  color: #3f3e2c;
  font-family: Tajawal, Segoe UI, Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
}

/* Announcements */
#announcements-container {
  height: 45px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.instagram-announcement {
  left: 20px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

.announcement-slide {
  font-size: 14px;
  left: 0;
  line-height: 1.5;
  opacity: 0;
  padding: 12px 20px;
  pointer-events: none;
  position: absolute;
  right: 0;
  text-align: center;
  top: 0;
  transition: opacity 1s ease-in-out, background-color 1s ease-in-out;
}

.announcement-slide.active {
  opacity: 1;
  pointer-events: auto;
}

/* Header */
.header {
  padding: 30px 0 40px 0;
  text-align: center;
}

.header-content {
  margin: 0 auto;
  max-width: 1400px;
  padding: 0 20px;
  align-items: center;
  display: flex;
  justify-content: space-between;
  position: relative;
}

.instagram-link {
  align-items: center;
  display: flex;
  justify-content: center;
  height: 22px;
  text-decoration: none;
  transition: all 0.3s;
  width: 22px;
}

.instagram-link svg {
  fill: #E4405F;
  height: 100%;
  width: 100%;
}

.instagram-announcement.has-announcements .instagram-link svg {
  fill: #fff;
}

.instagram-link:hover svg {
  fill: #e4405f;
}

.logo {
  align-items: center;
  color: #556b2f;
  display: flex;
  font-family: Noto Nastaliq Urdu, serif;
  font-size: 28px;
  font-weight: 500;
  gap: 8px;
  text-decoration: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  line-height: 1;
  padding: 0;
  margin: 0 0 20px 0;
}

.logo-icon {
  font-family: Tajawal, sans-serif;
  font-size: 24px;
}

/* Cart Icon */
.cart-icon-wrapper {
  cursor: pointer;
  transition: transform 0.3s;
  display: flex;
  align-items: center;
  position: absolute;
  right: 20px;
  z-index: 10;
}

.cart-icon-wrapper:hover {
  transform: scale(1.1);
}

.cart-icon {
  fill: #556b2f;
  height: 28px;
  width: 28px;
}

.cart-badge {
  align-items: center;
  background: #dc3545;
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-size: 11px;
  font-weight: 700;
  height: 20px;
  justify-content: center;
  left: -8px;
  position: absolute;
  top: -8px;
  width: 20px;
}

.cart-badge.hidden {
  display: none;
}

/* Track Order Link */
.track-order-link {
  align-items: center;
  background: rgba(85, 107, 47, 0.1);
  border-radius: 8px;
  color: #556b2f;
  display: flex;
  font-size: 14px;
  font-weight: 600;
  gap: 6px;
  left: 20px;
  padding: 8px 12px;
  position: absolute;
  text-decoration: none;
  transition: all 0.3s;
}

.track-order-link:hover {
  background: #556b2f;
  color: #fff;
  transform: translateY(-2px);
}

/* Cart Sidebar */
.cart-sidebar {
  background: #fff;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  right: -400px;
  top: 0;
  transition: right 0.3s ease;
  width: 400px;
  z-index: 1000;
}

.cart-sidebar.open {
  right: 0;
}

.cart-overlay {
  background: rgba(0, 0, 0, 0.5);
  bottom: 0;
  left: 0;
  opacity: 0;
  position: fixed;
  right: 0;
  top: 0;
  transition: opacity 0.3s, visibility 0.3s;
  visibility: hidden;
  z-index: 999;
}

.cart-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.cart-header {
  align-items: center;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  padding: 20px;
  position: relative;
}

.cart-title {
  color: #3f3e2c;
  font-size: 20px;
  font-weight: 600;
}

.cart-close {
  align-items: center;
  background: #f5f5f5;
  border-radius: 50%;
  color: #333;
  cursor: pointer;
  display: flex;
  font-size: 32px;
  font-weight: 300;
  height: 40px;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s;
  width: 40px;
}

.cart-close:hover {
  background: #e0e0e0;
  color: #000;
}

/* Cart Items */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart-item {
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  gap: 15px;
  padding: 15px 0;
}

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

.cart-item-image {
  background: #f8f6f0;
  border-radius: 8px;
  height: 80px;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  width: 80px;
}

.cart-item-image.loaded {
  opacity: 1;
}

.cart-item-details {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
}

.cart-item-name {
  color: #3f3e2c;
  font-size: 14px;
  font-weight: 600;
}

.cart-item-size {
  color: #666;
  font-size: 12px;
}

.cart-item-price {
  color: #556b2f;
  font-size: 14px;
  font-weight: 600;
}

.cart-item-actions {
  gap: 10px;
  margin-top: 5px;
  align-items: center;
  display: flex;
}

.qty-btn {
  align-items: center;
  display: flex;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  color: #333;
  cursor: pointer;
  font-size: 16px;
  height: 24px;
  justify-content: center;
  transition: all 0.3s;
  width: 24px;
}

.qty-btn:hover {
  background: #f8f6f0;
  border-color: #8b7355;
}

.qty-btn:active {
  background: #f5f5f5;
}

.qty-value {
  font-size: 14px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.remove-btn {
  border-radius: 4px;
  color: #dc3545;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  margin-right: auto;
  padding: 4px 8px;
  text-decoration: underline;
  transition: background 0.3s;
}

.remove-btn:hover {
  background: #fee;
}

.cart-empty {
  color: #666;
  padding: 60px 20px;
  text-align: center;
}

.cart-empty-icon {
  font-size: 64px;
  margin-bottom: 15px;
  opacity: 0.3;
}

.cart-footer {
  background: #f8f6f0;
  border-top: 1px solid #e0e0e0;
  padding: 20px;
}

/* Size Modal */
.size-modal-overlay {
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  bottom: 0;
  display: none;
  justify-content: center;
  left: 0;
  opacity: 0;
  position: fixed;
  right: 0;
  top: 0;
  transition: opacity 0.3s;
  z-index: 2000;
}

.size-modal-overlay.visible {
  display: flex;
  opacity: 1;
}

.size-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-height: 80vh;
  max-width: 500px;
  overflow-y: auto;
  padding: 24px;
  transform: scale(0.9);
  transition: transform 0.3s;
  width: 90%;
}

.size-modal-overlay.visible .size-modal {
  transform: scale(1);
}

.size-modal-header {
  align-items: center;
  border-bottom: 2px solid #8b7355;
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 15px;
}

.size-modal-title {
  color: #556b2f;
  font-size: 20px;
  font-weight: 700;
}

.size-modal-close {
  align-items: center;
  background: none;
  border: none;
  border-radius: 50%;
  color: #999;
  cursor: pointer;
  display: flex;
  font-size: 28px;
  height: 32px;
  justify-content: center;
  transition: all 0.3s;
  width: 32px;
}

.size-modal-close:hover {
  background: #f0f0f0;
  color: #333;
}

.size-option {
  align-items: center;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 16px;
  transition: all 0.3s;
}

.size-option:hover {
  background: #f8f6f0;
  border-color: #8b7355;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.size-option-info {
  flex: 1;
}

.size-option-name {
  color: #556b2f;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.size-option-dimensions {
  color: #666;
  font-size: 13px;
  margin-bottom: 6px;
}

.size-option-price {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.size-option-price-original {
  color: #999;
  font-size: 14px;
  text-decoration: line-through;
}

.size-option-price-final {
  color: #8b7355;
  font-size: 20px;
  font-weight: 700;
}

.size-option-discount-tag {
  background: #dc3545;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
}

/* Cart Subtotal and Checkout */
.cart-subtotal {
  display: flex;
  font-size: 16px;
  justify-content: space-between;
  margin-bottom: 15px;
}

.cart-subtotal-label {
  color: #666;
  font-weight: 500;
}

.cart-subtotal-value {
  color: #556b2f;
  font-size: 18px;
  font-weight: 700;
}

.checkout-btn {
  background: #8b7355;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 15px;
  transition: all 0.3s;
  width: 100%;
}

.checkout-btn:hover {
  background: #6d5942;
  box-shadow: 0 4px 12px rgba(139, 115, 85, 0.3);
  transform: translateY(-2px);
}

/* Filter Bar */
.filter-bar {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 20px 0;
  margin-top: 15px;
}

.filter-content {
  margin: 0 auto;
  max-width: 1400px;
  padding: 0 20px;
}

.filter-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 15px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.filter-tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.filter-tab {
  border: 2px solid transparent;
  border-radius: 25px;
  color: #3f3e2c;
  cursor: pointer;
  font-family: Tajawal, Segoe UI, Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 500;
  padding: 10px 20px;
  transition: all 0.3s;
  background: #f8f6f0;
  flex-shrink: 0;
  white-space: nowrap;
}

.filter-tab:hover {
  background: #f8f6f0;
}

.filter-tab.active {
  background: #8b7355;
  border-color: #8b7355;
  color: #fff;
}

.results-info {
  color: #666;
  font-size: 14px;
  margin-top: 10px;
}

/* Container */
.container {
  margin: 40px auto;
  max-width: 1400px;
  padding: 0 20px;
}

/* Loading State */
.loading {
  color: #666;
  font-size: 18px;
  padding: 60px 20px;
  text-align: center;
}

.loading-spinner {
  animation: spin 1s linear infinite;
  border: 4px solid #f3f3f3;
  border-radius: 50%;
  border-top-color: #8b7355;
  height: 50px;
  margin: 20px auto;
  width: 50px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(1turn);
  }
}

/* Products Grid */
.products-grid {
  display: grid;
  gap: 30px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Product Card */
.product-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.product-image {
  background: #f8f6f0;
  height: 250px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.image-add-cart-btn {
  align-items: center;
  background: #8b7355;
  border: 2px solid #fff;
  border-radius: 50%;
  bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 20px;
  font-weight: 300;
  height: 36px;
  justify-content: center;
  position: absolute;
  right: 10px;
  transition: all 0.3s ease;
  width: 36px;
  z-index: 10;
}

.image-add-cart-btn:hover {
  background: #6d5942;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: scale(1.1);
}

.image-add-cart-btn:active {
  transform: scale(0.95);
}

.image-carousel {
  display: flex;
  height: 100%;
  position: relative;
  transition: transform 0.3s ease;
  width: 100%;
}

.carousel-image {
  background: #f8f6f0;
  display: block;
  flex-shrink: 0;
  height: 100%;
  min-width: 100%;
  object-fit: cover;
  width: 100%;
}

.carousel-arrow {
  display: none;
}

.page-dots {
  bottom: 10px;
  display: none;
  gap: 6px;
  left: 10px;
  position: absolute;
  z-index: 2;
}

.page-dot {
  background: hsla(0, 0%, 100%, 0.5);
  border-radius: 50%;
  height: 6px;
  transition: all 0.3s;
  width: 6px;
}

.page-dot.active {
  background: #fff;
  border-radius: 3px;
  width: 20px;
}

.discount-badge {
  background: #C9493B;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  left: -28px;
  padding: 6px 0;
  position: absolute;
  text-align: center;
  top: 10px;
  transform: rotate(-45deg);
  transform-origin: center;
  width: 100px;
  z-index: 3;
}

.product-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px;
}

.product-name {
  color: #1a2721;
  font-size: 21.6px;
  margin-bottom: 8px;
  min-height: auto;
}

.price-badge,
.product-name {
  font-weight: 600;
  line-height: 1.2;
}

.price-badge {
  display: inline-block;
  font-size: 16.8px;
  margin-top: 8px;
  padding: 6px 12px;
}

.catalog-add-cart-btn {
  display: none;
}

.size-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  margin-top: 0;
}

.size-badge {
  background: #F8F6F0;
  border-radius: 12px;
  color: #8A7255;
  font-size: 16.8px;
  font-weight: 500;
  line-height: 1.2;
  padding: 6px 14px;
}

/* Product Price */
.product-price {
  border-top: 1px solid #e0e0e0;
  margin-top: 15px;
  padding-top: 15px;
}

.price-label {
  color: #666;
  font-size: 12px;
  margin-bottom: 5px;
}

.price-value {
  color: #8b7355;
  font-size: 24px;
  font-weight: 700;
}

.price-currency {
  font-size: 16px;
  font-weight: 400;
  margin-right: 5px;
}

.size-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  margin-top: 0;
}

.size-badge {
  background: #F8F6F0;
  border-radius: 12px;
  color: #8A7255;
  font-size: 16.8px;
  font-weight: 500;
  line-height: 1.2;
  padding: 6px 14px;
}

/* Empty State */
.empty-state {
  color: #666;
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-text {
  font-size: 18px;
  margin-bottom: 10px;
}

/* Footer */
.footer {
  background: #3f3e2c;
  color: #fff;
  margin-top: 60px;
  padding: 30px 20px;
  text-align: center;
}

.footer-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

/* Media Queries - Tablet */
@media (max-width: 768px) {
  .cart-sidebar {
    right: -80%;
    width: 80%;
  }

  .cart-sidebar.open {
    right: 0;
  }

  .cart-close {
    font-size: 36px;
    height: 44px;
    width: 44px;
  }

  .cart-header {
    padding: 16px 20px;
  }

  .size-modal {
    padding: 20px;
    width: 95%;
  }

  .size-modal-title {
    font-size: 18px;
  }

  .size-option {
    padding: 12px;
  }

  .size-option-name {
    font-size: 16px;
  }

  .size-option-price-final {
    font-size: 18px;
  }

  .products-grid {
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .product-image {
    height: 250px;
  }

  .filter-tabs {
    gap: 8px;
  }

  .filter-tab {
    font-size: 14px;
    padding: 8px 16px;
  }
}

/* Media Queries - Mobile */
@media (max-width: 480px) {
  .products-grid {
    gap: 12px;
    grid-template-columns: repeat(2, 1fr);
  }

  .product-image {
    height: 200px;
  }

  .product-info {
    padding: 12px;
  }

  .product-name {
    font-size: 16px;
    margin-bottom: 6px;
    min-height: auto;
  }

  .product-detail-tag {
    font-size: 11px;
    padding: 3px 8px;
  }

  .price-value {
    font-size: 18px;
  }

  .price-badge,
  .size-badge {
    font-size: 13px;
    padding: 5px 10px;
  }

  .product-price {
    margin-top: 10px;
    padding-top: 10px;
  }

  .header-content {
    flex-direction: column;
    gap: 10px;
  }
}