/* Bridges between the static design and WordPress / WooCommerce markup. */

/* Menus output by wp_nav_menu */
.navbar-yourmed .menu-item { list-style: none; }
.footer-yourmed ul.list-unstyled li { margin-bottom: .5rem; }
.footer-yourmed .ym-mhra-logo img { max-width: 120px; height: auto; }

/* Header logo sizing (the design sets height; keep aspect ratio) */
.brand-logo-img, .brand-logo-img-footer { width: auto; }

/* Mini cart inside the basket drawer */
.ym-mini-cart .woocommerce-mini-cart { list-style: none; padding: 0; margin: 0; }
.ym-mini-cart .woocommerce-mini-cart-item {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
  padding: .75rem 2rem .75rem 0; border-bottom: 1px solid var(--ym-border-color); font-size: .9rem;
}
.ym-mini-cart .woocommerce-mini-cart-item img { width: 56px; height: 56px; object-fit: cover; border-radius: .5rem; order: -1; }
.ym-mini-cart .woocommerce-mini-cart-item a:not(.remove) { color: var(--ym-navy); font-weight: 600; text-decoration: none; }
.ym-mini-cart .woocommerce-mini-cart-item .remove { position: absolute; right: 0; top: .75rem; color: var(--ym-text-muted) !important; text-decoration: none; font-size: 1.25rem; line-height: 1; }
.ym-mini-cart .woocommerce-mini-cart-item .quantity { width: 100%; color: var(--ym-text-muted); padding-left: calc(56px + .75rem); margin-top: -1.25rem; }
.ym-mini-cart .woocommerce-mini-cart__total { display: flex; justify-content: space-between; padding: 1rem 0; font-weight: 700; color: var(--ym-navy); }
.ym-mini-cart .woocommerce-mini-cart__buttons { display: grid; gap: .5rem; }
.ym-mini-cart .woocommerce-mini-cart__empty-message { text-align: center; color: var(--ym-text-muted); padding: 2rem 0; }

/* Map WooCommerce buttons onto the design's primary button */
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce #respond input#submit, .ym-mini-cart .button {
  display: inline-block; text-align: center; border: 0; border-radius: .6rem; padding: .75rem 1.25rem;
  background: var(--ym-primary); color: #fff; font-weight: 600; text-decoration: none; transition: background .2s;
}
.woocommerce a.button:hover, .woocommerce button.button:hover, .ym-mini-cart .button:hover { background: var(--ym-primary-dark); color: #fff; }
.woocommerce a.button.alt, .woocommerce button.button.alt, .ym-mini-cart .button.checkout { background: var(--ym-teal-accent); color: var(--ym-navy); }
.woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover { background: var(--ym-primary-light); color: #fff; }

/* Generic content pages (legal pages, etc.) */
.site-content > .page-content, .ym-page { padding-block: 3rem; }

/* ---- Utilities the design references but never defines ---- */
.text-navy { color: var(--ym-navy) !important; }
.text-teal { color: var(--ym-teal-accent) !important; }
.max-w-700 { max-width: 700px; }
.max-w-900 { max-width: 900px; }
.badge-pain { background: var(--ym-pain-light); color: var(--ym-pain); border: 1px solid var(--ym-pain-border); }
.badge-sleep { background: var(--ym-sleep-light); color: var(--ym-sleep); border: 1px solid var(--ym-sleep-border); }
.cursor-pointer { cursor: pointer; }

/* Links inside cards/titles keep the design's colours */
.product-title a, .blog-title a { color: inherit; text-decoration: none; }
.product-title a:hover, .blog-title a:hover { color: var(--ym-primary); }
a.product-img-container, a.blog-img-box { display: block; }
.product-img-container img { width: 100%; }
.product-card .added_to_cart, .ym-card .added_to_cart { display: none !important; } /* the basket drawer opens instead */
.btn-card-add.loading { opacity: .7; pointer-events: none; }
.btn-card-add.added::after { content: ' \2713'; }

/* Fieldset/legend reset for accessible filter groups */
.filter-card fieldset { border: 0; padding: 0; min-width: 0; }
.filter-card legend { font-size: inherit; float: none; width: auto; margin: 0 0 .5rem; }
a.active-filter-badge { color: inherit; }

/* Treatment finder buttons */
.consult-cond-card { transition: border-color .2s, box-shadow .2s; }
.consult-cond-card:hover, .consult-cond-card.active { border-color: var(--ym-primary) !important; box-shadow: var(--ym-shadow-sm); }

/* Pagination (WooCommerce + core) */
.ym-pagination ul.page-numbers, .ym-pagination .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; list-style: none; padding: 0; margin: 0; border: 0; }
.ym-pagination ul.page-numbers li { border: 0; }
.ym-pagination .page-numbers { display: inline-flex; min-width: 2.5rem; height: 2.5rem; align-items: center; justify-content: center; padding: 0 .75rem; border-radius: .6rem; border: 1px solid var(--ym-border-color); background: #fff; color: var(--ym-navy); text-decoration: none; font-weight: 600; }
.ym-pagination .page-numbers.current, .ym-pagination .page-numbers:hover { background: var(--ym-primary); border-color: var(--ym-primary); color: #fff; }

/* ---- Single product: WooCommerce add-to-cart form in the design's style ---- */
.ym-buy-box form.cart { display: flex; gap: 1rem; align-items: stretch; margin-bottom: 1rem; }
.ym-buy-box .quantity .qty { width: 5rem; height: 100%; min-height: 3.5rem; text-align: center; border: 1.5px solid var(--ym-border-color); border-radius: .75rem; font-weight: 700; color: var(--ym-navy); }
.ym-buy-box .single_add_to_cart_button { flex: 1; min-height: 3.5rem; font-size: 1.05rem; background: var(--ym-primary) !important; color: #fff !important; border-radius: .75rem !important; }
.ym-buy-box .single_add_to_cart_button:hover { background: var(--ym-primary-dark) !important; }
.ym-buy-box .stock { display: none; }
.pdp-thumb-item { border: 0; background: none; padding: 0; }
.pdp-main-image-box img { width: 100%; height: auto; }
.star-rating { color: #f59e0b; }

/* Reviews tab (WooCommerce review list/form) */
#tab-reviews .commentlist { list-style: none; padding: 0; }
#tab-reviews .commentlist li { border-top: 1px solid var(--ym-border-color); padding: 1rem 0; }
#tab-reviews .comment-form input[type="text"], #tab-reviews .comment-form input[type="email"], #tab-reviews .comment-form textarea, #tab-reviews select { width: 100%; border: 1px solid var(--ym-border-color); border-radius: .6rem; padding: .6rem .8rem; }
#tab-reviews .woocommerce-noreviews { color: var(--ym-text-muted); }

/* ---- Article body: Gutenberg blocks in the design's style ---- */
.article-body .ym-callout { background: var(--ym-primary-subtle); border-left: 4px solid var(--ym-primary); border-radius: .75rem; padding: 1.25rem 1.5rem; margin: 1.5rem 0; }
.article-body .ym-callout p:last-child { margin-bottom: 0; }
.article-body .wp-block-table { margin: 2rem 0; overflow-x: auto; }
.article-body .wp-block-table table { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; }
.article-body .wp-block-table th { background: var(--ym-navy); color: #fff; text-align: left; padding: .75rem; font-weight: 600; }
.article-body .wp-block-table td { padding: .75rem; border-bottom: 1px solid var(--ym-border-color); }
.article-body .wp-block-table tr:nth-child(even) td { background: var(--ym-bg-body); }
.article-body .wp-block-table figcaption { font-size: .8rem; color: var(--ym-text-muted); margin-top: .5rem; }
.article-body .wp-block-list li { margin-bottom: .75rem; }
.article-body h2[id] { scroll-margin-top: 110px; }

/* ---- Cart / checkout / account (WooCommerce blocks) ---- */
.ym-wc-page { background: #fff; border: 1px solid var(--ym-border-color); border-radius: 1rem; padding: clamp(1rem, 3vw, 2.5rem); }
.ym-wc-page .wc-block-components-button:not(.is-link), .ym-wc-page .wc-block-cart__submit-button, .ym-wc-page .wc-block-components-checkout-place-order-button {
  background: var(--ym-primary); color: #fff; border-radius: .75rem; font-weight: 600; border: 0;
}
.ym-wc-page .wc-block-components-button:not(.is-link):hover { background: var(--ym-primary-dark); color: #fff; }
.ym-wc-page .wc-block-components-title, .ym-wc-page h2 { font-family: var(--font-heading); color: var(--ym-navy); }
.ym-wc-page a { color: var(--ym-primary); }
.woocommerce-MyAccount-navigation ul { list-style: none; padding: 0; display: grid; gap: .25rem; }
.woocommerce-MyAccount-navigation a { display: block; padding: .6rem .9rem; border-radius: .6rem; color: var(--ym-navy); text-decoration: none; }
.woocommerce-MyAccount-navigation .is-active a, .woocommerce-MyAccount-navigation a:hover { background: var(--ym-primary-subtle); color: var(--ym-primary); }
@media (min-width: 768px) { .woocommerce-account .ym-wc-page .woocommerce { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; } }

/* WooCommerce notices */
.woocommerce-message, .woocommerce-info, .woocommerce-error, .wc-block-components-notice-banner { border-radius: .75rem; }
.woocommerce-message, .woocommerce-info { background: var(--ym-primary-subtle); border: 1px solid #a7f3d0; padding: 1rem 1.25rem; list-style: none; margin-bottom: 1.5rem; }
.woocommerce-error { background: #fef2f2; border: 1px solid #fecaca; padding: 1rem 1.25rem; list-style: none; margin-bottom: 1.5rem; }
.woocommerce-message .button, .woocommerce-info .button { float: right; padding: .35rem .9rem; }

/* Mobile offcanvas menu uses the same links */
.offcanvas .nav .menu-item a { display: block; }

/* -/+ quantity picker wraps WooCommerce's qty input */
.ym-buy-box .quantity { display: inline-flex; align-items: center; border: 1.5px solid var(--ym-border-color); border-radius: .75rem; background: #fff; overflow: hidden; }
.ym-buy-box .quantity .qty { border: 0; width: 3.25rem; min-height: 3.5rem; -moz-appearance: textfield; }
.ym-buy-box .quantity .qty::-webkit-outer-spin-button, .ym-buy-box .quantity .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ym-buy-box .quantity .quantity-btn { border: 0; background: transparent; width: 2.75rem; height: 3.5rem; font-size: 1.25rem; color: var(--ym-navy); }
.ym-buy-box .quantity .quantity-btn:hover { background: var(--ym-primary-subtle); color: var(--ym-primary); }
.ym-buy-box .single_add_to_cart_button::before { font-family: 'bootstrap-icons'; content: '\f182'; margin-right: .5rem; } /* bi-basket2 */

/* Product tabs scroll sideways on small screens instead of wrapping */
@media (max-width: 767.98px) {
  .pdp-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .pdp-tabs::-webkit-scrollbar { display: none; }
  .pdp-tabs .nav-link { white-space: nowrap; }
}
.ym-buy-box .quantity { flex: none; }
.ym-buy-box .single_add_to_cart_button { white-space: nowrap; padding-inline: 1rem; }
@media (max-width: 400px) { .ym-buy-box .quantity .quantity-btn { width: 2.25rem; } .ym-buy-box .quantity .qty { width: 2.5rem; } }

/* ---- Variable products: attribute pills (design's pack-size selector) ---- */
.ym-buy-box form.variations_form { display: block; }
.ym-buy-box table.variations { width: 100%; border: 0; margin-bottom: 1rem; }
.ym-buy-box table.variations tr { display: block; margin-bottom: .75rem; }
.ym-buy-box table.variations th, .ym-buy-box table.variations td { display: block; padding: 0; border: 0; text-align: start; }
.ym-buy-box table.variations th.label label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--ym-navy); margin-bottom: .5rem; }
.ym-js-variations .ym-buy-box .ym-var-select { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html:not(.ym-js-variations) .ym-var-pills { display: none; }
.ym-var-pills { display: flex; flex-wrap: wrap; gap: .6rem; }
.ym-var-pill { min-width: 88px; padding: .7rem 1.1rem; border: 1.5px solid var(--ym-border-color); border-radius: .75rem; background: #fff; color: var(--ym-navy); font-weight: 600; font-size: .95rem; transition: border-color .15s, background .15s, box-shadow .15s; }
.ym-var-pill:hover:not(:disabled) { border-color: var(--ym-primary-light); }
.ym-var-pill.active { border-color: var(--ym-primary); background: var(--ym-primary-subtle); color: var(--ym-primary); box-shadow: 0 0 0 3px rgba(10, 77, 74, .08); }
.ym-var-pill:disabled { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
.ym-buy-box .reset_variations { display: inline-block; margin-top: .5rem; font-size: .8rem; color: var(--ym-text-muted); }
/* One price only: the theme's price box replaces WooCommerce's variation price */
.ym-buy-box .woocommerce-variation-price { display: none !important; }
.ym-buy-box .woocommerce-variation-description { font-size: .875rem; color: var(--ym-text-muted); margin-bottom: .75rem; }
.ym-buy-box .woocommerce-variation-description p { margin: 0; }
.ym-buy-box .woocommerce-variation-add-to-cart { display: flex; gap: 1rem; align-items: stretch; }
.ym-buy-box .single_add_to_cart_button.disabled { opacity: .5; }
[data-ym-price-now] { transition: opacity .15s; }

/* Rich text from the product "How to take" / "Side effects" editors */
.ym-rich > *:last-child { margin-bottom: 0; }
.ym-rich h2, .ym-rich h3, .ym-rich h4 { font-size: 1.05rem; font-weight: 700; color: var(--ym-navy); margin: 1.25rem 0 .5rem; }
.ym-rich ul, .ym-rich ol { padding-left: 1.25rem; margin-bottom: 1rem; }
.ym-rich li { margin-bottom: .35rem; }
.ym-rich a { color: var(--ym-primary); }
.ym-rich table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: .9rem; }
.ym-rich th, .ym-rich td { border: 1px solid var(--ym-border-color); padding: .5rem .75rem; }
.ym-rich th { background: var(--ym-bg-body); color: var(--ym-navy); }
.ym-rich img { max-width: 100%; height: auto; border-radius: .5rem; }
.ym-rich blockquote { border-left: 3px solid var(--ym-primary); padding-left: 1rem; color: var(--ym-text-muted); }
