/* Brand palette overrides for the Most theme */
:root,
[data-theme="light"] {
  --color-primary-darker: #1c3140;
  --color-primary-dark: #1f3647;
  --color-primary: #243e51;
  --color-primary-light: #2c4c63;
  --color-primary-lighter: #325671;

  --color-secondary: #eadaa4;

  --color-accent-darker: #c5d3c5;
  --color-accent-dark: #d0dcd0;
  --color-accent: #dbe4db;
  --color-accent-light: #e2e9e2;
  --color-accent-lighter: #ebf0eb;

  --color-white: #ffffff;
  --color-bg: #ffffff;
  --color-contrast-higher: #1a1a1a;
  --color-contrast-high: #1f1f1f;
  --color-contrast-medium: #6f6f6f;
  --color-contrast-low: #e5e5e5;
  --color-contrast-lower: #f8f8f8;
  --color-border: #e5e5e5;

  --color-warning: #f4b000;
  --color-success: #2ac24c;
  --color-error: #c62828;
  --color-error-light: #ffebee;
  --color-info: #1565c0;
  --color-info-bg: #e3f2fd;

  --hero-overlay-gradient: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.6) 100%);

  --agh-primary: #243e51;
  --agh-accent: #eadaa4;
  --agh-dark: #111111;
  --agh-text: #1f1f1f;
  --agh-muted: #6f6f6f;
  --agh-border: #e1e1e1;
}

[data-theme="dark"] {
  --color-primary-darker: #1c3140;
  --color-primary-dark: #1f3647;
  --color-primary: #243e51;
  --color-primary-light: #2c4c63;
  --color-primary-lighter: #325671;

  --color-secondary: #eadaa4;
  --color-accent: #dbe4db;
  --color-accent-dark: #d0dcd0;
  --color-accent-light: #e2e9e2;

  --color-bg: #0f1720;
  --color-contrast-lower: #152432;
  --color-contrast-low: #2a3a48;
  --color-contrast-medium: #9aabb7;
  --color-contrast-high: #dbe4db;
  --color-contrast-higher: #f8f8f8;
  --color-border: #2a3a48;
}

a,
a:visited {
  color: var(--color-primary);
}

a:hover,
a:focus {
  color: var(--color-primary-dark);
}

/* Remove default Most header globally */
.main-header,
header.main-header {
  display: none !important;
}

button,
input[type="submit"],
input[type="button"],
input[type="reset"],
.wp-element-button,
.wp-block-button__link,
.wp-block-search__button,
.wp-block-button .wp-block-button__link,
a.button,
.btn,
.button,
.ms-btn,
.ms-btn,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce .button,
.woocommerce #respond input#submit,
.woocommerce .single_add_to_cart_button,
.wc-block-cart__submit-container .wc-block-components-button,
.wc-block-components-button,
.wc-block-components-button:not(.is-link),
.wc-block-components-product-button .wc-block-components-product-button__button,
.wc-block-components-product-button .wp-element-button,
.wc-block-components-checkout-place-order-button {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
  color: var(--color-primary);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
.wp-element-button:hover,
.wp-block-button__link:hover,
.wp-block-search__button:hover,
.btn:hover,
.button:hover,
.ms-btn:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce .button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce .single_add_to_cart_button:hover,
.wc-block-cart__submit-container .wc-block-components-button:hover,
.wc-block-components-button:hover,
.wc-block-components-checkout-place-order-button:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(36, 62, 81, 0.18);
}

/* Woo add-to-cart buttons in loops/single */
.woocommerce a.add_to_cart_button,
.woocommerce a.button.add_to_cart_button,
.woocommerce .product .add_to_cart_button,
.woocommerce .product a.button,
.woocommerce .single_add_to_cart_button,
.woocommerce button.single_add_to_cart_button,
.woocommerce .added_to_cart {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
  color: var(--color-primary);
}

.woocommerce a.add_to_cart_button:hover,
.woocommerce a.button.add_to_cart_button:hover,
.woocommerce .product .add_to_cart_button:hover,
.woocommerce .product a.button:hover,
.woocommerce .single_add_to_cart_button:hover,
.woocommerce button.single_add_to_cart_button:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

.woocommerce a.add_to_cart_button:focus-visible,
.woocommerce a.button.add_to_cart_button:focus-visible,
.woocommerce .product .add_to_cart_button:focus-visible,
.woocommerce .product a.button:focus-visible,
.woocommerce .single_add_to_cart_button:focus-visible,
.woocommerce button.single_add_to_cart_button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(36, 62, 81, 0.2);
}

/* Single product add to cart (extra specificity to win existing theme styles) */
.woocommerce div.product form.cart .single_add_to_cart_button,
.ms-single-product .ms-single-product__content .single_add_to_cart_button {
  background-color: var(--color-secondary) !important;
  border-color: var(--color-secondary) !important;
  color: var(--color-primary) !important;
}

.woocommerce div.product form.cart .single_add_to_cart_button:hover,
.ms-single-product .ms-single-product__content .single_add_to_cart_button:hover {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #ffffff !important;
}

.woocommerce div.product form.cart .single_add_to_cart_button:focus-visible,
.ms-single-product .ms-single-product__content .single_add_to_cart_button:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(36, 62, 81, 0.2) !important;
}

button:focus-visible,
input[type="submit"]:focus-visible,
input[type="button"]:focus-visible,
input[type="reset"]:focus-visible,
.wp-element-button:focus-visible,
.wp-block-button__link:focus-visible,
.wp-block-search__button:focus-visible,
.btn:focus-visible,
.button:focus-visible,
.ms-btn:focus-visible,
.woocommerce a.button:focus-visible,
.woocommerce button.button:focus-visible,
.woocommerce input.button:focus-visible,
.woocommerce .button:focus-visible,
.woocommerce #respond input#submit:focus-visible,
.woocommerce .single_add_to_cart_button:focus-visible,
.wc-block-cart__submit-container .wc-block-components-button:focus-visible,
.wc-block-components-button:focus-visible,
.wc-block-components-checkout-place-order-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(36, 62, 81, 0.2);
}

.wp-block-button.is-style-outline .wp-block-button__link,
.wp-element-button.is-style-outline,
.wp-block-button.is-style-outline .wp-block-button__link:where(:not(.has-background)),
.wp-element-button.is-style-outline:where(:not(.has-background)),
.button.alt,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-element-button.is-style-outline:hover,
.button.alt:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover {
  background-color: var(--color-accent);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.woocommerce span.onsale,
.woocommerce ul.products li.product .onsale,
.ms-single-product .onsale {
  background-color: var(--color-secondary);
  color: var(--color-primary);
  font-weight: 700;
  border-radius: 12px;
  letter-spacing: 0.01em;
  padding: 0.35em 0.8em;
}

/* PDP sale label override */
.woocommerce div.product span.onsale,
.woocommerce div.product .onsale,
.ms-single-product .onsale {
  background-color: var(--color-secondary) !important;
  color: var(--color-primary) !important;
}

.woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-store-notice,
.woocommerce-info {
  background-color: var(--color-info-bg);
  color: var(--color-info);
  border-color: var(--color-info);
}

.woocommerce-error,
.woocommerce-notices-wrapper .woocommerce-error {
  background-color: var(--color-error-light);
  color: var(--color-error);
  border-color: var(--color-error);
}

.woocommerce form .form-row .required,
.required {
  color: #ff0000;
}

.woocommerce-review__form .comment-form textarea:invalid,
.woocommerce form .form-row .input-text:invalid,
.woocommerce form .form-row .select2-selection--single.is-invalid,
input:invalid,
select:invalid,
textarea:invalid {
  border-color: #d93025;
  color: var(--color-error);
}

.woocommerce .star-rating span::before,
.woocommerce .star-rating::before,
.woocommerce p.stars a {
  color: #f4b000;
}

/* Force rating UI visibility on product reviews */
body.single-product .woocommerce #review_form .comment-form-rating,
body.single-product .woocommerce #review_form p.stars,
body.single-product .woocommerce #review_form p.stars a,
body.single-product .woocommerce #review_form select#rating {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  width: auto !important;
  clip: auto !important;
  position: relative !important;
}

/* My Account: show login + register side-by-side on desktop, stacked on mobile */
body.woocommerce-account #customer_login {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

body.woocommerce-account .ms-login-my-account,
body.woocommerce-account .ms-register-account {
  width: 100%;
}

body.woocommerce-account .woocommerce-form-register {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Product review stars visibility & simple spacing (keep Woo default styling) */
body.single-product #review_form .comment-form-rating {
  margin: 10px 0;
}

body.single-product #review_form p.stars {
  margin: 6px 0 12px;
}

/* Reviews: force visibility if any theme CSS hides it */
body.single-product #reviews form#commentform .comment-form-rating,
body.single-product #reviews form#commentform .comment-form-comment,
body.single-product #reviews form#commentform .comment-form-author,
body.single-product #reviews form#commentform .comment-form-email,
body.single-product #reviews form#commentform p.stars {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  overflow: visible !important;
}

body.single-product #reviews form#commentform p.stars {
  display: inline-block !important;
  margin: 6px 0 12px !important;
}

/* Hide plugin-injected duplicate rating row if present. */
body.single-product #reviews form#commentform .comment-form-rating.agh-rating {
  display: none !important;
}

/* Hide Customer Reviews (CR) extra rating blocks if injected. */
body.single-product #reviews #review_form_wrapper .cr-review-form-rating,
body.single-product #reviews #review_form_wrapper .cr-review-form-rating-overall,
body.single-product #reviews #review_form_wrapper .cr-onsite-ratings {
  display: none !important;
}

/* Woo stars styled to match CR star look (single row only). */
body.single-product #review_form p.stars {
  display: inline-flex !important;
  gap: 10px;
  align-items: center;
}

body.single-product #review_form p.stars a {
  width: 22px;
  height: 20px;
  font-size: 22px;
}

body.single-product #review_form p.stars a::before {
  color: #dfe4e7;
}

body.single-product #review_form p.stars:hover a::before,
body.single-product #review_form p.stars.selected a::before,
body.single-product #review_form p.stars a:hover::before,
body.single-product #review_form p.stars a.active::before {
  color: #f5cd5b;
}

body.single-product #review_form p.stars.selected a.active ~ a::before {
  color: #dfe4e7;
}

.ms-woo-main .price del,
.woocommerce div.product p.price del,
.woocommerce div.product span.price del,
.woocommerce ul.products li.product .price del {
  color: #f28e8e;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a,
.woocommerce div.product .woocommerce-tabs ul.tabs li a {
  color: var(--color-contrast-medium);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a,
.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.woocommerce-message a,
.woocommerce-info a,
.woocommerce-error a {
  color: var(--color-primary);
  text-decoration: underline;
}

.woocommerce-message a:hover,
.woocommerce-info a:hover,
.woocommerce-error a:hover {
  color: var(--color-primary-dark);
}

.woocommerce-cart .cart_totals table th,
.woocommerce-cart .cart_totals table td,
.woocommerce table.shop_table th,
.woocommerce table.shop_table td,
.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
  border-color: var(--color-border);
}

input,
select,
textarea {
  border-color: var(--color-border);
  background-color: var(--color-contrast-lower);
  color: var(--color-contrast-high);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(36, 62, 81, 0.1);
  outline: none;
}

.ms-shop-search {
  margin-bottom: 20px;
}

.ms-shop-search .search-field,
.ms-shop-search input[type="search"],
.ms-shop-search input[type="text"] {
  font-size: 14px;
  height: 40px;
  padding: 8px 12px;
}

.ms-shop-search button,
.ms-shop-search input[type="submit"] {
  height: 40px;
  padding: 0 14px;
  font-size: 13px;
  white-space: nowrap;
}

.ms-delivery-card {
  margin-top: 16px;
  margin-bottom: 20px;
  padding: 12px 0;
  background: transparent;
  border: none;
}

.ms-delivery-topline {
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-contrast-higher);
}

.ms-delivery-countdown {
  color: var(--color-contrast-higher);
  font-weight: 800;
}

.ms-delivery-date {
  color: var(--color-contrast-higher);
  font-weight: 800;
  text-decoration: underline;
}

.ms-delivery-list {
  list-style: none;
  padding: 12px 0 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.ms-delivery-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 12px;
  font-size: 15px;
  color: var(--color-contrast-higher);
}

.ms-delivery-icon {
  display: inline-flex;
  color: var(--color-contrast-high);
}

.ms-delivery-text {
  line-height: 1.5;
}

.ms-delivery-help {
  color: var(--color-contrast-medium);
  font-weight: 700;
  font-size: 15px;
}

.single-product .product_meta,
.single-product .nav-links,
.single-product .post-navigation,
.single-product .navigation.post-navigation {
  display: none !important;
}

/* Hide stray flex slider text nav under PDP gallery */
.single-product .flex-direction-nav {
  display: none !important;
}

.agh-color-attr select,
.agh-color-select {
  display: none !important;
}

.agh-color-swatches {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.agh-color-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.agh-color-label::after {
  content: '' !important;
}

.agh-color-attr select,
.agh-color-select,
.agh-color-attr .select2-container,
.agh-color-attr .nice-select,
.agh-color-attr .ms-variations--select > select {
  display: none !important;
}

.agh-color-attr > *:not(.agh-color-swatches),
.agh-color-attr .reset_variations {
  display: none !important;
}

.agh-color-swatch {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.agh-color-swatch:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(36, 62, 81, 0.25);
}

.agh-color-swatch .agh-color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--swatch-color, #ccc);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.06);
}

.agh-color-swatch.is-active {
  border-color: var(--color-primary);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.agh-color-swatch.is-active .agh-color-dot {
  box-shadow: inset 0 0 0 3px #fff;
}

.agh-variation-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease;
}

.agh-variation-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.98);
  min-width: 280px;
  max-width: 420px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  border-radius: 14px;
  padding: 18px 20px;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, transform 180ms ease;
}

.agh-variation-modal.is-visible,
.agh-variation-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

.agh-variation-modal.is-visible {
  transform: translate(-50%, -50%) scale(1);
}

.agh-variation-modal__title {
  font-weight: 800;
  font-size: 17px;
  color: var(--color-contrast-higher);
  margin-bottom: 10px;
}

.agh-variation-modal__body {
  color: var(--color-contrast-medium);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 16px;
}

.agh-variation-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.agh-variation-modal__btn {
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-contrast-high);
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background-color 140ms ease;
}

.agh-variation-modal__btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.agh-variation-modal__btn--primary {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: var(--color-primary);
}

.agh-variation-modal__btn--primary:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.agh-pdp-accordion {
  margin-top: 8px;
}

.agh-acc-item + .agh-acc-item {
  border-top: 1px solid var(--color-border);
}

.agh-acc-toggle {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-contrast-high);
  cursor: pointer;
}

.agh-acc-title {
  padding-left: 2px;
}

.agh-acc-caret {
  width: 10px;
  height: 10px;
  border-left: 2px solid var(--color-contrast-medium);
  border-bottom: 2px solid var(--color-contrast-medium);
  transform: rotate(-45deg);
  transition: transform 180ms ease, border-color 180ms ease;
  flex-shrink: 0;
}

.agh-acc-item.is-open .agh-acc-caret {
  transform: rotate(135deg);
  border-color: var(--color-primary);
}

.agh-acc-panel {
  padding: 4px 2px 14px;
  color: var(--color-contrast-medium);
  font-size: 15px;
  line-height: 1.7;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 220ms ease, opacity 220ms ease;
}

.agh-acc-item.is-open .agh-acc-panel {
  opacity: 1;
  max-height: 1200px;
}

.agh-acc-panel p {
  margin: 0 0 10px;
}

@media (max-width: 767px) {
  .ms-delivery-card,
  .ms-pdp-accordion {
    margin-top: 14px;
    margin-bottom: 16px;
  }

  .ms-delivery-topline,
  .ms-delivery-row {
    font-size: 19px;
  }
}

.agh-mobile-bottombar {
  display: none;
}

@media (max-width: 767px) {
  body {
    padding-bottom: 78px;
  }

  header,
  footer,
  .main-header,
  header.main-header,
  .ms-footer,
  .ms-footer--template,
  body > header,
  body > footer {
    display: none !important;
  }

  .agh-mobile-bottombar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 68px;
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    z-index: 9999;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    text-align: center;
    padding: 8px 0 6px;
  }

  .agh-mobile-bottombar .agh-tab {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--color-contrast-high);
    font-size: 12px;
    text-decoration: none;
    position: relative;
    transition: color 150ms ease;
  }

  .agh-mobile-bottombar .agh-tab .icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .agh-mobile-bottombar .agh-tab .icon img {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(16%) sepia(16%) saturate(878%) hue-rotate(165deg) brightness(92%) contrast(88%);
  }

  .agh-mobile-bottombar .agh-tab .badge {
    position: absolute;
    top: -4px;
    right: 20%;
    background: var(--color-primary);
    color: #fff;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    line-height: 16px;
    border-radius: 999px;
    padding: 0 3px;
  }

  .agh-mobile-bottombar .agh-tab:hover,
  .agh-mobile-bottombar .agh-tab.is-active {
    color: var(--color-primary);
    font-weight: 700;
  }
}

@media (min-width: 768px) {
  .agh-mobile-bottombar {
    display: none !important;
  }
}
