/* ==========================================================================
   Milano Chocolate — Shop Page Stylesheet (Cream Theme)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Shop Page — base layout
   -------------------------------------------------------------------------- */

.woocommerce-shop {
  background-color: #FAF6F0;
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   2. Shop Header
   -------------------------------------------------------------------------- */

.milano-shop-header {
  padding: 60px 20px 40px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.milano-shop-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: #2C1810;
  margin: 0 0 12px;
  line-height: 1.2;
}

.milano-shop-subtitle {
  font-size: 1.05rem;
  color: #7A6A5A;
  margin: 0;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   3. Filter Bar
   -------------------------------------------------------------------------- */

.milano-filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto 36px;
  padding: 0 20px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #FFFFFF;
  border: 1px solid #E8DFD2;
  color: #7A6A5A;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 20px;
  padding: 8px 20px;
  cursor: pointer;
  transition: border-color 0.25s ease,
              background-color 0.25s ease,
              color 0.25s ease;
  white-space: nowrap;
  user-select: none;
}

.filter-pill:hover {
  border-color: #D4A574;
  color: #5A4A3A;
}

.filter-pill:focus-visible {
  outline: 2px solid #D4A574;
  outline-offset: 2px;
}

.filter-pill.active {
  background-color: #2C1810;
  border-color: #2C1810;
  color: #FAF6F0;
}

.filter-pill.active:hover {
  background-color: #3D261C;
}

/* --------------------------------------------------------------------------
   4. Product Grid
   -------------------------------------------------------------------------- */

.milano-shop-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 60px;
  transition: opacity 0.3s ease;
}

/* --------------------------------------------------------------------------
   5. Product Card
   -------------------------------------------------------------------------- */

.milano-shop-card {
  display: flex;
  flex-direction: column;
  background-color: #FFFFFF;
  border: 1px solid #E8DFD2;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease,
              box-shadow 0.3s ease;
}

.milano-shop-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(44, 24, 16, 0.08);
}

/* --- Card Image --- */

.card-image-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.milano-shop-card:hover .card-image-wrap img {
  transform: scale(1.05);
}

/* --- Card Image Overlay --- */

.card-image-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(250, 246, 240, 0.75) 0%,
    rgba(212, 165, 116, 0.45) 100%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.milano-shop-card:hover .card-image-overlay {
  opacity: 1;
  pointer-events: auto;
}

.card-image-overlay a,
.card-image-overlay button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background-color: #2C1810;
  color: #FAF6F0;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.25s ease;
}

.card-image-overlay a:hover,
.card-image-overlay button:hover {
  background-color: #3D261C;
}

/* --- Sale Badge --- */

.sale-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: #8B6914;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
}

/* RTL: mirror sale badge */
[dir="rtl"] .sale-badge {
  right: auto;
  left: 12px;
}

/* --- Card Body --- */

.card-body {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #A89882;
  margin: 0 0 6px;
}

.card-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2C1810;
  margin: 0 0 8px;
  line-height: 1.35;
}

.card-title a {
  color: inherit;
  text-decoration: none;
}

.card-title a:hover {
  color: #8B6914;
}

.card-price {
  color: #8B6914;
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 16px;
}

.card-price del {
  color: #B0A090;
  font-weight: 400;
  font-size: 0.85rem;
  margin-right: 6px;
}

[dir="rtl"] .card-price del {
  margin-right: 0;
  margin-left: 6px;
}

.card-price ins {
  text-decoration: none;
}

/* --- Add to Cart Button --- */

.card-add-to-cart {
  margin-top: auto;
}

.card-add-to-cart a,
.card-add-to-cart button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background-color: #2C1810;
  color: #FAF6F0;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s ease;
}

.card-add-to-cart a:hover,
.card-add-to-cart button:hover {
  background-color: #47342A;
}

.card-add-to-cart a:focus-visible,
.card-add-to-cart button:focus-visible {
  outline: 2px solid #D4A574;
  outline-offset: 2px;
}

/* Added-to-cart feedback */
.card-add-to-cart .added_to_cart {
  display: block;
  text-align: center;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #8B6914;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   6. Pagination
   -------------------------------------------------------------------------- */

.milano-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 20px 60px;
}

.milano-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 4px 12px;
  background-color: #FFFFFF;
  color: #2C1810;
  border: 1px solid #E8DFD2;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.25s ease,
              background-color 0.25s ease,
              color 0.25s ease;
}

.milano-pagination .page-numbers:hover {
  border-color: #D4A574;
  color: #8B6914;
}

.milano-pagination .page-numbers.current {
  background-color: #2C1810;
  border-color: #2C1810;
  color: #FAF6F0;
}

.milano-pagination .page-numbers.dots {
  border: none;
  background: transparent;
  pointer-events: none;
}

.milano-pagination .page-numbers.prev,
.milano-pagination .page-numbers.next {
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   7. No Products Message
   -------------------------------------------------------------------------- */

.milano-no-products {
  background-color: #FFFFFF;
  border: 1px solid #E8DFD2;
  border-radius: 12px;
  text-align: center;
  padding: 60px 30px;
  max-width: 600px;
  margin: 40px auto;
}

.milano-no-products .no-products-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.milano-no-products h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.4rem;
  color: #2C1810;
  margin: 0 0 8px;
}

.milano-no-products p {
  color: #7A6A5A;
  font-size: 0.95rem;
  margin: 0;
}

/* --------------------------------------------------------------------------
   8. Responsive — Breakpoints
   -------------------------------------------------------------------------- */

/* Tablet landscape and below */
@media (max-width: 1200px) {
  .milano-shop-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet portrait */
@media (max-width: 768px) {
  .milano-shop-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .milano-shop-header {
    padding: 40px 16px 28px;
  }

  .milano-shop-title {
    font-size: 2.2rem;
  }

  .milano-filter-bar {
    gap: 8px;
    margin-bottom: 28px;
  }

  .filter-pill {
    padding: 6px 16px;
    font-size: 0.85rem;
  }
}

/* Mobile */
@media (max-width: 576px) {
  .milano-shop-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 16px 40px;
  }

  .milano-shop-header {
    padding: 32px 16px 20px;
  }

  .milano-shop-title {
    font-size: 1.8rem;
  }

  .milano-shop-subtitle {
    font-size: 0.95rem;
  }

  /* Horizontal scroll filter pills on mobile */
  .milano-filter-bar {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 16px;
    margin-bottom: 24px;
    gap: 8px;
  }

  .milano-filter-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-pill {
    flex-shrink: 0;
  }

  .card-image-wrap {
    aspect-ratio: 16 / 10;
  }

  .milano-pagination {
    padding: 16px 16px 40px;
  }

  .milano-pagination .page-numbers {
    min-width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }
}

/* --------------------------------------------------------------------------
   9. RTL Support
   -------------------------------------------------------------------------- */

[dir="rtl"] .milano-filter-bar {
  direction: rtl;
}

[dir="rtl"] .card-body {
  text-align: right;
}

[dir="rtl"] .card-add-to-cart a,
[dir="rtl"] .card-add-to-cart button {
  text-align: center;
}

[dir="rtl"] .milano-pagination {
  direction: rtl;
}

[dir="rtl"] .milano-pagination .page-numbers.prev::before {
  content: '\203A'; /* right single angle quotation */
}

[dir="rtl"] .milano-pagination .page-numbers.next::after {
  content: '\2039'; /* left single angle quotation */
}

/* RTL: horizontal scroll starts from right */
[dir="rtl"] .milano-filter-bar {
  justify-content: flex-end;
}

@media (max-width: 576px) {
  [dir="rtl"] .milano-filter-bar {
    justify-content: flex-start;
    direction: rtl;
  }
}
