/* ============================================================
   MAGICKAL SPOT — SHOP + PRODUCT CATEGORIES
   Hero (parts/shop-hero.html), wide grid, site product cards.
   ============================================================ */
body.ms-theme {
  --s-p:#3D2A5C; --s-g:#A9812F; --s-lav:#9B7CC0; --s-ink:#241C36;
  --s-paper:#FDFCF8; --s-sand:#F4F0E6; --s-line:#E7E1D4; --s-mist:#736A85;
}
body.woocommerce.archive { background: var(--s-paper); }

/* --- hero --- */
.ms-home .ms-shop-hero { min-height: 46vh; padding: 160px 0 96px; }
.ms-home .ms-shop-hero .ms-wiki-hero-lead { margin-bottom: 30px; }
.ms-shop-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 860px; margin: 0 auto; }
.ms-shop-cats a {
  display: inline-flex; align-items: center; padding: 10px 20px; border-radius: 999px; text-decoration: none;
  font: 700 13px/1.2 'Mulish', sans-serif; letter-spacing: .06em; text-transform: uppercase;
  color: #FDFCF8; background: rgba(253,252,248,.08); border: 1px solid rgba(253,252,248,.28);
  backdrop-filter: blur(4px); transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.ms-shop-cats a:hover { border-color: #EAD5A8; color: #EAD5A8; }
.ms-shop-cats a.is-on {
  background: linear-gradient(135deg, #F2D390, #DFA355 45%, #C07A2E); border-color: transparent; color: #FDFCF8;
  text-shadow: 0 1px 6px rgba(60,42,10,.35); box-shadow: 0 0 22px rgba(227,199,126,.4);
}

/* --- page frame: drop GeneratePress' narrow box and sidebar --- */
body.woocommerce.archive.ms-theme .site-content { display: block; }
body.woocommerce.archive.ms-theme .content-area,
body.woocommerce.archive.ms-theme .site-main { width: 100% !important; max-width: none !important; float: none; margin: 0 !important; padding: 0 !important; }
body.woocommerce.archive.ms-theme .is-right-sidebar,
body.woocommerce.archive.ms-theme .is-left-sidebar,
body.woocommerce.archive.ms-theme #right-sidebar,
body.woocommerce.archive.ms-theme #left-sidebar,
body.woocommerce.archive.ms-theme .widget-area.sidebar { display: none !important; }
body.woocommerce.archive.ms-theme .site-main > article,
body.woocommerce.archive.ms-theme .woocommerce-archive-wrapper,
body.woocommerce.archive.ms-theme .inside-article,
body.woocommerce.archive.ms-theme .entry-content { max-width: none !important; margin: 0 !important; padding: 0 !important; background: transparent !important; box-shadow: none !important; border: 0 !important; }
body.woocommerce.archive.ms-theme .site.grid-container,
body.woocommerce.archive.ms-theme .site-content.grid-container,
body.woocommerce.archive.ms-theme .container.grid-container { max-width: none !important; }
body.woocommerce.archive.ms-theme .woocommerce-products-header { display: none; }

/* --- the wide column --- */
.ms-shop-main {
  max-width: 1280px; margin: 0 auto; box-sizing: border-box;
  padding: clamp(36px, 6vw, 72px) clamp(16px, 4vw, 40px) clamp(24px, 4vw, 40px);
  font-family: 'Mulish', sans-serif; color: var(--s-ink);
}
.ms-shop-main .woocommerce-notices-wrapper:empty { display: none; }

/* toolbar: count left, sorting right */
.ms-shop-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 0 0 clamp(20px, 3vw, 32px); }
.ms-shop-bar::before, .ms-shop-bar::after { display: none !important; }
.ms-shop-bar .woocommerce-notices-wrapper { flex: 1 1 100%; }
.ms-shop-bar .woocommerce-result-count { float: none !important; margin: 0 !important; font-size: 14px; color: var(--s-mist); letter-spacing: .02em; }
.ms-shop-bar .woocommerce-ordering { float: none !important; margin: 0 !important; }
.ms-shop-bar .woocommerce-ordering select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  border: 1px solid var(--s-line); border-radius: 999px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23A9812F' stroke-width='1.8'/%3E%3C/svg%3E") right 18px center/12px 8px no-repeat;
  padding: 12px 46px 12px 20px; font: 600 14px 'Mulish', sans-serif; color: var(--s-p); min-width: 220px;
}
.ms-shop-bar .woocommerce-ordering select:focus { outline: 0; border-color: var(--s-lav); box-shadow: 0 0 0 3px rgba(155,124,192,.2); }

/* --- grid --- */
body.woocommerce.archive.ms-theme .ms-shop-main ul.products,
body.woocommerce.archive.ms-theme .ms-shop-main .wc-columns-container ul.products {
  display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: clamp(16px, 2vw, 26px) !important;
  margin: 0 !important; padding: 0 !important; list-style: none;
}
body.woocommerce.archive.ms-theme .ms-shop-main ul.products::before,
body.woocommerce.archive.ms-theme .ms-shop-main ul.products::after { display: none !important; content: none !important; }
@media (max-width: 1100px) { body.woocommerce.archive.ms-theme .ms-shop-main ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (max-width: 760px) { body.woocommerce.archive.ms-theme .ms-shop-main ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 14px !important; } }

/* --- card (same look as "Our Most Popular Spells") --- */
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product {
  position: relative; display: flex !important; flex-direction: column; width: auto !important; float: none !important; margin: 0 !important; padding: 0 !important;
  background: #fff; border: 1px solid var(--s-line); border-radius: 16px; overflow: hidden; text-align: left !important;
  transition: transform .25s ease, box-shadow .25s ease;
}
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product:hover { transform: translateY(-5px); box-shadow: 0 18px 38px -10px rgba(36,28,54,.2), 0 6px 14px -6px rgba(36,28,54,.08); }
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product > a.woocommerce-LoopProduct-link,
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product > a.woocommerce-loop-product__link {
  display: flex; flex-direction: column; flex: 1; text-decoration: none !important; color: inherit;
}
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product .wc-product-image,
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product .inside-wc-product-image { margin: 0 !important; padding: 0 !important; overflow: hidden; }
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product img {
  display: block; width: 100% !important; height: auto; aspect-ratio: 1 / 1; object-fit: cover; margin: 0 !important; border-radius: 0 !important;
  background: #efe7dc; transition: transform .5s ease;
}
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product:hover img { transform: scale(1.04); }
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product .woocommerce-loop-product__title {
  font-family: 'Lora', Georgia, serif !important; font-weight: 600 !important; font-size: 17px !important; line-height: 1.28 !important;
  color: var(--s-ink) !important; margin: 0 !important; padding: 16px 18px 0 !important; text-transform: none !important; letter-spacing: 0 !important;
}
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product .star-rating { margin: 8px 18px 0 !important; font-size: 12px; color: var(--s-g); }
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product .price {
  display: block; margin: 0 !important; padding: 8px 18px 0 !important; font: 700 14px/1.4 'Mulish', sans-serif !important; color: var(--s-p) !important;
}
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product .price del { color: var(--s-mist) !important; opacity: .8; font-weight: 400; margin-right: 6px; }
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product .price ins { text-decoration: none; color: var(--s-g); }
/* the button becomes the gold "Select options →" line at the bottom */
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product .button,
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product .added_to_cart {
  display: inline-flex !important; align-items: center; gap: 6px; align-self: flex-start;
  margin: auto 0 0 !important; padding: 12px 18px 18px !important; min-height: 0 !important;
  background: none !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
  font: 600 12px/1.2 'Mulish', sans-serif !important; letter-spacing: .06em !important; text-transform: uppercase !important; color: var(--s-g) !important;
  text-shadow: none !important; transform: none !important;
}
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product .button::after { content: "\2192"; transition: transform .2s ease; }
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product:hover .button::after { transform: translateX(3px); }
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product .button.loading { opacity: .6; }
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product .added_to_cart { padding-top: 0 !important; color: var(--s-p) !important; }
/* sale badge */
body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product .onsale {
  position: absolute; top: 12px; left: 12px; right: auto !important; z-index: 2; margin: 0 !important; min-width: 0; min-height: 0; line-height: 1;
  padding: 7px 12px; border-radius: 999px; background: linear-gradient(135deg, #F2D390, #DFA355 45%, #C07A2E); color: #FDFCF8;
  font: 800 11px/1 'Mulish', sans-serif; letter-spacing: .1em; text-transform: uppercase; text-shadow: 0 1px 4px rgba(60,42,10,.35);
  box-shadow: 0 4px 14px rgba(169,129,47,.35);
}
@media (max-width: 760px) {
  body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product .woocommerce-loop-product__title { font-size: 15px !important; padding: 12px 12px 0 !important; }
  body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product .price { padding: 6px 12px 0 !important; font-size: 13px !important; }
  body.woocommerce.archive.ms-theme .ms-shop-main ul.products li.product .button { padding: 10px 12px 14px !important; font-size: 11px !important; }
  .ms-shop-bar .woocommerce-ordering, .ms-shop-bar .woocommerce-ordering select { width: 100%; }
}

/* --- pagination --- */
.ms-shop-main .woocommerce-pagination { margin: clamp(32px, 5vw, 56px) 0 0; text-align: center; }
.ms-shop-main .woocommerce-pagination ul { display: inline-flex !important; gap: 8px; border: 0 !important; margin: 0; padding: 0; }
.ms-shop-main .woocommerce-pagination ul li { border: 0 !important; float: none; overflow: visible; }
.ms-shop-main .woocommerce-pagination ul li a,
.ms-shop-main .woocommerce-pagination ul li span {
  display: inline-flex !important; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 12px !important; box-sizing: border-box;
  border-radius: 999px; border: 1px solid var(--s-line); background: #fff; color: var(--s-p); font: 700 14px 'Mulish', sans-serif; text-decoration: none;
}
.ms-shop-main .woocommerce-pagination ul li a:hover { border-color: var(--s-lav); background: #F5F0FA; }
.ms-shop-main .woocommerce-pagination ul li span.current { background: var(--s-p); border-color: var(--s-p); color: #FDFCF8; }

/* --- nothing found --- */
.ms-shop-empty { text-align: center; }
.ms-shop-empty .woocommerce-info {
  font-family: 'Lora', Georgia, serif; font-size: 20px; color: var(--s-ink); background: var(--s-sand); border: 1px solid var(--s-line);
  border-radius: 16px; padding: 26px; margin: 0 auto 22px; max-width: 640px;
}
.ms-shop-empty .woocommerce-info::before { display: none; }
.ms-shop-empty-btn {
  display: inline-flex; padding: 16px 34px; border-radius: 999px; text-decoration: none; color: #FDFCF8;
  background: linear-gradient(135deg, #F2D390, #DFA355 45%, #C07A2E); font: 800 13px 'Mulish', sans-serif; letter-spacing: .1em; text-transform: uppercase;
  box-shadow: 0 0 22px rgba(227,199,126,.45);
}
/* reviews band sits right under the grid */
body.woocommerce.archive .ms-cart-reviews { margin-top: clamp(40px, 6vh, 72px); }
