/*
Theme Name: GOYA Elementor Child
Theme URI: https://goya.vn
Description: Child theme GOYA tối ưu cho Elementor và WooCommerce.
Author: GOYA Việt Nam
Template: hello-elementor
Version: 1.1.0
Text Domain: goya-elementor-child
*/

:root {
  --goya-red: #d9000d;
  --goya-black: #111111;
  --goya-yellow: #f4d000;
  --goya-light: #f5f5f5;
  --goya-border: #dedede;
  --goya-font-sans: "Nunito Sans", Arial, Helvetica, sans-serif;
  --goya-title-h1: clamp(30px, 3.8vw, 44px);
  --goya-title-h2: clamp(25px, 2.8vw, 34px);
  --goya-title-h3: clamp(20px, 2vw, 27px);
}

html { scroll-behavior: smooth; }
body,
button,
input,
select,
textarea {
  color: var(--goya-black);
  font-family: var(--goya-font-sans);
}

/* Đồng bộ typography với Supersports, kể cả widget Elementor và WooCommerce. */
body.goya-storefront,
body.goya-storefront .elementor,
body.goya-storefront .elementor-widget,
body.goya-storefront .woocommerce,
body.goya-storefront button,
body.goya-storefront input,
body.goya-storefront select,
body.goya-storefront textarea,
body.goya-storefront .elementor-button,
body.goya-storefront .elementor-heading-title,
body.goya-storefront .woocommerce :where(h1, h2, h3, h4, h5, h6, p, a, label, button, input, select, textarea, th, td) {
  font-family: var(--goya-font-sans) !important;
}

body.goya-storefront :where(h1, h2, h3, h4, h5, h6) {
  font-family: var(--goya-font-sans) !important;
  font-weight: 800;
  line-height: 1.18;
}

body.goya-storefront h1,
body.goya-storefront .entry-title,
body.goya-storefront .page-title { font-size: var(--goya-title-h1); letter-spacing: -.025em; }
body.goya-storefront h2 { font-size: var(--goya-title-h2); letter-spacing: -.02em; }
body.goya-storefront h3 { font-size: var(--goya-title-h3); letter-spacing: -.015em; }

a { color: inherit; }
::selection { background: var(--goya-yellow); color: var(--goya-black); }

.goya-container {
  margin-inline: auto;
  max-width: 1440px;
  padding-inline: 40px;
}

.site-main { overflow: hidden; }
.woocommerce .button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button {
  background: var(--goya-black);
  border-radius: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  min-height: 48px;
  padding: 16px 22px;
  text-transform: uppercase;
}

.woocommerce .button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button:hover {
  background: var(--goya-red);
  color: #fff;
}

.woocommerce ul.products {
  display: grid;
  gap: 36px 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.woocommerce ul.products::before,
.woocommerce ul.products::after { display: none; }
.woocommerce ul.products li.product { float: none; margin: 0; width: auto; }
.woocommerce ul.products li.product a img { background: var(--goya-light); margin: 0 0 16px; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { color: var(--goya-black); font-size: 15px; font-weight: 800; line-height: 1.55; padding: 0; }
.woocommerce ul.products li.product .price { color: var(--goya-red); font-size: 15px; font-weight: 800; }
.woocommerce span.onsale { background: var(--goya-black); border-radius: 0; font-size: 11px; left: 12px; line-height: 1; min-height: 0; min-width: 0; padding: 8px 10px; top: 12px; }

.woocommerce div.product .product_title { font-size: clamp(27px, 3vw, 38px); font-weight: 800; line-height: 1.12; }
.woocommerce div.product p.price,
.woocommerce div.product span.price { color: var(--goya-red); font-size: 26px; font-weight: 900; }
.woocommerce div.product form.cart .button { background: var(--goya-red); min-height: 56px; }
.woocommerce div.product form.cart .button:hover { background: var(--goya-black); }
.woocommerce div.product .woocommerce-product-gallery__wrapper { background: var(--goya-light); }

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
  border: 1px solid var(--goya-border);
  border-radius: 0;
  min-height: 48px;
  padding: 12px 14px;
}

.woocommerce-checkout #payment { background: var(--goya-light); border-radius: 0; }
.woocommerce-checkout #payment ul.payment_methods { border-bottom-color: var(--goya-border); }

@media (max-width: 1024px) {
  .goya-container { padding-inline: 24px; }
  .woocommerce ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .goya-container { padding-inline: 16px; }
  .woocommerce ul.products { gap: 28px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 13px; }
  body.goya-storefront h1,
  body.goya-storefront .entry-title,
  body.goya-storefront .page-title { font-size: 30px; }
  body.goya-storefront h2 { font-size: 25px; }
  body.goya-storefront h3 { font-size: 21px; }
  .woocommerce div.product .product_title { font-size: 27px; }
}

/* GOYA — Mobile checkout: address card and shipping layout */
@media (max-width: 767px) {

  /* 1. Thẻ địa chỉ: nội dung co giãn, nút nằm trong khung */
  body.woocommerce-checkout.goya-checkout-experience
  .gce-address-card {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 8px 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 16px !important;
  }

  body.woocommerce-checkout.goya-checkout-experience
  .gce-address-card > * {
    box-sizing: border-box !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body.woocommerce-checkout.goya-checkout-experience
  .gce-address-card > div {
    grid-column: 2 !important;
    overflow-wrap: anywhere;
  }

  body.woocommerce-checkout.goya-checkout-experience
  .gce-address-card .gce-edit {
    position: static !important;
    float: none !important;
    grid-column: 2 / -1 !important;
    grid-row: auto !important;
    justify-self: start !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;

    width: auto !important;
    max-width: 100% !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 6px 0 !important;

    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    text-align: left !important;
    transform: none !important;
  }

  /* 2. Bảng tổng tiền: dùng lưới riêng cho từng dòng trên Mobile */
  body.woocommerce-checkout.goya-checkout-experience
  form.checkout #order_review table.g168-totals,
  body.woocommerce-checkout.goya-checkout-experience
  form.checkout #order_review table.g168-totals > tbody,
  body.woocommerce-checkout.goya-checkout-experience
  form.checkout #order_review table.g168-totals > tfoot {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body.woocommerce-checkout.goya-checkout-experience
  form.checkout #order_review table.g168-totals tr {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    align-items: start !important;
    column-gap: 12px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.woocommerce-checkout.goya-checkout-experience
  form.checkout #order_review table.g168-totals tr > th,
  body.woocommerce-checkout.goya-checkout-experience
  form.checkout #order_review table.g168-totals tr > td {
    display: block !important;
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Dòng thông báo/ghi chú vốn dùng colspan vẫn chiếm cả hàng */
  body.woocommerce-checkout.goya-checkout-experience
  form.checkout #order_review table.g168-totals tr > [colspan="2"] {
    grid-column: 1 / -1 !important;
  }

  /* Chỉ trạng thái CHỜ XÁC NHẬN chuyển sang bố cục hai hàng */
  body.woocommerce-checkout.goya-checkout-experience
  form.checkout #order_review table.g168-totals tr:has(.g168-pending) {
    grid-template-columns: minmax(0, 1fr) !important;
    row-gap: 6px !important;
  }

  body.woocommerce-checkout.goya-checkout-experience
  form.checkout #order_review table.g168-totals
  tr:has(.g168-pending) > th {
    padding-bottom: 0 !important;
    text-align: left !important;
  }

  body.woocommerce-checkout.goya-checkout-experience
  form.checkout #order_review table.g168-totals
  tr:has(.g168-pending) > td {
    padding-top: 0 !important;
    text-align: left !important;
  }

  body.woocommerce-checkout.goya-checkout-experience
  form.checkout #order_review table.g168-totals .g168-pending {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;

    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    text-align: left !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    text-wrap: balance;
  }
}