/*
 * Shop (product archive) redesign -- Redesign Genie task, CRM #557.
 *
 * Scope: the WooCommerce shop archive only. Every rule is scoped under
 * `body.ssb-design-shop` (added by SSB_Site_Design when is_shop() /
 * is_product_category() / is_product_tag() is true), so nothing here leaks
 * to other pages or to the Elementor editor.
 *
 * Direction: editorial / bold. The live shop is an Elementor page (id 76030,
 * kit 70442) with a hero slider, a "Shop Flowers by Occasion" heading, a
 * category tabs widget (.e-n-tabs) and a product Loop Grid (template 76023,
 * .e-loop-item cards) with Load More. This file rebuilds the visual hierarchy
 * -- serif display type, an editorial paper background, sharpened 4px card
 * corners with a clear title/price/CTA rhythm, restyled occasion tabs, a bold
 * indigo primary and magenta accent -- and styles the product search bar that
 * shop.js injects above the tabs (the markup does not exist in Elementor).
 *
 * The kit is lavender (#9F76BE); this editorial indigo/magenta scheme is a
 * deliberate, shop-scoped departure and does not touch tokens.css.
 *
 * Selectors: card element ids (c4e03b8 image, d26c201 title, a817a62 price,
 * 5701fdd container, 0f5f080 arrow link) are the Loop Grid template's own
 * element ids, stable across every card; they are always prefixed with
 * `.e-loop-item` so they only ever match a product card. Elementor prints the
 * loop's `<style id="loop-76023">` block inline in the <body>, after this
 * file in <head>, so a few card rules need the extra specificity or a flagged
 * `!important` to win the cascade; each is commented where it happens.
 */

body.ssb-design-shop {
  /* Editorial palette from the CRM style brief (shop-scoped only). */
  --ssb-shop-ink: #111827;        /* text        */
  --ssb-shop-primary: #1e2db8;    /* primary     */
  --ssb-shop-secondary: #b7349d;  /* accent      */
  --ssb-shop-paper: #f9fafd;      /* card paper  */
  --ssb-shop-bg: #fafafa;         /* page canvas */
  --ssb-shop-line: #e4e6f2;       /* hairlines   */
  --ssb-shop-muted: #5b6172;      /* secondary text */
  --ssb-shop-radius: 4px;         /* borderRadius: 4 */
  /* System serif -- no external font needed, so no @import. */
  --ssb-shop-serif: "Georgia", "Times New Roman", serif;

  /* Live-site kit tokens (kit 70442) so the injected search bar reads as a
   * native part of the site rather than the editorial card/tab restyle.
   * The site header, footer and buttons use these; all four families are
   * already loaded by Elementor on the shop page, so no @import is needed. */
  --ssb-site-primary: #9f76be;        /* kit --e-global-color-primary */
  --ssb-site-primary-hover: #23152e;  /* kit .elementor-button:hover bg */
  --ssb-site-ink: #483c51;            /* kit --e-global-color-text */
  --ssb-site-paper: #f8efff;          /* kit soft lavender tint */
  --ssb-site-line: #e2d1ef;           /* kit lavender hairline */
  --ssb-site-display: "League Spartan", "Poppins", sans-serif; /* kit display */
  --ssb-site-body: "Poppins", "Roboto", sans-serif;            /* kit body */
  --ssb-site-button: "DM Sans", "Poppins", sans-serif;         /* kit button */
}

/* -------------------------------------------------------------------------
 * Section canvas and spacing (measured density)
 * ------------------------------------------------------------------------- */

/* #shoping_flower is the section that holds the heading, tabs and grid. */
body.ssb-design-shop #shoping_flower {
  background-color: var(--ssb-shop-bg);
}

body.ssb-design-shop #shoping_flower > .e-con-inner {
  padding-top: 40px;
  padding-bottom: 56px;
}

/* -------------------------------------------------------------------------
 * Editorial header
 * ------------------------------------------------------------------------- */

body.ssb-design-shop #shoping_flower .elementor-element-0e7b1a0 h2 {
  font-family: var(--ssb-shop-serif);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ssb-shop-ink);
  margin-bottom: 14px;
}

/* Short accent rule under the section heading -- editorial signature. */
body.ssb-design-shop #shoping_flower .elementor-element-0e7b1a0 h2::after {
  content: "";
  display: block;
  width: 72px;
  height: 3px;
  margin-top: 18px;
  background: var(--ssb-shop-secondary);
}

body.ssb-design-shop #shoping_flower .elementor-element-a111cc8 p {
  font-family: var(--ssb-shop-serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ssb-shop-muted);
  max-width: 60ch;
}

/* -------------------------------------------------------------------------
 * Product search bar (injected by shop.js above the occasion tabs)
 * ------------------------------------------------------------------------- */

body.ssb-design-shop .ssb-shop-search {
  margin: 24px 0 32px;
  max-width: 620px;
}

body.ssb-design-shop .ssb-shop-search__label {
  display: block;
  font-family: var(--ssb-site-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ssb-site-ink); /* #483c51 ~9:1 on white, passes WCAG AA */
  margin-bottom: 8px;
}

body.ssb-design-shop .ssb-shop-search__row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

body.ssb-design-shop .ssb-shop-search__field {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: var(--ssb-site-body);
  color: var(--ssb-site-ink);
  background: #ffffff;
  border: 1px solid var(--ssb-site-line);
  border-radius: var(--ssb-shop-radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.ssb-design-shop .ssb-shop-search__field::placeholder {
  color: #6b7280; /* ~4.8:1 on white, passes WCAG AA */
}

body.ssb-design-shop .ssb-shop-search__field:focus {
  outline: none;
  border-color: var(--ssb-site-primary);
  box-shadow: 0 0 0 3px rgba(159, 118, 190, 0.2);
}

/* Matches the site's primary button (kit 70442): lavender fill, white label,
 * DM Sans, darkening to #23152e on hover. */
body.ssb-design-shop .ssb-shop-search__submit {
  flex: 0 0 auto;
  cursor: pointer;
  padding: 0 28px;
  font-family: var(--ssb-site-button);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #ffffff;
  background: var(--ssb-site-primary);
  border: 1px solid var(--ssb-site-primary);
  border-radius: var(--ssb-shop-radius);
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

body.ssb-design-shop .ssb-shop-search__submit:hover {
  background: var(--ssb-site-primary-hover);
  border-color: var(--ssb-site-primary-hover);
}

body.ssb-design-shop .ssb-shop-search__submit:active {
  transform: translateY(1px);
}

body.ssb-design-shop .ssb-shop-search__submit:focus-visible {
  outline: 3px solid rgba(159, 118, 190, 0.45);
  outline-offset: 2px;
}

/* AJAX results panel (populated by shop.js from the Store API). */
body.ssb-design-shop .ssb-shop-search__results {
  margin-top: 14px;
  background: #ffffff;
  border: 1px solid var(--ssb-site-line);
  border-radius: var(--ssb-shop-radius);
  padding: 8px;
}

body.ssb-design-shop .ssb-shop-search__results[hidden] {
  display: none;
}

body.ssb-design-shop .ssb-shop-search__status,
body.ssb-design-shop .ssb-shop-search__count {
  margin: 0;
  padding: 8px 10px;
  font-family: var(--ssb-site-body);
  font-size: 0.9375rem;
  color: var(--ssb-site-ink);
}

body.ssb-design-shop .ssb-shop-search__results.is-error .ssb-shop-search__status {
  color: #b00020; /* readable error red on white, passes WCAG AA */
}

body.ssb-design-shop .ssb-shop-search__count {
  font-family: var(--ssb-site-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ssb-site-ink);
}

body.ssb-design-shop .ssb-shop-search__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.ssb-design-shop .ssb-shop-search__item {
  margin: 0;
}

body.ssb-design-shop .ssb-shop-search__item + .ssb-shop-search__item {
  border-top: 1px solid var(--ssb-site-line);
}

body.ssb-design-shop .ssb-shop-search__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  text-decoration: none;
  color: var(--ssb-site-ink);
  border-radius: var(--ssb-shop-radius);
  transition: background-color 0.15s ease;
}

body.ssb-design-shop .ssb-shop-search__link:hover,
body.ssb-design-shop .ssb-shop-search__link:focus-visible {
  background: var(--ssb-site-paper);
  outline: none;
}

body.ssb-design-shop .ssb-shop-search__thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--ssb-shop-radius);
  background: var(--ssb-site-paper);
}

body.ssb-design-shop .ssb-shop-search__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

body.ssb-design-shop .ssb-shop-search__name {
  font-family: var(--ssb-site-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ssb-site-ink);
}

body.ssb-design-shop .ssb-shop-search__price {
  font-family: var(--ssb-site-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ssb-site-primary-hover); /* dark plum, AA on white */
}

/* -------------------------------------------------------------------------
 * Occasion tabs -> editorial nav
 * ------------------------------------------------------------------------- */

body.ssb-design-shop #shoping_flower .e-n-tabs-heading {
  gap: 6px 22px;
  border-bottom: 1px solid var(--ssb-shop-line);
  padding-bottom: 4px;
  margin-bottom: 28px;
}

body.ssb-design-shop #shoping_flower .e-n-tab-title {
  padding: 10px 4px;
  font-family: var(--ssb-shop-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ssb-shop-muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  transition: color 0.15s ease, border-color 0.15s ease;
}

body.ssb-design-shop #shoping_flower .e-n-tab-title:hover {
  color: var(--ssb-shop-ink);
}

body.ssb-design-shop #shoping_flower .e-n-tab-title[aria-selected="true"] {
  color: var(--ssb-shop-primary);
  border-bottom-color: var(--ssb-shop-primary);
}

/* Holiday collection on /shop/?ssb_collection=holiday (Store API grid). */
body.ssb-design-shop .ssb-shop-collection {
  margin: 8px 0 32px;
}

body.ssb-design-shop .ssb-shop-collection__title {
  margin: 0 0 18px;
  font-family: var(--ssb-shop-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--ssb-shop-ink);
}

body.ssb-design-shop .ssb-shop-collection__status {
  margin: 0;
  font-family: var(--ssb-site-body);
  font-size: 1rem;
  color: var(--ssb-shop-muted);
}

body.ssb-design-shop .ssb-shop-collection__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px 20px;
}

body.ssb-design-shop .ssb-shop-collection__card {
  margin: 0;
}

body.ssb-design-shop .ssb-shop-collection__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: var(--ssb-shop-ink);
  background: var(--ssb-shop-paper);
  border: 1px solid var(--ssb-shop-line);
  border-radius: var(--ssb-shop-radius);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body.ssb-design-shop .ssb-shop-collection__link:hover,
body.ssb-design-shop .ssb-shop-collection__link:focus-visible {
  transform: translateY(-4px);
  border-color: #cdd1e8;
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.12);
  outline: none;
}

body.ssb-design-shop .ssb-shop-collection__thumb {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #f4f4f8;
}

body.ssb-design-shop .ssb-shop-collection__body {
  padding: 14px 14px 16px;
}

body.ssb-design-shop .ssb-shop-collection__name {
  margin: 0 0 6px;
  font-family: var(--ssb-shop-serif);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

body.ssb-design-shop .ssb-shop-collection__price {
  margin: 0;
  font-family: var(--ssb-site-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ssb-shop-primary);
}

body.ssb-design-shop.ssb-shop-show-collection #shoping_flower .e-n-tabs-content,
body.ssb-design-shop.ssb-shop-show-collection #shoping_flower .elementor-widget-loop-grid {
  display: none !important;
}

/* Holiday tab (shop.js) links to the in-shop collection view. */
body.ssb-design-shop #shoping_flower .e-n-tabs-heading .ssb-shop-holiday-tab {
  display: inline-flex;
  align-items: center;
  padding: 10px 4px;
  font-family: var(--ssb-shop-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ssb-shop-muted);
  text-decoration: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

body.ssb-design-shop #shoping_flower .e-n-tabs-heading .ssb-shop-holiday-tab:hover {
  color: var(--ssb-shop-ink);
}

body.ssb-design-shop #shoping_flower .e-n-tabs-heading .ssb-shop-holiday-tab:focus-visible,
body.ssb-design-shop #shoping_flower .e-n-tabs-heading .ssb-shop-holiday-tab.is-active {
  color: var(--ssb-shop-primary);
  border-bottom-color: var(--ssb-shop-primary);
  outline: none;
}

/* -------------------------------------------------------------------------
 * Product cards
 * ------------------------------------------------------------------------- */

body.ssb-design-shop .elementor-loop-container.elementor-grid {
  gap: 26px 22px;
}

/* Card shell: extra specificity (.elementor-element twice) to beat the inline
 * loop <style> block that sets the container background and border vars. */
body.ssb-design-shop .e-loop-item .elementor-element.elementor-element-5701fdd {
  background-color: var(--ssb-shop-paper);
  border: 1px solid var(--ssb-shop-line);
  border-radius: var(--ssb-shop-radius);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body.ssb-design-shop .e-loop-item .elementor-element.elementor-element-5701fdd:hover {
  transform: translateY(-4px);
  border-color: #cdd1e8;
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.12);
}

/* Sharpen the image corners (loop style rounds them to 16px) and give a
 * little breathing room inside the card. */
body.ssb-design-shop .e-loop-item .elementor-element-6f6ce99 {
  padding: 12px 12px 4px;
}

body.ssb-design-shop .e-loop-item .elementor-element-c4e03b8 img {
  border-radius: var(--ssb-shop-radius);
  height: 240px;
}

/* Title: serif, high-contrast ink. .e-loop-item prefix lifts specificity
 * above the inline loop rule for this element id. */
body.ssb-design-shop .e-loop-item .elementor-element-66619e7 {
  padding: 4px 14px 0;
}

body.ssb-design-shop .e-loop-item .elementor-element-d26c201,
body.ssb-design-shop .e-loop-item .elementor-element-d26c201 p {
  font-family: var(--ssb-shop-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ssb-shop-ink);
}

/* Price / CTA row */
body.ssb-design-shop .e-loop-item .elementor-element-bdbb77d {
  padding: 6px 14px 14px;
}

body.ssb-design-shop .e-loop-item .elementor-element-a817a62 {
  font-family: var(--ssb-shop-serif);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--ssb-shop-secondary);
}

/* Arrow "view product" affordance -> primary indigo bubble. CSS `fill`
 * overrides the inline SVG rect fill attribute. */
body.ssb-design-shop .e-loop-item .elementor-element-0f5f080 svg rect {
  fill: var(--ssb-shop-primary);
  transition: fill 0.15s ease;
}

body.ssb-design-shop .e-loop-item .elementor-element-5701fdd:hover .elementor-element-0f5f080 svg rect {
  fill: var(--ssb-shop-secondary);
}

/* -------------------------------------------------------------------------
 * Load More button -> confident primary action
 * ------------------------------------------------------------------------- */

body.ssb-design-shop .e-loop__load-more {
  margin-top: 36px;
  text-align: center;
}

body.ssb-design-shop .e-loop__load-more .elementor-button {
  padding: 14px 40px;
  font-family: var(--ssb-shop-serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: var(--ssb-shop-primary);
  border: 1px solid var(--ssb-shop-primary);
  border-radius: var(--ssb-shop-radius);
  transition: background-color 0.15s ease;
}

body.ssb-design-shop .e-loop__load-more .elementor-button:hover {
  background: #16228f;
}

/* -------------------------------------------------------------------------
 * Mobile (<= 480px)
 * ------------------------------------------------------------------------- */

@media (max-width: 480px) {
  body.ssb-design-shop .ssb-shop-search__row {
    flex-direction: column;
  }

  body.ssb-design-shop .ssb-shop-search__submit {
    padding: 13px 24px;
  }

  body.ssb-design-shop #shoping_flower > .e-con-inner {
    padding-top: 28px;
    padding-bottom: 40px;
  }

  body.ssb-design-shop .e-loop-item .elementor-element-c4e03b8 img {
    height: 260px;
  }
}
