/* ==========================================================================
   AMA Shop — overrides for things that live in Divi Theme Options, not CSS
   --------------------------------------------------------------------------
   ama-shop.css is a faithful copy of the source site's stylesheet, but that
   stylesheet was written against ama-shop's *Divi Theme Options*: link colour,
   heading font, body font and button icon all came from Divi's generated CSS,
   not from the child theme. Those options are global to a site, so they cannot
   be copied here without restyling all of amazing-meds.

   This file supplies just those values, scoped to `.ama-design` so it only
   reaches the imported shop pages. Everything here mirrors a specific setting
   in the source's `et_divi` option; the source value is named in each comment.

   Loaded immediately after ama-shop.css — see ama_shop_print_skin().
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Link colour.   source link_color: #a98f56   target link_color: #f42eea

   Divi emits a bare `a{color:#f42eea}` (specificity 0,0,1), which is the
   violet showing up in body copy on the imported pages. ama-shop.css sets no
   link colour at all - it relied on Divi for this. `.ama-design a` is 0,1,1 so
   it wins here, while every nav/button/card rule in ama-shop.css is more
   specific again and keeps its own colour.
   -------------------------------------------------------------------------- */
.ama-design a {
  color: var(--ama-gold-d);
}

.ama-design a:hover {
  color: var(--ama-ink);
}


/* --------------------------------------------------------------------------
   2. The gold diamond on dropdown menu items.

   This is a collision, not a missing setting. am-divi-brand.css builds the
   menu's dropdown caret as a 0.42em square with `border: solid currentColor`
   on two sides and `transform: rotate(45deg)` - a hollow chevron. It never
   declares a background, because it does not need to.

   ama-shop.css uses the same `> a:after` pseudo-element for its gold hover
   underline and sets `background: var(--ama-gold)`. The brand rule wins on
   width/height/transform (it is more specific), but the background leaks
   through, filling the hollow chevron into a solid gold diamond - visible at
   rest and on hover.

   Hand the caret back by clearing just the background. Items without a
   dropdown are untouched, so the gold underline still works there.
   -------------------------------------------------------------------------- */
.ama-design #top-menu .menu-item-has-children > a:first-child:after,
.ama-design #et-secondary-nav .menu-item-has-children > a:first-child:after,
.ama-design .et-menu .menu-item-has-children > a:first-child:after,
.ama-design .et_pb_menu .menu-item-has-children > a:first-child:after,
.ama-design .et_pb_fullwidth_menu .menu-item-has-children > a:first-child:after {
  background: transparent;
}


/* --------------------------------------------------------------------------
   3. Headings.   source heading_font: Playfair Display, weight 600,
                  header_color: #312c21     target heading_font: none

   With no heading font set here, Divi emits only
   `h1,h2,h3,h4,h5,h6{color:#333;...;font-weight:500}` and the headings fall
   back to the body face - this is the "font didn't load" look on Shop Landing.
   The @font-face rules themselves are fine; nothing was asking for Playfair.

   ama-shop.css deliberately sets `var(--ama-sans)` on a handful of headings
   (section eyebrows and similar). Those selectors are more specific and keep
   winning, so this only fills in the ones that were relying on Divi.
   -------------------------------------------------------------------------- */
.ama-design h1,
.ama-design h2,
.ama-design h3,
.ama-design h4,
.ama-design h5,
.ama-design h6 {
  font-family: var(--ama-serif);
  font-weight: 600;
  color: var(--ama-heading);
}


/* --------------------------------------------------------------------------
   4. Body copy.   source body_font: Open Sans, 16px/400, font_color: #5a5a5a
                   target body_font: none, 14px/500, font_color: #666666

   `.ama-design` sits on <body> (0,1,0), so it outranks Divi's `body` rule.
   -------------------------------------------------------------------------- */
.ama-design,
.ama-design input,
.ama-design textarea,
.ama-design select,
.ama-design button {
  font-family: var(--ama-sans);
}

.ama-design #page-container {
  font-size: 16px;
  font-weight: 400;
  color: var(--ama-body);
}


/* --------------------------------------------------------------------------
   5. Button icon.   source all_buttons_icon: no
                     target all_buttons_icon: yes, all_buttons_selected_icon: 5

   Divi draws an ETmodules glyph on every .et_pb_button via :after. The source
   turned that off globally, so ama-shop.css only ever suppresses it in a few
   specific places and assumes it is absent everywhere else. The body also gets
   `et_button_no_icon` on these pages (see ama_shop_body_class()), which is how
   Divi itself does it; this is the belt to that pair of braces, because Divi's
   generated CSS has already been emitted by then.
   -------------------------------------------------------------------------- */
.ama-design .et_pb_button:after,
.ama-design .et_pb_button::after {
  display: none;
}


/* --------------------------------------------------------------------------
   6. Top bar wrapping onto two lines.

   ama-shop.css turns #et-info into a centred flex row. Divi ships
   #et-info-phone / #et-info-email as display:block, which is fine on the
   source because its phone string is short ("Text (855) 436-5457", 148px) and
   both items fit one line. This site's string is longer ("QUESTIONS? Text:
   (855) 436-5457"), the phone span took the full 588px row, and the email was
   pushed onto a second line - an 81px top bar instead of ~42px, shoving every
   imported page down by ~40px and making the bar look unlike the rest of the
   site.

   Sizing them to their content fixes it (81px -> 54px). Deliberately NOT
   paired with flex-wrap:nowrap: the row still needs to wrap on narrow
   viewports, it just should not wrap at 1440px.
   -------------------------------------------------------------------------- */
.ama-design #top-header #et-info-phone,
.ama-design #top-header #et-info-email {
  display: inline-block;
  width: auto;
}


/* --------------------------------------------------------------------------
   7. Hero bands reserving space for a header that does not overlay here.

   The three hero bands each open with

     padding: calc(var(--ama-topbar-height) + var(--ama-menu-height) + Npx) ...

   i.e. 42px + 78px = 120px of reserve, then the real visual gap (N). That is
   correct on the source, where the primary nav is translucent, the body gets
   `et_transparent_nav`, #page-container has padding-top:0 and the header sits
   *over* the band - so the reserve is exactly the space the header covers.

   This site's header is opaque and in the flow: #page-container already
   carries padding-top:134px for it. The reserve is therefore counted twice and
   shows up as ~120px of dead cream above every breadcrumb (measured: the shop
   breadcrumb sat 173px below the header instead of the source's 53px).

   Dropping the reserve leaves each band with the gap it was designed to show.
   Only padding-top is set, so the responsive padding-bottom rules in
   ama-shop.css (max-width 767px / 640px) still apply.
   -------------------------------------------------------------------------- */
.ama-design.ama-shop .ama-shop-hero {
  padding-top: 54px;
}

.ama-design.ama-wc-page .ama-wc-hero {
  padding-top: 44px;
}

.ama-design.ama-legal .ama-legal-hero {
  padding-top: 44px;
}


/* --------------------------------------------------------------------------
   8. Single product: drop the two Theme Builder sections the source has not.

   Product pages here render inside a Divi Theme Builder *body* layout (the
   body gets `et-tb-has-body`), which is this site's own product template. The
   source site has no Theme Builder at all, so that template contributes two
   whole sections the original product page never shows:

     .et_pb_section_0_tb_body   the dark "FEEL AMAZING WITH OUR PRODUCTS /
                                SHOP" banner above the breadcrumb
     #footer (…_6_tb_body)      the "Doctor & Customer Approved / Trusted By
                                Thousands Of Customers" block - insurance
                                logos, the billing copy, and the Trustindex
                                widget currently printing "the 7-day trial
                                period has expired"

   Matched on position and on the section's own id rather than the generated
   `_N_tb_body` number, which shifts whenever the template is edited. Scoped to
   .single-product so the Theme Builder template is untouched everywhere else -
   it still renders in full on the rest of the site.

   This hides them; it does not add what the source product summary has
   (the PEPTIDES eyebrow, the price, the Rx-required notice). Those come from
   woocommerce-single.php + woocommerce-product-review.php, which cannot take
   effect while a Theme Builder layout owns the page, because that layout draws
   the product with Divi modules instead of WooCommerce's own hooks.
   -------------------------------------------------------------------------- */
.ama-design.single-product .et-l--body > .et_builder_inner_content > .et_pb_section:first-child,
.ama-design.single-product .et-l--body > .et_builder_inner_content > #footer {
  display: none;
}


/* --------------------------------------------------------------------------
   9. Single product: title and price typography.

   The Theme Builder template styles its WooCommerce modules with Divi's own
   generated CSS (`.et_pb_wc_title_0_tb_body h1 {...}`), which outranks the
   generic heading rule in §3 - so the product title was rendering in Bayon
   60px while the source uses Playfair Display 46.4px/600, and the price was
   not picking up the serif either.

   Source values, measured on http://localhost:10038/product/klow/:
     title  Playfair Display  46.4px  600  #312c21
     price  Playfair Display  38.4px
   -------------------------------------------------------------------------- */
.ama-design.single-product .et_pb_wc_title h1,
.ama-design.single-product .et_pb_wc_title h2,
.ama-design.single-product .et_pb_wc_title .product_title,
.ama-design.single-product h1.product_title {
  font-family: var(--ama-serif);
  font-size: 46.4px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--ama-heading);
}

.ama-design.single-product .et_pb_wc_price .price,
.ama-design.single-product .et_pb_wc_price .woocommerce-Price-amount {
  font-family: var(--ama-serif);
  font-size: 38.4px;
  font-weight: 600;
  color: var(--ama-heading);
}

@media (max-width: 767px) {
  .ama-design.single-product .et_pb_wc_title h1,
  .ama-design.single-product .et_pb_wc_title h2,
  .ama-design.single-product .et_pb_wc_title .product_title,
  .ama-design.single-product h1.product_title {
    font-size: 34px;
  }

  .ama-design.single-product .et_pb_wc_price .price,
  .ama-design.single-product .et_pb_wc_price .woocommerce-Price-amount {
    font-size: 30px;
  }
}


/* --------------------------------------------------------------------------
   10. Hand the top navigation back to this site.

   Decision: shop pages keep amazing-meds' own header and menu. ama-shop.css
   rebuilds the whole top nav for the source's header, and on this site's menu
   - which has dropdowns, where the source's had none - that misbehaves:

   a) THE HOVER SHAPE. `#top-menu > li > a:hover:after { width: 100% }` has the
      same specificity as am-divi-brand.css's chevron rule but loads later, so
      hovering a dropdown parent stretched the 0.42em rotated square to the
      full width of the link - a long skewed bar instead of a chevron.

   b) THE DROPDOWN BRIDGE. Divi pads top-level anchors `0 0 30px` so the cursor
      can travel from the link into the submenu. The skin removes that padding
      (`padding: 0 !important`) and rebuilds the bridge as an absolutely
      positioned pseudo-element on the <li>, sized for the source's 78px
      header. On this site's 81px header the bridge lands in the wrong place,
      so dropdowns close as you reach for them.

   c) The gold underline that grows on hover is the source's design, not this
      site's.

   Everything below restores the values this site's own pages use (measured on
   /buy-services/). Typography is not touched: am-divi-brand.css already sets
   the nav font with !important, so it was never affected.
   -------------------------------------------------------------------------- */

/* Layout back to Divi's floated nav. */
.ama-design #et-top-navigation {
  display: block;
  float: right;
  padding: 30px 0 0 !important;
  margin: 0;
  gap: normal;
  align-items: normal;
}

.ama-design #top-menu-nav {
  float: left;
}

.ama-design #top-menu {
  display: block;
  float: left;
  gap: normal;
  align-items: normal;
}

.ama-design #top-menu > li {
  display: inline-block;
  align-items: normal;
  padding: 0 22px 0 0;
  margin: 0;
}

/* The bridge Divi relies on for dropdown hover. */
.ama-design #top-menu > li > a {
  padding: 0 0 30px !important;
}

/* Drop the growing gold underline. On a dropdown parent this pseudo-element is
   the chevron, and am-divi-brand.css's rule is more specific, so its
   `content: ""` survives and the chevron stays. */
.ama-design #top-menu > li > a:after {
  content: none;
}

/* ...but the skin's hover/current rules still reach the chevron, so pin its
   geometry back to am-divi-brand.css's values (0.42em square, no transition). */
.ama-design #top-menu > li.menu-item-has-children > a:first-child:after,
.ama-design #top-menu > li.menu-item-has-children > a:first-child:hover:after,
.ama-design #top-menu > li.menu-item-has-children:hover > a:first-child:after,
.ama-design #top-menu > li.menu-item-has-children.current-menu-item > a:first-child:after,
.ama-design #top-menu > li.menu-item-has-children.current-menu-ancestor > a:first-child:after {
  width: 0.42em;
  height: 0.42em;
  background: transparent;
  transition: none;
}

/* The skin's substitute hover bridge - Divi's padding does this again now. */
.ama-design #top-menu > li.menu-item-has-children:after {
  display: none;
}

/* Dropdown panel: this site's own styling, not the source's gold-topped pill. */
.ama-design #top-menu > li > ul.sub-menu {
  margin-top: 0;
}

.ama-design #top-menu li ul {
  border-top: 3px solid #e8e4de;
  border-radius: 0;
  box-shadow: rgba(0, 0, 0, .1) 0 2px 5px 0;
  padding: 20px 0;
}

.ama-design #top-menu li li a {
  padding: 6px 20px;
  width: 200px;
}


/* --------------------------------------------------------------------------
   11. Carried over from the source's Customizer "Additional CSS".
   --------------------------------------------------------------------------
   ama-shop kept a small amount of shop styling in the Customizer
   (theme_mods_divi-child-theme -> custom_css_post_id -> post 528) rather than
   in its stylesheet, so it travelled with neither the page copy nor
   ama-shop.css. It is reproduced here instead of being merged into this site's
   own Additional CSS (post 23609, 10KB of unrelated main-site rules).

   Two of the source's five rules are deliberately left out:
     - `#main-header .ama-wordmark { text-transform: lowercase }` - this site
       keeps its own logo, so there is no wordmark to lowercase.
     - the `#ama-checkout-register` mobile fieldset rule - that element comes
       from woocommerce-checkout-register.php, which is not installed.
   -------------------------------------------------------------------------- */

/* Placeholder categories that exist in the data but are not real filters.
   They carry products (ama-meds 2, category-1 1, category-2 1), so they are
   hidden rather than emptied - the taxonomy and the products stay intact.
   This is why the source shows 7 chips where this site was showing 10. */
.ama-design .ama-shop-chips a[href*="/product-category/ama-meds/"],
.ama-design .ama-shop-chips a[href*="/product-category/category-1/"],
.ama-design .ama-shop-chips a[href*="/product-category/category-2/"] {
  display: none !important;
}

/* Keep WooCommerce's own checkout button visible while the cart block docks it. */
.ama-design.ama-cart .wc-block-cart__submit-container--sticky {
  display: block;
}
