/*
Theme Name: The Good Master
Theme URI: https://thegoodmaster.cl/
Author: The Good Master
Description: Tema corporativo y comercial para servicios de automatización, domótica, control de acceso y venta de productos mediante WooCommerce.
Version: 1.2.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: the-good-master
*/

:root {
  --tgm-black: #070707;
  --tgm-dark: #12110f;
  --tgm-gold: #d9aa54;
  --tgm-gold-deep: #b78432;
  --tgm-cream: #f6f2ea;
  --tgm-white: #fff;
  --tgm-gray: #6e6a63;
  --tgm-border: rgba(217,170,84,.26);
  --tgm-radius: 22px;
  --tgm-shadow: 0 20px 60px rgba(0,0,0,.13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--tgm-dark); background: var(--tgm-cream); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.65; }
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link:focus { clip: auto; width: auto; height: auto; padding: 12px 18px; margin: 10px; z-index: 9999; background: #fff; color: #000; }

.topbar { background: var(--tgm-gold); color: #17120b; font-size: .87rem; font-weight: 700; }
.topbar__inner { min-height: 38px; display: flex; justify-content: flex-end; align-items: center; gap: 24px; }
.topbar a:hover { text-decoration: underline; }
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(7,7,7,.96); border-bottom: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(14px); }
.header__inner { min-height: 92px; display: flex; align-items: center; gap: 32px; }
.site-branding { margin-right: auto; }
.site-logo { width: 310px; max-height: 74px; object-fit: contain; object-position: left center; }
.primary-menu { display: flex; align-items: center; gap: 30px; list-style: none; margin: 0; padding: 0; color: #fff; font-size: .9rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.primary-menu a { position: relative; padding: 12px 0; }
.primary-menu a::after { content: ""; position: absolute; left: 0; bottom: 5px; width: 0; height: 2px; background: var(--tgm-gold); transition: width .2s ease; }
.primary-menu a:hover::after, .primary-menu .current-menu-item a::after { width: 100%; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.cart-link { color: #fff; display: inline-flex; align-items: center; gap: 7px; font-weight: 800; }
.cart-count { min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--tgm-gold); color: #111; font-size: .75rem; }
.menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.25); border-radius: 12px; background: transparent; color: #fff; font-size: 1.4rem; }

.button, .wp-element-button, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 50px; padding: 0 24px; border: 1px solid var(--tgm-gold); border-radius: 999px; background: var(--tgm-gold); color: #16120b; font-weight: 850; letter-spacing: .02em; line-height: 1.2; text-align: center; box-shadow: 0 8px 22px rgba(183,132,50,.2); transition: transform .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease; cursor: pointer; }
.button:hover, .wp-element-button:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover { transform: translateY(-2px); background: #edc477; color: #16120b; box-shadow: 0 12px 28px rgba(183,132,50,.3); }
.button:focus-visible, .wp-element-button:focus-visible, .woocommerce a.button:focus-visible, .woocommerce button.button:focus-visible, .woocommerce input.button:focus-visible, .tgm-share-toggle:focus-visible, .tgm-share-option:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px var(--tgm-gold-deep); }
.woocommerce a.button:active, .woocommerce button.button:active, .woocommerce input.button:active { transform: translateY(0); box-shadow: 0 4px 12px rgba(183,132,50,.22); }
.woocommerce a.button.loading, .woocommerce button.button.loading { opacity: .72; pointer-events: none; }
.woocommerce a.button.added { background: var(--tgm-black); border-color: var(--tgm-black); color: #fff; }
.woocommerce a.added_to_cart { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; margin: 10px 0 0; padding: 0 20px; border: 2px solid var(--tgm-gold-deep); border-radius: 999px; color: var(--tgm-dark); font-weight: 850; }
.woocommerce a.added_to_cart:hover { background: var(--tgm-black); border-color: var(--tgm-black); color: #fff; }
.button--outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.button--outline:hover { background: #fff; color: #111; }
.button--dark { background: var(--tgm-black); border-color: var(--tgm-black); color: #fff; }

.hero { position: relative; overflow: hidden; min-height: 690px; color: #fff; background: radial-gradient(circle at 78% 34%, rgba(217,170,84,.24), transparent 28%), linear-gradient(115deg, #050505 0%, #13110e 58%, #050505 100%); }
.hero::after { content: ""; position: absolute; inset: 0; opacity: .09; background-image: linear-gradient(rgba(255,255,255,.8) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.8) 1px, transparent 1px); background-size: 72px 72px; mask-image: linear-gradient(to left, #000, transparent 76%); }
.hero__inner { position: relative; z-index: 2; min-height: 690px; display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 70px; padding-block: 80px; }
.eyebrow { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 16px; color: var(--tgm-gold); font-size: .82rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 34px; height: 2px; background: currentColor; }
.hero h1 { max-width: 760px; margin: 0; font-size: clamp(3rem, 6.3vw, 6rem); line-height: .96; letter-spacing: -.055em; }
.hero h1 span { color: var(--tgm-gold); }
.hero__copy > p:not(.eyebrow) { max-width: 650px; margin: 26px 0 32px; color: rgba(255,255,255,.73); font-size: 1.12rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero__visual { position: relative; display: grid; place-items: center; }
.hero__visual::before { content: ""; position: absolute; width: 470px; aspect-ratio: 1; border: 1px solid var(--tgm-border); border-radius: 50%; box-shadow: 0 0 0 45px rgba(217,170,84,.045), 0 0 0 90px rgba(217,170,84,.025); }
.hero__mark { position: relative; z-index: 2; width: min(390px, 88%); filter: drop-shadow(0 28px 45px rgba(0,0,0,.42)); }
.hero__badge { position: absolute; z-index: 3; right: -10px; bottom: 20px; width: 150px; padding: 19px; border: 1px solid var(--tgm-border); border-radius: 18px; background: rgba(7,7,7,.8); backdrop-filter: blur(10px); text-align: center; }
.hero__badge strong { display: block; color: var(--tgm-gold); font-size: 2.5rem; line-height: 1; }
.hero__badge span { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; }

.trust-strip { background: var(--tgm-gold); }
.trust-strip__grid { min-height: 102px; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; }
.trust-item { padding: 15px 26px; border-right: 1px solid rgba(0,0,0,.18); }
.trust-item:last-child { border-right: 0; }
.trust-item strong { display: block; font-size: 1rem; }
.trust-item span { font-size: .86rem; opacity: .73; }

.section { padding-block: 110px; }
.section--white { background: #fff; }
.section--dark { background: var(--tgm-black); color: #fff; }
.section-heading { max-width: 720px; margin-bottom: 48px; }
.section-heading h2 { margin: 0; font-size: clamp(2.2rem, 4vw, 4rem); line-height: 1.05; letter-spacing: -.045em; }
.section-heading p { color: var(--tgm-gray); font-size: 1.05rem; }
.section--dark .section-heading p { color: rgba(255,255,255,.62); }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service-card { position: relative; min-height: 310px; padding: 34px; overflow: hidden; border: 1px solid #e7dfd3; border-radius: var(--tgm-radius); background: #fff; box-shadow: 0 10px 35px rgba(30,20,7,.04); transition: transform .25s ease, box-shadow .25s ease; }
.service-card:hover { transform: translateY(-6px); box-shadow: var(--tgm-shadow); }
.service-card__number { color: var(--tgm-gold-deep); font-weight: 900; letter-spacing: .15em; }
.service-card h3 { margin: 62px 0 12px; font-size: 1.45rem; line-height: 1.15; }
.service-card p { margin: 0; color: var(--tgm-gray); }
.service-card::after { content: ""; position: absolute; right: -35px; top: -35px; width: 120px; height: 120px; border: 1px solid var(--tgm-border); border-radius: 50%; }

.about-grid { display: grid; grid-template-columns: .92fr 1.08fr; gap: 80px; align-items: center; }
.about-panel { position: relative; min-height: 520px; padding: 55px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 28px; color: #fff; background: linear-gradient(150deg, #1a1814, #050505); overflow: hidden; }
.about-panel img { position: absolute; width: 310px; top: 55px; left: 50%; transform: translateX(-50%); opacity: .94; }
.about-panel strong { position: relative; z-index: 2; color: var(--tgm-gold); font-size: 5rem; line-height: .85; }
.about-panel span { position: relative; z-index: 2; max-width: 220px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.about-copy h2 { margin: 0 0 22px; font-size: clamp(2.2rem, 4vw, 4rem); line-height: 1.06; letter-spacing: -.04em; }
.about-copy p { color: var(--tgm-gray); }
.check-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; list-style: none; padding: 0; margin: 28px 0 34px; }
.check-list li { display: flex; gap: 10px; align-items: center; font-weight: 750; }
.check-list li::before { content: "✓"; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--tgm-gold); color: #111; font-size: .8rem; }

.products-placeholder { padding: 48px; border: 1px dashed rgba(255,255,255,.25); border-radius: var(--tgm-radius); text-align: center; background: rgba(255,255,255,.035); }
.products-placeholder p { color: rgba(255,255,255,.65); }
.woocommerce ul.products li.product { padding: 18px; border-radius: 18px; background: #fff; }
.woocommerce ul.products li.product .price { color: var(--tgm-gold-deep); font-weight: 800; }
.woocommerce ul.products li.product .button { width: 100%; margin-top: 12px; }
.woocommerce div.product form.cart { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; }
.woocommerce div.product form.cart .quantity .qty { min-height: 50px; border: 1px solid #d9d2c7; border-radius: 14px; font: inherit; font-weight: 750; }
.woocommerce div.product form.cart .single_add_to_cart_button { min-width: 230px; }
.woocommerce .wc-proceed-to-checkout a.checkout-button, .woocommerce button[name="woocommerce_checkout_place_order"] { width: 100%; background: var(--tgm-gold); color: #16120b; }
.wc-block-components-button:not(.is-link) { min-height: 50px; border: 1px solid var(--tgm-gold); border-radius: 999px; background: var(--tgm-gold); color: #16120b; font-weight: 850; box-shadow: 0 8px 22px rgba(183,132,50,.2); transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
.wc-block-components-button:not(.is-link):hover { background: #edc477; color: #16120b; transform: translateY(-2px); box-shadow: 0 12px 28px rgba(183,132,50,.3); }
.wc-block-components-button:not(.is-link):focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px var(--tgm-gold-deep); }
.woocommerce-message, .woocommerce-info { border-top-color: var(--tgm-gold-deep); }
.woocommerce-message::before, .woocommerce-info::before { color: var(--tgm-gold-deep); }

/* Compartir productos */
.tgm-product-share { position: relative; clear: both; margin-top: 16px; }
.woocommerce ul.products .tgm-product-share { margin-top: 10px; }
.tgm-share-toggle { width: 100%; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; border: 2px solid var(--tgm-gold-deep); border-radius: 999px; background: transparent; color: var(--tgm-dark); font: inherit; font-weight: 850; cursor: pointer; transition: background .2s ease, color .2s ease, transform .2s ease; }
.tgm-share-toggle:hover, .tgm-product-share.is-open .tgm-share-toggle { background: var(--tgm-black); border-color: var(--tgm-black); color: #fff; transform: translateY(-1px); }
.tgm-share-options { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 8px); display: grid; gap: 7px; min-width: 210px; padding: 10px; border: 1px solid #e2d9ca; border-radius: 16px; background: #fff; box-shadow: var(--tgm-shadow); }
.tgm-share-options[hidden] { display: none; }
.tgm-share-option { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: center; padding: 8px 14px; border: 0; border-radius: 10px; color: #fff; font: inherit; font-size: .9rem; font-weight: 800; cursor: pointer; }
.tgm-share-option--facebook { background: #1877f2; }
.tgm-share-option--whatsapp { background: #168c46; }
.tgm-copy-link { background: var(--tgm-black); }
.tgm-share-option:hover { filter: brightness(1.08); color: #fff; }

.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: process; }
.process-card { position: relative; padding: 28px 0; border-top: 2px solid var(--tgm-gold); counter-increment: process; }
.process-card::before { content: "0" counter(process); display: block; margin-bottom: 45px; color: var(--tgm-gold-deep); font-weight: 900; letter-spacing: .1em; }
.process-card h3 { margin: 0 0 8px; }
.process-card p { color: var(--tgm-gray); }

.cta { padding-block: 80px; background: var(--tgm-gold); }
.cta__inner { display: flex; justify-content: space-between; align-items: center; gap: 40px; }
.cta h2 { max-width: 760px; margin: 0; font-size: clamp(2rem, 4vw, 3.7rem); line-height: 1.04; letter-spacing: -.045em; }
.cta p { margin: 12px 0 0; }

.page-header { padding: 90px 0 70px; background: var(--tgm-black); color: #fff; }
.page-header h1 { margin: 0; font-size: clamp(2.5rem, 5vw, 4.7rem); letter-spacing: -.045em; }
.content-area { padding-block: 80px; }
.entry-content { max-width: 850px; margin-inline: auto; }
.entry-content > *:first-child { margin-top: 0; }

.site-footer { padding: 76px 0 22px; background: #050505; color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr .7fr .9fr; gap: 70px; padding-bottom: 60px; }
.footer-logo { width: 340px; max-width: 100%; margin-bottom: 22px; }
.footer-brand p { max-width: 480px; color: rgba(255,255,255,.6); }
.site-footer h3 { margin: 5px 0 22px; color: var(--tgm-gold); font-size: .9rem; letter-spacing: .14em; text-transform: uppercase; }
.footer-menu, .footer-contact { list-style: none; padding: 0; margin: 0; }
.footer-menu li, .footer-contact li { margin-bottom: 12px; }
.footer-menu a, .footer-contact a { color: rgba(255,255,255,.78); }
.footer-menu a:hover, .footer-contact a:hover { color: var(--tgm-gold); }
.footer-bottom { padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); display: flex; justify-content: space-between; gap: 20px; color: rgba(255,255,255,.48); font-size: .85rem; }

@media (max-width: 980px) {
  .site-header { position: sticky; isolation: isolate; backdrop-filter: none; background: #070707; }
  .menu-toggle { display: grid; place-items: center; }
  .main-navigation { position: absolute; z-index: 999; top: 100%; left: 0; right: 0; width: 100%; height: calc(100vh - 130px); min-height: 480px; padding: 30px 24px 60px; overflow-y: auto; visibility: hidden; opacity: 0; pointer-events: none; background: #070707 !important; border-top: 1px solid rgba(255,255,255,.12); box-shadow: 0 24px 45px rgba(0,0,0,.55); transform: translateY(-12px); transition: opacity .2s ease, transform .2s ease, visibility .2s ease; }
  .menu-open .main-navigation { visibility: visible; opacity: 1; pointer-events: auto; transform: translateY(0); }
  .primary-menu { width: 100%; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 0; background: #070707 !important; font-size: 1.05rem; }
  .primary-menu li { width: 100%; margin: 0; border-bottom: 1px solid rgba(255,255,255,.12); background: #070707; }
  .primary-menu a { display: block; width: 100%; padding: 20px 4px; color: #fff; }
  .primary-menu a::after { bottom: 12px; }
  .header-actions .button { display: none; }
  .hero__inner, .about-grid { grid-template-columns: 1fr; }
  .hero__visual { min-height: 410px; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .container { width: min(100% - 28px, 1180px); }
  .topbar__inner { min-height: 42px; justify-content: center; gap: 14px; font-size: .69rem; }
  .topbar__inner a { white-space: nowrap; }
  .topbar__inner span { display: none; }
  .header__inner { min-height: 78px; }
  .site-logo { width: 220px; }
  .main-navigation { height: calc(100vh - 120px); min-height: 430px; }
  .hero, .hero__inner { min-height: auto; }
  .hero__inner { padding-block: 70px 55px; }
  .hero__visual::before { width: 300px; }
  .hero__visual { min-height: 330px; }
  .hero__badge { right: 0; width: 125px; }
  .trust-strip__grid { grid-template-columns: 1fr 1fr; }
  .trust-item { border-bottom: 1px solid rgba(0,0,0,.15); }
  .section { padding-block: 75px; }
  .services-grid, .process-grid, .check-list, .footer-grid { grid-template-columns: 1fr; }
  .about-grid { gap: 45px; }
  .about-panel { min-height: 430px; padding: 36px; }
  .cta__inner, .footer-bottom { align-items: flex-start; flex-direction: column; }
  .footer-brand { grid-column: auto; }
  .woocommerce div.product form.cart, .woocommerce div.product form.cart .single_add_to_cart_button { width: 100%; }
  .woocommerce div.product form.cart .quantity { width: 100%; }
  .woocommerce div.product form.cart .quantity .qty { width: 100%; }
  .tgm-share-options { position: static; margin-top: 8px; }
}

/* Página de contacto */
.contact-hero { padding: 90px 0 70px; background: radial-gradient(circle at 80% 20%, rgba(217,170,84,.2), transparent 28%), #070707; color: #fff; }
.contact-hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 80px; align-items: center; }
.contact-hero h1 { margin: 0 0 22px; font-size: clamp(2.7rem, 5vw, 5.2rem); line-height: .98; letter-spacing: -.05em; }
.contact-hero p:not(.eyebrow) { max-width: 640px; color: rgba(255,255,255,.68); font-size: 1.08rem; }
.contact-details { display: grid; gap: 14px; padding: 30px; border: 1px solid var(--tgm-border); border-radius: var(--tgm-radius); background: rgba(255,255,255,.035); }
.contact-details a, .contact-details span { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 720; }
.contact-details strong { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--tgm-gold); color: #111; font-size: .85rem; }
.contact-section { padding-block: 90px; background: #fff; }
.contact-layout { display: grid; grid-template-columns: .72fr 1.28fr; gap: 70px; align-items: start; }
.contact-intro h2 { margin: 0 0 18px; font-size: clamp(2rem, 3.5vw, 3.6rem); line-height: 1.06; letter-spacing: -.04em; }
.contact-intro p { color: var(--tgm-gray); }
.contact-note { margin-top: 28px; padding: 22px; border-left: 3px solid var(--tgm-gold); background: var(--tgm-cream); }
.whatsapp-form { padding: 38px; border: 1px solid #e5ded2; border-radius: var(--tgm-radius); background: #fff; box-shadow: var(--tgm-shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field--full { grid-column: 1 / -1; }
.form-field label { font-size: .88rem; font-weight: 800; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 52px; padding: 12px 14px; border: 1px solid #d9d2c7; border-radius: 12px; background: #fff; color: #15130f; font: inherit; outline: none; }
.form-field textarea { min-height: 145px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--tgm-gold-deep); box-shadow: 0 0 0 3px rgba(217,170,84,.16); }
.form-consent { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0; color: var(--tgm-gray); font-size: .86rem; }
.form-consent input { margin-top: 5px; }
.form-status { display: none; margin: 14px 0 0; padding: 12px 15px; border-radius: 10px; background: #edf8ef; color: #1d622b; font-weight: 700; }
.form-status.is-visible { display: block; }
.form-help { margin: 14px 0 0; color: var(--tgm-gray); font-size: .8rem; }

@media (max-width: 860px) {
  .contact-hero__grid, .contact-layout { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 560px) {
  .contact-hero { padding-block: 65px 55px; }
  .contact-section { padding-block: 65px; }
  .whatsapp-form { padding: 24px 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field--full { grid-column: auto; }
}
