/**
 * Shop page – dedicated design only (keeps site colors/fonts)
 */

/* Layout */
.shop-page { padding: 3rem 0 4rem; }
.shop-page .container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

.shop-page .shop-page-head { text-align: center; margin-bottom: 2.5rem; }
.shop-page h1 { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; font-size: 2.5rem; font-weight: 400; color: var(--color-dark, #1a1a1a); margin: 0 0 20px 0; }
.shop-page .shop-page-head > p { color: #666; font-size: 1rem; max-width: 36ch; margin: 0 auto; }

/* Category tabs – pill style */
.shop-page .shop-tabs { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 2.5rem; flex-wrap: wrap; }
.shop-page .shop-tabs .tab {
  padding: 0.6rem 1.25rem;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-dark);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.shop-page .shop-tabs .tab:hover { border-color: var(--color-tan); background: white; }
.shop-page .shop-tabs .tab.active { background: var(--color-dark); color: white; border-color: var(--color-dark); }

/* Products grid – refined cards */
.shop-page .products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.75rem;
}
.shop-page .product-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,0,0,0.06);
}
.shop-page .product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.1);
}
.shop-page .product-card.hidden { display: none; }

.shop-page .product-card .product-image {
  aspect-ratio: 1;
  background: var(--color-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.shop-page .product-card .product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  transform-origin: center center;
}
.shop-page .product-card .product-image img.rotate-on-touch {
  cursor: pointer;
  touch-action: manipulation;
}
.shop-page .product-card .product-image img.rotate-on-touch.rotated {
  transform: rotate(10deg);
}
.shop-page .product-card .product-image .placeholder {
  font-size: 2.5rem;
  opacity: 0.35;
}

.shop-page .product-card .product-body,
.shop-page .product-card .product-card-info { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.shop-page .product-card h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--color-dark);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}
.shop-page .product-card .price {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}
.shop-page .product-card .btn-order {
  display: inline-block;
  width: 100%;
  padding: 0.75rem 1.25rem;
  background: var(--color-dark);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: auto;
}
.shop-page .product-card .btn-order:hover { background: #333; color: white; }

/* Order modal */
.shop-order-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.shop-order-overlay.is-open { opacity: 1; visibility: visible; }

.shop-order-modal {
  background: white;
  border-radius: 16px;
  padding: 1.75rem;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  transform: scale(0.96);
  transition: transform 0.2s;
}
.shop-order-overlay.is-open .shop-order-modal { transform: scale(1); }

.shop-order-modal h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  color: var(--color-dark);
}
.shop-order-modal .shop-order-product { font-size: 0.9rem; color: #666; margin-bottom: 1.25rem; }
.shop-order-modal .shop-order-options { display: flex; flex-direction: column; gap: 0.6rem; }
.shop-order-modal .shop-order-options a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--color-cream);
  border-radius: 10px;
  text-decoration: none;
  color: var(--color-dark);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.2s;
}
.shop-order-modal .shop-order-options a:hover { background: #e8e2db; }
.shop-order-modal .shop-order-options a .icon { font-size: 1.25rem; }
.shop-order-modal .shop-order-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: #666;
  padding: 0;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}
.shop-order-modal .shop-order-close:hover { background: var(--color-cream); color: var(--color-dark); }
.shop-order-modal { position: relative; }

/* Small screen: pull page up 3 cm, then push content 1 cm down from header */
@media (max-width: 1023px) {
  main.shop-page,
  .site-main.shop-page {
    padding-top: 1cm !important;
  }
}

@media (max-width: 600px) {
  .shop-page .products-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .shop-page h1 { font-size: 2rem; }
}

/* Small screen only: shop cards = Our Services style (one side photo, one side information) */
@media (max-width: 1023px) {
  .shop-page .product-card {
    flex-direction: row !important;
    align-items: stretch;
    gap: 16px;
    padding: 16px;
  }
  .shop-page .product-card .product-card-info {
    order: 1;
    flex: 1 1 55% !important;
    min-width: 0;
    padding: 0.5rem 0.5rem 0 0 !important;
    justify-content: center;
  }
  .shop-page .product-card .product-card-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
  }
  .shop-page .product-card .product-card-info .price {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
  }
  .shop-page .product-card .product-card-info .btn-order {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
  .shop-page .product-card .product-image {
    order: 2;
    flex: 0 0 45% !important;
    aspect-ratio: auto !important;
    min-height: 120px;
    border-radius: 12px;
    overflow: hidden;
  }
  .shop-page .product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 120px;
  }
  .shop-page .product-card .product-description-content {
    order: 3;
  }
}

/* Product image clickable for details popup */
.shop-page .product-image.js-product-image-click {
  cursor: pointer;
}

/* Product details popup (chat-style) */
.shop-product-popup {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  pointer-events: none;
}
.shop-product-popup[hidden] { display: none; }
.shop-product-popup:not([hidden]) { pointer-events: auto; }

.shop-product-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}

.shop-product-popup-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 70vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: shop-popup-slide 0.25s ease;
}
@keyframes shop-popup-slide {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.shop-product-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  flex-shrink: 0;
}
.shop-product-popup-title {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-dark, #1a1a1a);
}
.shop-product-popup-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: #666;
  padding: 0;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.shop-product-popup-close:hover {
  background: var(--color-cream, #f5f0eb);
  color: var(--color-dark);
}

.shop-product-popup-body {
  padding: 1.25rem;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #444;
}
.shop-product-popup-body p:first-child { margin-top: 0; }
.shop-product-popup-body p:last-child { margin-bottom: 0; }

@media (min-width: 768px) {
  .shop-product-popup { align-items: center; padding: 1rem; }
  .shop-product-popup-box {
    border-radius: 16px;
    max-height: 80vh;
  }
}
