@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500&display=swap');

/* ELEMENTOR - ancho completo */
.elementor-widget-html,
.elementor-widget-container,
.elementor-column-wrap,
.elementor-column,
.elementor-row,
.elementor-section,
.elementor-section-wrap,
.e-con,
.e-con-inner {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}
.elementor-section.elementor-section-boxed > .elementor-container {
  max-width: 100% !important;
}

/* VARIABLES */
:root {
  --mg-red: #ED1C24;
  --mg-red-hover: #CC000F;
  --mg-black: #231F20;
  --mg-white: #FAFAFA;
  --mg-grey: #C8C8C8;
  --mg-border: #E5E7EB;
}

/* TIPOGRAFÍA GLOBAL */
body, p, span, input, select, textarea, button, a {
  font-family: 'DM Sans', sans-serif !important;
  color: var(--mg-black);
}
h1, h2, h3, h4 {
  font-family: 'DM Serif Display', serif !important;
  font-weight: 400 !important;
}
body { background: #FAFAFA !important; }
.site-header { background: #FAFAFA !important; border-bottom: 0.5px solid var(--mg-border) !important; }

/* BOTONES WOOCOMMERCE */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce button.button.alt,
.woocommerce a.button.alt {
  background-color: var(--mg-red) !important;
  color: #fff !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  border-radius: 8px !important;
  border: none !important;
  padding: 13px 26px !important;
  transition: background .25s, box-shadow .25s !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce button.button.alt:hover,
.woocommerce a.button.alt:hover {
  background-color: var(--mg-red-hover) !important;
  box-shadow: 0 4px 10px rgba(230,0,18,.25) !important;
  color: #fff !important;
}

/* TABLA CARRITO */
.woocommerce-cart table.cart,
.woocommerce table.shop_table {
  border: 0.5px solid var(--mg-border) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  border-collapse: separate !important;
}
.woocommerce-cart table.cart th,
.woocommerce table.shop_table th {
  font-family: 'DM Serif Display', serif !important;
  font-weight: 400 !important;
  font-size: 14px !important;
  background: #EBEBEB !important;
  border-bottom: 0.5px solid var(--mg-border) !important;
  padding: 16px !important;
}
.woocommerce-cart table.cart td,
.woocommerce table.shop_table td {
  padding: 16px !important;
  border-bottom: 0.5px solid var(--mg-border) !important;
  vertical-align: middle !important;
}
.woocommerce-cart table.cart td.product-thumbnail img {
  border-radius: 8px !important;
  border: 0.5px solid var(--mg-border) !important;
  padding: 4px !important;
  background: #F4F4F4 !important;
}
.woocommerce-cart table.cart a.remove {
  color: var(--mg-grey) !important;
  font-size: 18px !important;
}
.woocommerce-cart table.cart a.remove:hover {
  background: var(--mg-red) !important;
  color: #fff !important;
}

/* TOTALES */
.woocommerce-cart .cart_totals h2,
.woocommerce-checkout h3 {
  font-family: 'DM Serif Display', serif !important;
  font-size: 24px !important;
  margin-bottom: 20px !important;
}
.woocommerce .cart_totals table {
  border: 0.5px solid var(--mg-border) !important;
  border-radius: 12px !important;
}

/* INPUTS */
.woocommerce input[type="text"],
.woocommerce input[type="email"],
.woocommerce input[type="tel"],
.woocommerce input[type="number"],
.woocommerce textarea,
.woocommerce select {
  border: 0.5px solid var(--mg-grey) !important;
  border-radius: 8px !important;
  padding: 12px 16px !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 14px !important;
  background: #fff !important;
}
.woocommerce input[type="text"]:focus,
.woocommerce input[type="email"]:focus,
.woocommerce input[type="tel"]:focus,
.woocommerce textarea:focus {
  border-color: var(--mg-red) !important;
  outline: none !important;
  box-shadow: none !important;
}

/* PRECIO */
.woocommerce .price,
.woocommerce-Price-amount {
  color: var(--mg-black) !important;
  font-weight: 500 !important;
  font-size: 18px !important;
}

/* NOTIFICACIONES */
.woocommerce-message,
.woocommerce-info {
  background: #FAFAFA !important;
  border-top: 3px solid var(--mg-red) !important;
  color: var(--mg-black) !important;
  border-radius: 0 0 8px 8px !important;
}
.woocommerce-message a.button,
.woocommerce-info a.button {
  background: var(--mg-red) !important;
}

/* BREADCRUMB */
.woocommerce .woocommerce-breadcrumb {
  font-size: 12px !important;
  color: var(--mg-grey) !important;
}
.woocommerce .woocommerce-breadcrumb a { color: var(--mg-grey) !important; }
.woocommerce .woocommerce-breadcrumb a:hover { color: var(--mg-red) !important; }

/* ===================== */
/* CHECKOUT LAYOUT       */
/* ===================== */
.woocommerce-checkout form.woocommerce-checkout {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 48px !important;
  align-items: start !important;
  float: none !important;
}
.woocommerce-checkout .woocommerce-NoticeGroup-checkout,
.woocommerce-checkout .woocommerce-form-coupon-toggle,
.woocommerce-checkout .woocommerce-info {
  grid-column: 1 / -1 !important;
}
.woocommerce-checkout .col2-set {
  grid-column: 1 !important;
  width: 100% !important;
  float: none !important;
}
.woocommerce-checkout .col2-set .col-1,
.woocommerce-checkout .col2-set .col-2 {
  width: 100% !important;
  float: none !important;
}
.woocommerce-checkout #order_review_heading {
  grid-column: 2 !important;
  grid-row: 2 !important;
  width: 100% !important;
  float: none !important;
}
.woocommerce-checkout #order_review {
  grid-column: 2 !important;
  grid-row: 2 !important;
  margin-top: 52px !important;
  width: 100% !important;
  float: none !important;
}
.woocommerce-checkout #payment {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  float: none !important;
  box-sizing: border-box !important;
  background: #fff !important;
  border: 0.5px solid var(--mg-border) !important;
  border-radius: 12px !important;
  padding: 24px !important;
}
.woocommerce-checkout #payment ul.payment_methods {
  list-style: none !important;
  padding: 0 !important;
  margin-bottom: 16px !important;
  border-bottom: 0.5px solid var(--mg-border) !important;
  padding-bottom: 16px !important;
}
.woocommerce-checkout #payment ul.payment_methods li {
  padding: 10px 0 !important;
  font-size: 14px !important;
}
.woocommerce-checkout #payment #place_order {
  width: 100% !important;
  background: var(--mg-red) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 16px !important;
  font-family: 'DM Serif Display', serif !important;
  font-size: 20px !important;
  cursor: pointer !important;
  transition: background .25s !important;
  margin-top: 16px !important;
}
.woocommerce-checkout #payment #place_order:hover {
  background: var(--mg-red-hover) !important;
}

/* Imágenes en resumen checkout */
.woocommerce-checkout-review-order-table img {
  width: 48px !important;
  height: 48px !important;
  object-fit: contain !important;
  border-radius: 6px !important;
  border: 0.5px solid var(--mg-border) !important;
  background: #F4F4F4 !important;
  margin-right: 10px !important;
  vertical-align: middle !important;
}

@media(max-width:768px) {
  .woocommerce-checkout form.woocommerce-checkout {
    grid-template-columns: 1fr !important;
  }
  .woocommerce-checkout .col2-set,
  .woocommerce-checkout #order_review_heading,
  .woocommerce-checkout #order_review,
  .woocommerce-checkout #payment {
    grid-column: 1 !important;
    grid-row: auto !important;
    margin-top: 0 !important;
  }
}
/* M&G - Fix cantidad carrito */
.woocommerce-cart table.cart td.product-quantity input[type="number"] {
  -webkit-appearance: textfield !important;
  -moz-appearance: textfield !important;
  appearance: textfield !important;
  text-align: center !important;
  width: 60px !important;
  height: 40px !important;
  padding: 8px !important;
  font-size: 16px !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}
.woocommerce-cart table.cart td.product-quantity input[type="number"]::-webkit-inner-spin-button,
.woocommerce-cart table.cart td.product-quantity input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}
/* Fix iconos WooCommerce que se montan sobre el texto */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-notice {
  padding-left: 50px !important;
  position: relative !important;
}
.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before,
.woocommerce-notice::before {
  position: absolute !important;
  left: 18px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 16px !important;
}
/* Forzar que se vea la foto del producto en el carrito en móviles (MÁS GRANDE) */
@media screen and (max-width: 768px) {
    .woocommerce-cart table.cart .product-thumbnail {
        display: block !important;
        text-align: center !important;
        padding-bottom: 15px !important;
        border-bottom: none !important;
    }
    .woocommerce-cart table.cart .product-thumbnail::before {
        display: none !important; /* Oculta la etiqueta de texto automática */
    }
    .woocommerce-cart table.cart .product-thumbnail img {
        display: inline-block !important;
        width: 120px !important; /* <--- AQUÍ REGULAS EL TAMAÑO */
        max-width: 100% !important;
        height: auto !important;
        border-radius: 8px;
        border: 0.5px solid #E5E7EB;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Un toquecito de sombra elegante */
    }
}
/* =====================================================
   M&G - UNIFICAR TAMAÑO VISUAL DE IMÁGENES
   不改文字大小，只统一产品图片区域
   ===================================================== */

/* 产品卡片图片区域固定高度 */
.mg-card-img {
  width: 100% !important;
  height: 360px !important;
  min-height: 360px !important;
  max-height: 360px !important;
  background: #F4F4F4 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 28px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* 图片本身统一放进同一个视觉框，不裁切 */
.mg-card-img img,
.mg-card-img > img {
  width: 100% !important;
  height: 100% !important;
  max-width: 92% !important;
  max-height: 92% !important;
  object-fit: contain !important;
  object-position: center center !important;
  display: block !important;
  margin: auto !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  image-rendering: auto !important;
}

/* 恢复你要的 hover 放大，但不要太夸张，避免裁太多 */
.mg-card-img:hover img,
.mg-card:hover .mg-card-img img {
  transform: scale(1.08) !important;
  transition: transform .28s ease !important;
}

/* 卡片高度稍微统一，但不改字体 */
.mg-card {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* 文字区保持结构稳定，不改字体大小 */
.mg-card-body {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
}

/* 价格和按钮尽量对齐到底部 */
.mg-card-price {
  margin-top: auto !important;
}

/* WooCommerce 原生产品图也统一，不影响文字 */
.woocommerce ul.products li.product a img,
.woocommerce-page ul.products li.product a img {
  height: 360px !important;
  max-height: 360px !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: #F4F4F4 !important;
  padding: 28px !important;
  box-sizing: border-box !important;
}

/* 移动端 */
@media (max-width: 768px) {
  .mg-card-img {
    height: 280px !important;
    min-height: 280px !important;
    max-height: 280px !important;
    padding: 22px !important;
  }

  .woocommerce ul.products li.product a img,
  .woocommerce-page ul.products li.product a img {
    height: 280px !important;
    max-height: 280px !important;
    padding: 22px !important;
  }
}
/* MENÚ MÓVIL RÁPIDO */
.mg-mobile-menu-btn {
  display: none;
  background: transparent !important;
  border: none !important;
  font-size: 30px !important;
  color: #231F20 !important;
  cursor: pointer !important;
  padding: 6px 10px !important;
  margin-left: auto !important;
}

@media (max-width: 768px) {
  .mg-mobile-menu-btn {
    display: inline-flex !important;
  }

  .mg-nav {
    flex-wrap: wrap !important;
  }

  .mg-nav-links {
    display: none !important;
    width: 100% !important;
    flex-direction: column !important;
    background: #FAFAFA !important;
    border-top: 0.5px solid #E5E7EB !important;
    margin-top: 12px !important;
    padding: 12px 0 !important;
  }

  .mg-nav-links.open {
    display: flex !important;
  }

  .mg-nav-links li {
    width: 100% !important;
    list-style: none !important;
  }

  .mg-nav-links a {
    display: block !important;
    width: 100% !important;
    padding: 14px 0 !important;
    font-size: 16px !important;
    text-decoration: none !important;
    color: #231F20 !important;
    border-bottom: 0.5px solid #E5E7EB !important;
  }
}
/* Ordenar mini - derecha */
.mg-sort-mini {
  width: 100% !important;
  display: flex !important;
  justify-content: flex-end !important;
  padding: 0 48px 18px !important;
  background: #FAFAFA !important;
  box-sizing: border-box !important;
}

.mg-sort-mini select {
  width: 150px !important;
  height: 38px !important;
  border: 0.5px solid #C8C8C8 !important;
  border-radius: 8px !important;
  background: #fff !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 13px !important;
  color: #231F20 !important;
  padding: 0 10px !important;
  cursor: pointer !important;
  outline: none !important;
}

@media (max-width: 768px) {
  .mg-sort-mini {
    padding: 0 20px 16px !important;
  }

  .mg-sort-mini select {
    width: 135px !important;
    font-size: 12px !important;
  }
}
/* ===== FIX WPForms Nombre / Apellidos ===== */

.wpforms-field-name .wpforms-field-row {
  display: flex !important;
  gap: 16px !important;
  width: 100% !important;
  max-width: 100% !important;
}

.wpforms-field-name .wpforms-field-row-block {
  width: calc(50% - 8px) !important;
  max-width: calc(50% - 8px) !important;
  flex: 0 0 calc(50% - 8px) !important;
  padding: 0 !important;
  margin: 0 !important;
}

.wpforms-field-name .wpforms-field-row-block input {
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
}

.wpforms-field-name .wpforms-field-sublabel {
  display: block !important;
  margin-top: 8px !important;
  font-size: 13px !important;
  color: #777 !important;
  font-family: 'DM Sans', sans-serif !important;
}

/* 手机端姓名恢复上下排列 */
@media (max-width: 768px) {
  .wpforms-field-name .wpforms-field-row {
    display: block !important;
  }

  .wpforms-field-name .wpforms-field-row-block {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    margin-bottom: 14px !important;
  }
}


