/* Method Wine — Commerce7 Frontend V2 / hosted Storefront.
   Load through Appearance > Custom CSS File URL, after Commerce7's styles.
   Keep controls, validation, disabled states and responsive layout owned by C7. */

:root {
  color-scheme: dark;

  --c7-font-family: Arial, Helvetica, sans-serif;
  --c7-font-size: 16px;
  --c7-font-size-sub: 14px;
  --c7-body-text-color: #eee8dd;
  --c7-alt-text-color: #b8ac98;
  --c7-heading-font-family: Georgia, "Times New Roman", serif;
  --c7-heading-text-color: #d0af7c;
  --c7-heading-font-weight: 400;

  --c7-primary-color: #d0af7c;
  --c7-primary-color-text: #d0af7c;
  --c7-primary-color-dark: #e5c999;
  --c7-primary-color-focus: rgba(208, 175, 124, 0.38);
  --c7-link-color: #d0af7c;
  --c7-bg: #111111;
  --c7-bg-alt: #1b1b18;
  --c7-border-color: #4b453a;
  --c7-border-radius: 2px;

  --c7-loading-bg: rgba(17, 17, 17, 0.78);
  --c7-modal-border-radius: 2px;
  --c7-modal-shadow: 0 18px 70px rgba(0, 0, 0, 0.65);
  --c7-overlay-bg: rgba(0, 0, 0, 0.72);
  --c7-progress-bar: #d0af7c;
  --c7-pill-bg: #302b22;
  --c7-pill-text-color: #e5c999;

  --c7-field-bg: #1b1b18;
  --c7-field-border-radius: 2px;
  --c7-field-border-color: #82745e;
  --c7-field-focus-color: rgba(208, 175, 124, 0.38);
  --c7-field-focus-border-color: #e5c999;
  --c7-field-option-selected-color: #d0af7c;
  --c7-field-option-focus-color: rgba(208, 175, 124, 0.38);
  --c7-field-placeholder: #a59c8c;
  --c7-field-dropdown-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);

  --c7-primary-button-bg: #d0af7c;
  --c7-primary-button-bg-hover: #e5c999;
  --c7-primary-button-text-color: #111111;
  --c7-alt-button-bg: #353128;
  --c7-alt-button-bg-hover: #494131;
  --c7-alt-button-text-color: #eee8dd;
  --c7-button-border-radius: 2px;

  /* Semantic messages retain their separate colors. */
  --c7-info-bg: #272720;
  --c7-error: #ffaaaa;
  --c7-error-bg: #3a2022;
  --c7-warning: #f0c27d;
  --c7-warning-bg: #352c1b;
  --c7-success: #9ad8b9;
  --c7-success-bg: #1d3228;

  --c7-header-text-color: #d0af7c;
  --c7-notification: #ffaaaa;
  --c7-cart-count-bg: #d0af7c;
  --c7-cart-count-bg-focus: rgba(208, 175, 124, 0.38);
  --c7-cart-count-text-color: #111111;
  --c7-side-cart-shadow: 0 0 35px rgba(0, 0, 0, 0.65);
  --c7-dropdown-border-radius: 2px;
  --c7-dropdown-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
  --c7-dropdown-hover: #302b22;

  --c7-block-bg: #191918;
  --c7-block-border-color: #4b453a;
  --c7-block-border-radius: 2px;
  --c7-block-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html,
body {
  background-color: var(--c7-bg);
  color: var(--c7-body-text-color);
}

header.storefront-header,
footer.storefront-footer {
  background-color: var(--c7-bg);
  color: var(--c7-header-text-color);
}

header.storefront-header nav a,
footer.storefront-footer .footer__nav a {
  color: #d0af7c;
}

header.storefront-header nav a:hover,
footer.storefront-footer .footer__nav a:hover {
  color: #f0d1a0;
}

/* This is the original black-on-white Method logo, unchanged as a file. */
header.storefront-header .logo img {
  filter: invert(1) brightness(0.65) sepia(1) saturate(1.4)
    hue-rotate(355deg) brightness(0.88);
  mix-blend-mode: screen;
}

#main-content.page-content {
  background-color: var(--c7-bg);
}

/* Personalization copy sits outside the standard C7 heading classes. */
#main-content.page-content h2,
#main-content.page-content h3 {
  color: var(--c7-heading-text-color);
  font-family: var(--c7-heading-font-family);
  font-weight: var(--c7-heading-font-weight);
}

.c7-side-cart {
  box-shadow: var(--c7-side-cart-shadow);
}

/* The native keyboard focus remains visible without replacing input rules. */
.c7-btn:not([disabled]):focus-visible,
.c7-link:not([disabled]):focus-visible,
header.storefront-header a:focus-visible,
header.storefront-header .nav-toggle-open:focus-visible,
header.storefront-header .nav-toggle-close:focus-visible,
footer.storefront-footer a:focus-visible,
.c7-side-cart__header button:focus-visible,
.c7-modal__header button:focus-visible {
  outline: 2px solid #e5c999;
  outline-offset: 4px;
}

header.storefront-header .skip-link {
  background-color: #d0af7c;
  color: #111111;
}

/* Core C7 has hardcoded black hover strokes on these close icons. */
.c7-side-cart__header button svg,
.c7-modal__header button svg {
  stroke: var(--c7-alt-text-color);
}

.c7-side-cart__header button:hover svg,
.c7-side-cart__header button:active svg,
.c7-side-cart__header button:focus svg,
.c7-modal__header button:hover svg,
.c7-modal__header button:active svg,
.c7-modal__header button:focus svg {
  stroke: #e5c999;
}

/* Preserve the checked state while making its white SVG legible on gold. */
.c7-checkbox input[type="checkbox"]:checked + .c7-checkbox__control::after {
  filter: brightness(0);
}

/* The template's back arrow is a dark, embedded SVG. */
.c7-back::before {
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

/* Keep the provider's light button readable if Facebook login is enabled. */
.c7-account-login__alt-login--facebook button {
  color: #232324;
}

/* These subscription controls have hardcoded white backgrounds in C7. */
.c7-club-months__options .c7-radio--box,
.c7-club-months__options .c7-radio--box:hover,
.c7-club-months__options .c7-radio--box:focus {
  background: var(--c7-field-bg);
}

.c7-club-months__options .c7-radio--box--selected,
.c7-club-months__options .c7-radio--box--selected:hover,
.c7-club-months__options .c7-radio--box--selected:focus {
  background: var(--c7-pill-bg);
}

.c7-club-months__options .c7-radio--box:focus-visible {
  outline: 2px solid #e5c999;
  outline-offset: 3px;
}

/* Retain error borders when the template adds its normal input focus color. */
.c7-form input[aria-invalid="true"]:focus:not([disabled]),
.c7-form select[aria-invalid="true"]:focus:not([disabled]),
.c7-form textarea[aria-invalid="true"]:focus:not([disabled]) {
  border-color: var(--c7-error);
}

/* The two Method wines use C7's native product-list grid. */
#main-content .c7-product-collection__product-list {
  grid-template-columns: minmax(0, 1fr);
  column-gap: 48px;
  row-gap: 56px;
}

#main-content .c7-product-collection__product-list > .c7-product {
  min-width: 0;
}

/* Match visible bottle height despite the California PNG's square canvas.
   The 140px window clips only transparent space from its centered image. */
#main-content .c7-product-collection__product-list .c7-product > .c7-product__image {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 140px;
  width: 140px;
  height: 300px;
  overflow: hidden;
}

#main-content .c7-product-collection__product-list .c7-product__image > a,
#main-content .c7-product-collection__product-list .c7-product__image > a > picture {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
}

#main-content .c7-product-collection__product-list .c7-product__image > a > picture > img {
  display: block;
  height: 300px;
  width: auto;
  max-height: 300px;
  max-width: none;
  flex-shrink: 0;
  object-fit: contain;
}

/* Keep a visible ring outside the clipped image window. */
#main-content .c7-product-collection__product-list .c7-product__image:focus-within {
  outline: 2px solid #e5c999;
  outline-offset: 4px;
}

@media (min-width: 900px) {
  #main-content .c7-product-collection__product-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 769px) {
  #main-content .c7-product-collection__product-list .c7-product > .c7-product__image {
    margin: 0 24px 0 0;
  }
}

@media (max-width: 768px) {
  #main-content .c7-product-collection__product-list .c7-product > .c7-product__image {
    margin: 0 auto 24px;
  }
}
