/* ═══════════════════════════════════════════════
   MasterKatoni — Shop Page & Product Card Styles
   v1.4
   ═══════════════════════════════════════════════ */

/* ── SHOP HERO HEADER ──────────────────────────── */
.mk-shop-hero {
  background: linear-gradient(135deg, #ee2b2b 0%, #ff7272 60%, #ffb3b3 100%);
  border-radius: 28px;
  padding: 36px 44px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 24px 64px rgba(238, 43, 43, 0.26);
  position: relative;
  overflow: hidden;
}
.mk-shop-hero::before {
  content: "";
  position: absolute;
  left: -60px; top: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
}
.mk-shop-hero::after {
  content: "";
  position: absolute;
  right: 90px; bottom: -80px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  pointer-events: none;
}
.mk-shop-hero-text { position: relative; z-index: 1; }
.mk-shop-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.mk-shop-hero h1 {
  color: #fff;
  font-size: clamp(1.5rem, 2.8vw, 2.3rem);
  font-weight: 900;
  margin: 0 0 10px;
  line-height: 1.2;
}
.mk-shop-hero-sub {
  color: rgba(255,255,255,0.84);
  font-size: 0.96rem;
  margin: 0;
  max-width: 360px;
}
.mk-shop-hero-icon {
  position: relative; z-index: 1;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.3rem;
  color: #fff;
  flex-shrink: 0;
}

/* ── ORDERING / TOOLBAR ────────────────────────── */
.woocommerce-notices-wrapper { margin-bottom: 0; }

form.woocommerce-ordering {
  float: none;
  margin: 0 0 22px;
}
form.woocommerce-ordering .orderby {
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff5f4;
  border: 1.5px solid rgba(238,43,43,0.18);
  border-radius: 999px;
  padding: 10px 16px 10px 42px;
  font-family: inherit;
  font-size: 0.93rem;
  color: #2c3f5d;
  font-weight: 600;
  min-width: 210px;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ee2b2b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  background-size: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
form.woocommerce-ordering .orderby:focus {
  border-color: rgba(238,43,43,0.45);
  box-shadow: 0 0 0 3px rgba(238,43,43,0.08);
}

/* ── PRODUCT GRID ──────────────────────────────── */
.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.woocommerce ul.products::before,
.woocommerce ul.products::after { display: none; }

.woocommerce ul.products li.product {
  margin: 0; padding: 0;
  border: 0; background: none;
  box-shadow: none;
  position: relative;
  overflow: visible;
  float: none; width: auto;
}
.woocommerce ul.products li.product:hover {
  transform: none;
  box-shadow: none;
}

/* ── PRODUCT CARD ──────────────────────────────── */
.product-archive-container {
  position: relative;
  filter: drop-shadow(0px 2px 14px rgba(203,213,230,0.5));
  transition: filter 0.35s ease, transform 0.35s ease;
  margin-top: 8px;
  overflow: visible;
  background: none;
}
.product-archive-container:hover {
  filter: drop-shadow(0px 6px 28px rgba(238,43,43,0.22));
  transform: translateY(-5px);
}

/* Shadow blob */
.product-archive-container::before {
  content: "";
  position: absolute;
  bottom: 6px; left: 50%;
  width: 88px; height: 88px;
  transform: translateX(-50%);
  background: #efeff3;
  border-radius: 50%;
  z-index: -1;
  transition: background 0.35s ease, width 0.35s ease;
}
.product-archive-container:hover::before {
  background: #ffe0e4;
  width: 108px;
}

/* Rising arc */
.product-archive-container::after {
  content: "";
  position: absolute;
  bottom: 44%; left: 50%;
  width: 90px; height: 90px;
  transform: translateX(-50%);
  border-bottom: 1.5px solid #ea2340;
  border-radius: 50px;
  z-index: -2;
  opacity: 0;
  transition: bottom 0.38s ease, opacity 0.2s ease;
}
.product-archive-container:hover::after {
  bottom: 0;
  opacity: 1;
}

/* Card shape (mask-cut bottom) */
.product-archive-container .shape {
  --r: 32px; --s: 76px; --a: 60deg;
  background: #fff;
  border-radius: var(--r);
  --_m: 100% / calc(2 * var(--r)) var(--r) no-repeat radial-gradient(50% 100% at top, #000 calc(100% - 1px), #0000);
  --_d: (var(--s) + var(--r)) * cos(var(--a));
  -webkit-mask:
    calc(50% + var(--_d)) var(--_m),
    calc(50% - var(--_d)) var(--_m),
    radial-gradient(var(--s) at 50% calc(100% + sin(var(--a)) * var(--s)), #0000 100%, #000 calc(100% + 1px)) 0 calc(var(--r) * (sin(var(--a)) - 1)) no-repeat,
    linear-gradient(90deg, #000 calc(50% - var(--_d)), #0000 0 calc(50% + var(--_d)), #000 0);
  mask:
    calc(50% + var(--_d)) var(--_m),
    calc(50% - var(--_d)) var(--_m),
    radial-gradient(var(--s) at 50% calc(100% + sin(var(--a)) * var(--s)), #0000 100%, #000 calc(100% + 1px)) 0 calc(var(--r) * (sin(var(--a)) - 1)) no-repeat,
    linear-gradient(90deg, #000 calc(50% - var(--_d)), #0000 0 calc(50% + var(--_d)), #000 0);
  width: 100%; height: 100%;
  position: relative;
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 30px 18px 24px;
  gap: 12px;
}

/* Wishlist */
.product-archive-container .herman-wishlist {
  position: absolute;
  top: 16px; right: 16px;
  width: 30px; height: 30px;
  border: 0;
  background: rgba(255,255,255,0.65);
  padding: 4px;
  border-radius: 50%;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  cursor: pointer;
  z-index: 2;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.product-archive-container .herman-wishlist:hover {
  background: #fff;
  transform: scale(1.12);
}
.product-archive-container .herman-wishlist svg {
  display: block;
  width: 16px; height: 16px;
}
.wishlist-heart path {
  transition: stroke 0.2s, fill 0.2s;
}
.product-archive-container .herman-wishlist:hover .wishlist-heart path,
.product-archive-container .herman-wishlist.active .wishlist-heart path {
  stroke: #ea2340;
  fill: #ea2340;
}

/* Thumbnail */
.product-thumbnail {
  position: relative;
  height: 128px;
  display: flex;
  align-items: center; justify-content: center;
  margin: 0 auto;
}
.product-thumbnail > svg {
  position: absolute;
  width: 100%; height: 100%;
  opacity: 0.65;
}
.product-thumbnail img {
  position: relative; z-index: 1;
  width: 138px; height: 138px;
  object-fit: contain;
  transition: transform 0.35s ease;
}
.product-archive-container:hover .product-thumbnail img {
  transform: scale(1.08) translateY(-4px);
}

/* Title */
.product-archive-container .shape .title {
  display: block;
  color: #2c3f5d;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
  text-decoration: none;
  margin: 0;
  transition: color 0.2s;
}
.product-archive-container:hover .shape .title { color: #ea2340; }

/* Price row */
.product-archive-container .shape .product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.product-archive-container .shape .product-bottom .price {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.product-archive-container .shape .product-bottom .old-price {
  color: #b0bdd0;
  font-size: 12px;
  font-weight: 400;
  text-decoration: line-through;
}
.product-archive-container .shape .product-bottom .new-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: #1e2d46;
  font-size: 15px;
  font-weight: 700;
}
.product-archive-container .shape .product-bottom .new-price label {
  color: #9ba8bd;
  font-size: 12px;
  font-weight: 400;
  cursor: default;
}

/* Add-to-cart button */
.product-archive-container .shape .product-bottom .add-to-cart a {
  display: flex;
  align-items: center; justify-content: center;
  border-radius: 50%;
  background: #dde4ef;
  width: 42px; height: 42px;
  flex-shrink: 0;
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}
.product-archive-container:hover .shape .product-bottom .add-to-cart a {
  background: #ea2340;
  box-shadow: 0 0 0 6px rgba(234,35,64,0.12), 0 4px 16px rgba(234,35,64,0.38);
  transform: scale(1.07);
}

/* Currency symbol — hide the $ */
.woocommerce-Price-currencySymbol { display: none !important; }

/* Currency: label in PHP template outputs تومان directly */

/* ── PAGINATION ─────────────────────────────────── */
.woocommerce-pagination {
  margin: 40px 0 8px;
  display: flex;
  justify-content: center;
}
.woocommerce-pagination ul.page-numbers {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding: 10px 18px;
  margin: 0;
  background: #fff;
  border-radius: 999px;
  border: 1px solid rgba(27,27,34,0.08);
  box-shadow: 0 10px 28px rgba(27,27,34,0.07);
}
.woocommerce-pagination ul.page-numbers li { display: flex; }
.woocommerce-pagination ul.page-numbers .page-numbers {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  background: transparent;
  color: #2c3f5d;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.93rem;
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 0 6px;
}
.woocommerce-pagination ul.page-numbers .page-numbers:hover {
  background: #fff5f4;
  border-color: rgba(238,43,43,0.3);
  color: #ea2340;
}
.woocommerce-pagination ul.page-numbers .page-numbers.current {
  background: #ee2b2b;
  border-color: #ee2b2b;
  color: #fff;
  box-shadow: 0 4px 14px rgba(238,43,43,0.38);
}
.woocommerce-pagination ul.page-numbers .next,
.woocommerce-pagination ul.page-numbers .prev {
  min-width: 38px;
  background: #f7f8fa;
}

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 1100px) {
  .woocommerce ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-shop-hero { padding: 26px 28px; }
  .mk-shop-hero h1 { font-size: 1.5rem; }
  .mk-shop-hero-icon { width: 60px; height: 60px; font-size: 1.7rem; }
}

@media (max-width: 560px) {
  .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mk-shop-hero { padding: 22px 18px; border-radius: 20px; }
  .mk-shop-hero-icon { display: none; }
  .product-archive-container .shape { padding: 22px 12px 18px; --r: 24px; --s: 58px; }
  .product-thumbnail { height: 100px; }
  .product-thumbnail img { width: 106px; height: 106px; }
  .product-archive-container .shape .title { font-size: 12.5px; }
  .product-archive-container .shape .product-bottom .new-price { font-size: 13px; }
  .product-archive-container .shape .product-bottom .add-to-cart a { width: 34px; height: 34px; }
  .woocommerce-pagination ul.page-numbers .page-numbers { min-width: 34px; height: 34px; font-size: 0.85rem; }
}
