/*
Theme Name: TuEnvoltorio
Theme URI: https://tuenvoltorio.cl
Author: TuEnvoltorio.cl
Description: Tema comercial a medida para TuEnvoltorio.cl, compatible con WooCommerce.
Version: 1.1.6
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: tuenvoltorio
*/

:root {
  --te-ink: #173e31;
  --te-button-ink: #102a21;
  --te-green: #83b69d;
  --te-green-hover: #72a98e;
  --te-green-deep: #d9ebdf;
  --te-coral: #e86f51;
  --te-coral-deep: #b84931;
  --te-amber: #ffe2a3;
  --te-mint: #eaf4ed;
  --te-paper: #fffdfa;
  --te-cream: #f5f2ec;
  --te-line: #d4e0dc;
  --te-muted: #4b6558;
  --te-white: #ffffff;
  --te-shadow: 0 8px 24px rgba(23, 62, 49, .08);
  --te-width: 1240px;
  --te-font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--te-paper); color: var(--te-ink); font-family: var(--te-font); font-size: 16px; line-height: 1.55; }
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
img { max-width: 100%; height: 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; }
.screen-reader-text:focus { position: fixed; top: 12px; left: 12px; z-index: 9999; width: auto; height: auto; clip: auto; padding: 12px 16px; background: #fff; color: var(--te-ink); }
:focus-visible { outline: 3px solid var(--te-ink); outline-offset: 3px; }
section[id] { scroll-margin-top: 190px; }

.te-announcement { min-height: 36px; padding: 8px 16px; background: var(--te-amber); color: var(--te-button-ink); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; font-size: .8125rem; line-height: 1.4; font-weight: 600; text-align: center; }
.te-announcement-item { max-width: 100%; }
.te-announcement strong { font-weight: 800; white-space: nowrap; }
.te-announcement-separator { opacity: .65; }
.te-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 253, 250, .98); border-bottom: 1px solid var(--te-line); }
.admin-bar .te-header { top: 32px; }
.te-nav { min-height: 74px; max-width: var(--te-width); margin: auto; padding: 10px 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.te-brand { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; }
.te-brand img, .te-brand .custom-logo { display: block; width: 225px; max-height: 64px; object-fit: contain; }
.te-primary-menu { display: flex; align-items: center; gap: 30px; margin: 0; padding: 0; list-style: none; font-size: .875rem; font-weight: 700; }
.te-primary-menu a { display: block; padding: 12px 0; }
.te-primary-menu a:hover, .te-primary-menu .current-menu-item > a { color: var(--te-coral); }
.te-nav-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.te-cart { background: var(--te-green); color: var(--te-button-ink); border-radius: 6px; display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 10px 14px; font-size: .875rem; font-weight: 800; }
.te-cart:hover { background: var(--te-green-hover); color: var(--te-button-ink); }
.te-cart-count { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--te-ink); font-size: .75rem; }
.te-menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--te-coral-deep); background: var(--te-coral); color: var(--te-button-ink); cursor: pointer; font-size: 1.35rem; }
.te-menu-toggle:hover { background: var(--te-coral-deep); color: #fff; }

.te-button, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .wp-element-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; border-radius: 6px !important; background: var(--te-coral) !important; color: var(--te-button-ink) !important; padding: 13px 22px !important; border: 0 !important; font-family: var(--te-font) !important; font-size: .875rem !important; font-weight: 750 !important; letter-spacing: 0; cursor: pointer; transition: .2s; }
.te-button:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover, .wp-element-button:hover { background: var(--te-coral-deep) !important; color: #fff !important; transform: translateY(-1px); }
.te-button-light { background: var(--te-coral) !important; color: var(--te-button-ink) !important; }
.te-button-light:hover { background: var(--te-coral-deep) !important; color: #fff !important; }
.te-text-link { font-size: .875rem; font-weight: 800; border-bottom: 1px solid currentColor; padding-bottom: 5px; }
.te-text-link span { color: var(--te-coral); margin-left: 6px; }
.te-eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; font-weight: 750; color: var(--te-muted); margin: 0 0 10px; }
.te-eyebrow-light { color: var(--te-muted); }

.te-hero { width: calc(100% - 48px); max-width: var(--te-width); margin: 18px auto 0; padding: 28px 30px 22px; background: var(--te-mint); border-radius: 12px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px 30px; align-items: center; }
.te-hero-copy { min-width: 0; }
.te-hero-visual { position: relative; margin: 0; min-width: 0; }
.te-hero-visual img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; }
.te-hero-visual figcaption { position: absolute; right: 8px; bottom: 8px; padding: 2px 6px; border-radius: 3px; color: var(--te-muted); background: var(--te-paper); font-size: .7rem; }
.te-hero h1, .te-section h2, .te-wholesale h2, .te-contact h2, .te-page-title { font-family: var(--te-font); line-height: 1.15; letter-spacing: -.025em; margin: 0; font-weight: 700; }
.te-hero h1 { font-size: clamp(2rem, 3.7vw, 3rem); }
.te-hero h1 em, .te-wholesale h2 em { color: var(--te-coral); font-weight: 400; }
.te-hero-lead { font-size: 1rem; line-height: 1.6; color: var(--te-muted); max-width: 850px; margin: 10px 0 16px; }
.te-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.te-trust-row { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 16px; color: var(--te-muted); font-size: .78rem; }
.te-hero > .te-trust-row { grid-column: 1 / -1; border-top: 1px solid var(--te-line); padding-top: 16px; margin-top: 0; }
.te-trust-row span { display: flex; align-items: center; gap: 7px; }
.te-check { color: var(--te-coral); font-weight: 900; }
.te-hero-catalog { min-height: 410px; background: var(--te-green); padding: 28px; display: grid; gap: 1px; box-shadow: var(--te-shadow); transform: rotate(1deg); }
.te-hero-catalog > div { background: rgba(255, 255, 255, .06); color: #fff; padding: 24px 25px; display: grid; grid-template-columns: 46px 1fr; align-items: center; }
.te-hero-catalog span { grid-row: 1/3; color: #ffac96; font: italic 1.4rem Georgia, serif; }
.te-hero-catalog b { font: 2rem Georgia, serif; }
.te-hero-catalog small { font-size: .85rem; color: #c8dcd7; margin-top: 4px; }
.te-hero-catalog > div:nth-child(2) { transform: translateX(-18px); background: var(--te-coral); }
.te-hero-catalog > div:nth-child(2) span, .te-hero-catalog > div:nth-child(2) small { color: #fff; }

.te-section { max-width: var(--te-width); margin: auto; padding: 30px; }
.te-section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.te-section h2, .te-wholesale h2, .te-contact h2, .te-page-title { font-size: clamp(1.5rem, 2.5vw, 2rem); }
.te-section-heading > p { font-size: 1rem; line-height: 1.7; color: var(--te-muted); margin: 0; }
.te-category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.te-category-card { min-width: 0; padding: 20px; border: 1px solid var(--te-line); border-radius: 8px; background: #fff; text-align: left; display: flex; flex-direction: column; transition: .2s; }
.te-category-card:nth-child(2) { background: #fceae4; }
.te-category-card:nth-child(3) { background: var(--te-mint); }
.te-category-card:nth-child(4) { background: #f4eee0; }
.te-category-card:hover { transform: translateY(-4px); box-shadow: var(--te-shadow); border-color: transparent; }
.te-category-photo { aspect-ratio: 3 / 2; background: #f7f5f0; overflow: hidden; border-radius: 4px; }
.te-category-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.te-category-image-default { object-fit: cover; }
.te-category-note { margin: 12px 0 0; color: var(--te-muted); font-size: .8rem; line-height: 1.5; }
.te-category-card h3 { font-family: var(--te-font); font-size: 1.12rem; line-height: 1.25; font-weight: 700; margin: 12px 0 8px; }
.te-category-card p { font-size: .9rem; line-height: 1.55; color: var(--te-muted); margin: 0 0 14px; }
.te-category-card b { font-size: .8rem; color: var(--te-button-ink); background: var(--te-coral); margin-top: auto; padding: 10px 12px; border-radius: 6px; align-self: flex-start; }
.te-category-card:hover b { background: var(--te-coral-deep); color: #fff; }
.te-coming-soon { margin-top: 18px; border: 1px solid var(--te-line); background: var(--te-green); color: #fff; padding: 28px 32px; display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.te-coming-soon span { font-size: .75rem; text-transform: uppercase; letter-spacing: .14em; color: #ffac96; font-weight: 800; }
.te-coming-soon h3 { font: 1.7rem Georgia, serif; margin: 8px 0; }
.te-coming-soon p { color: #cce0dc; font-size: .9rem; line-height: 1.55; margin: 0; max-width: 690px; }
.te-coming-soon a { white-space: nowrap; font-size: .85rem; font-weight: 800; border-bottom: 1px solid #ffac96; padding-bottom: 5px; }

.te-shop-preview { background: var(--te-mint); }
.te-products-empty { background: #fff; border: 1px solid var(--te-line); padding: 34px; text-align: center; color: var(--te-muted); }
.te-products-empty strong { display: block; color: var(--te-ink); font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.te-products-empty p { margin: 0 0 16px; }
.te-shop-preview .woocommerce ul.products, .woocommerce-page ul.products { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 16px; margin: 0 !important; }
.te-shop-preview .woocommerce ul.products::before, .te-shop-preview .woocommerce ul.products::after, .woocommerce-page ul.products::before, .woocommerce-page ul.products::after { display: none !important; }
.woocommerce ul.products li.product, .woocommerce-page ul.products li.product { float: none !important; width: auto !important; margin: 0 !important; padding: 0 0 20px !important; background: #fff; border: 1px solid var(--te-line); display: flex; flex-direction: column; min-width: 0; }
.woocommerce ul.products li.product a img { width: 100%; aspect-ratio: 1.1 / 1; object-fit: contain; margin: 0 0 18px !important; background: #f8faf9; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { color: var(--te-ink); font-family: var(--te-font); font-size: 1rem; line-height: 1.4; font-weight: 650; padding: 0 16px 8px !important; min-height: 48px; overflow-wrap: anywhere; }
.woocommerce ul.products li.product .price { color: var(--te-ink) !important; font-family: var(--te-font) !important; font-size: 1.12rem !important; line-height: 1.4 !important; font-weight: 750 !important; padding: 0 16px; }
.woocommerce ul.products li.product .button { margin: auto 18px 0 !important; }
.woocommerce span.onsale { min-width: auto; min-height: auto; border-radius: 0; background: var(--te-green); color: var(--te-ink); padding: 6px 10px; line-height: 1.4; }

.te-wholesale { max-width: var(--te-width); margin: 30px auto; background: var(--te-green-deep); color: var(--te-ink); padding: 30px; border-radius: 8px; }
.te-wholesale h2 em { color: #ff9d84; }
.te-wholesale-copy > p:not(.te-eyebrow) { font-size: 1rem; line-height: 1.7; color: var(--te-muted); max-width: 750px; }
.te-wholesale ul { list-style: none; padding: 12px 0 22px; display: grid; gap: 12px; font-size: .9rem; }
.te-wholesale-stat { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: center; }
.te-wholesale-stat > div { border: 1px solid rgba(255, 255, 255, .22); min-height: 145px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.te-wholesale-stat > div strong { font: 3.5rem Georgia, serif; color: #ff9d84; }
.te-wholesale-stat > div span { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: #c9ddd8; }
.te-wholesale-stat > p { grid-column: 1/-1; background: #fff; color: var(--te-ink); padding: 16px 19px; font: 1rem/1.5 Georgia, serif; margin: 0; transform: rotate(-1deg); }
.te-contact { background: var(--te-mint); padding: 40px max(30px, calc((100% - 1180px)/2)); display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: center; }
.te-contact-copy > p:last-child { font-size: 1rem; line-height: 1.7; color: var(--te-muted); }
.te-contact-actions { background: #fff; padding: 30px; display: grid; gap: 17px; }
.te-contact-actions > a:not(.te-button), .te-contact-actions > span { font-size: 1rem; font-weight: 700; border-bottom: 1px solid var(--te-line); padding-bottom: 14px; }

.te-content { max-width: 1180px; margin: auto; padding: 30px 30px 50px; }
.te-content-narrow { max-width: 850px; }
.te-entry { margin-bottom: 42px; padding-bottom: 42px; border-bottom: 1px solid var(--te-line); }
.te-entry h2 { font: 2rem/1.15 Georgia, serif; margin: 0 0 12px; }
.te-entry-meta { color: var(--te-muted); font-size: .85rem; }
.woocommerce .woocommerce-breadcrumb { color: var(--te-muted); font-size: .82rem; }
.woocommerce div.product .product_title { font-family: var(--te-font); font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.2; font-weight: 700; letter-spacing: -.02em; color: var(--te-ink); overflow-wrap: anywhere; }
.woocommerce div.product p.price, .woocommerce div.product span.price { font-family: var(--te-font); color: var(--te-ink); font-weight: 750; }
.woocommerce div.product .woocommerce-product-details__short-description, .woocommerce div.product .woocommerce-tabs { font-family: var(--te-font); }
.woocommerce-message, .woocommerce-info { border-top-color: var(--te-green); background: var(--te-mint); }
.woocommerce-message::before, .woocommerce-info::before { color: var(--te-green); }
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea, .woocommerce select { min-height: 46px; border: 1px solid var(--te-line); padding: 10px 12px; background: #fff; }
.woocommerce table.shop_table { border-color: var(--te-line); border-radius: 0; }

.te-footer { background: var(--te-green-deep); color: var(--te-ink); padding: 32px max(30px, calc((100% - 1180px)/2)); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; }
.te-footer .te-brand img { width: 215px; }
.te-footer p { font-family: var(--te-font); font-size: .95rem; color: var(--te-ink); }
.te-footer-menu { display: flex; gap: 25px; margin: 0; padding: 0; list-style: none; font-size: .85rem; }
.te-footer small { grid-column: 1/-1; border-top: 1px solid var(--te-line); padding-top: 16px; color: var(--te-muted); font-size: .75rem; }

/* Acceso al catálogo: búsqueda nativa y categorías a un clic. */
.te-catalog-access { max-width: var(--te-width); margin: auto; padding: 0 30px 14px; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 1.5fr); align-items: center; gap: 18px; }
.te-product-search { display: flex; align-items: stretch; min-width: 0; margin: 0; }
.te-product-search input[type="search"] { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #829e8e; border-right: 0; border-radius: 6px 0 0 6px; background: #fff; color: var(--te-ink); font-size: .875rem; }
.te-product-search button { flex: 0 0 auto; min-height: 44px; border: 1px solid var(--te-coral-deep); border-radius: 0 6px 6px 0; padding: 10px 14px; background: var(--te-coral); color: var(--te-button-ink); font-size: .875rem; font-weight: 700; cursor: pointer; }
.te-product-search button:hover { background: var(--te-coral-deep); color: #fff; }
.te-quick-categories { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.te-quick-categories a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 6px; border-radius: 6px; background: var(--te-coral); color: var(--te-button-ink); font-size: .75rem; line-height: 1.3; font-weight: 650; text-align: center; }
.te-quick-categories a:hover { background: var(--te-coral-deep); color: #fff; }

@media (max-width: 1000px) {
  .te-menu-toggle { display: block; }
  .te-primary-menu { position: absolute; top: 74px; left: 20px; right: 20px; z-index: 60; background: var(--te-paper); border: 1px solid var(--te-line); box-shadow: var(--te-shadow); padding: 20px; display: none; flex-direction: column; align-items: flex-start; gap: 8px; font-size: 1rem; max-height: 65vh; overflow-y: auto; }
  .menu-open .te-primary-menu { display: flex; }
  .te-category-grid { grid-template-columns: 1fr 1fr; }
  .te-shop-preview .woocommerce ul.products, .woocommerce-page ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .te-wholesale { margin: 24px; }
  .te-catalog-access { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

@media (max-width: 782px) {
  .admin-bar .te-header { top: 46px; }
}

@media (max-width: 760px) {
  .te-hero { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .te-hero-visual { display: none; }
  .te-contact { grid-template-columns: 1fr; gap: 24px; }
  .te-shop-preview .woocommerce ul.products, .woocommerce-page ul.products { grid-template-columns: 1fr 1fr !important; }
  .te-coming-soon { align-items: flex-start; flex-direction: column; gap: 22px; }
  .te-footer { grid-template-columns: 1fr; }
  .te-footer small { grid-column: 1; }
}

@media (max-width: 520px) {
  .te-announcement { display: grid; grid-template-columns: minmax(0, 1fr); font-size: .6875rem; gap: 2px; padding: 7px 12px; }
  .te-announcement-separator { display: none; }
  .te-header { position: relative; top: auto !important; }
  .te-nav { min-height: 64px; padding: 10px 14px; gap: 8px; }
  .te-brand img, .te-brand .custom-logo { width: 160px; max-width: 100%; }
  .te-nav > nav { min-width: 0; }
  .te-cart-label { display: none; }
  .te-cart { padding: 8px; min-width: 44px; }
  .te-primary-menu { top: 64px; left: 14px; right: 14px; }
  .te-catalog-access { padding: 0 14px 12px; }
  .te-quick-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .te-quick-categories a { min-height: 36px; padding: 6px; font-size: .72rem; }
  .te-hero { width: calc(100% - 28px); margin-top: 14px; padding: 22px 16px; }
  .te-hero h1 { font-size: 1.65rem; }
  .te-hero-lead { font-size: .9rem; }
  .te-hero-actions { gap: 12px; }
  .te-hero-actions > .te-button { width: 100%; }
  .te-trust-row { gap: 6px 12px; font-size: .7rem; }
  .te-section, .te-content { padding: 24px 16px; }
  .te-category-grid, .te-shop-preview .woocommerce ul.products, .woocommerce-page ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .te-category-card { padding: 14px; }
  .te-category-card h3 { font-size: .95rem; margin-top: 10px; }
  .te-category-card p { font-size: .78rem; }
  .te-category-card b { font-size: .72rem; }
  .woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: .88rem; padding: 0 10px 6px !important; }
  .woocommerce ul.products li.product .price { font-size: 1rem !important; padding: 0 10px; }
  .woocommerce ul.products li.product .button { margin: auto 10px 0 !important; padding: 10px !important; font-size: .75rem !important; }
  .te-coming-soon { padding: 25px 22px; }
  .te-wholesale { margin: 20px 14px; padding: 24px 18px; }
  .te-wholesale-stat { grid-template-columns: 1fr; }
  .te-wholesale-stat > p { grid-column: 1; }
  .te-contact { padding: 28px 16px; }
  .te-footer { padding: 28px 16px; }
  section[id] { scroll-margin-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
