/*
Theme Name: Tecnoservicios
Theme URI: https://tecnoservicios.cl
Description: Child theme of Storefront for Tecnoservicios — venta de impresoras y repuestos Kyocera en Padre Las Casas. Brand colours are driven from .env (THEME_PRIMARY_COLOR / THEME_SECONDARY_COLOR) via theme mods, exposed here as the --brand-red / --brand-dark CSS custom properties.
Author: Tecnoservicios
Version: 0.1.0
Template: storefront
Text Domain: tecnoservicios
*/

/* ===========================================================================
   Brand variables
   ---------------------------------------------------------------------------
   These are the DEFAULTS. functions.php prints an inline :root block (after
   this stylesheet) with the live values pulled from the .env-driven theme
   mods, so re-provisioning with a new THEME_PRIMARY_COLOR restyles the site.
   You can still tweak everything visually by editing the rules below.
   =========================================================================== */
:root {
  --brand-red: #DF0522;   /* Kyocera-style red — primary accent  */
  --brand-dark: #1A1A1A;  /* near-black — secondary / footer     */
  --brand-red-ink: #ffffff;
  --brand-radius: 6px;

  /* Derived / UI tokens (used by buttons, form controls, focus rings). */
  --brand-red-dark: #b6041c;             /* hover/active red               */
  --brand-red-soft: rgba(223, 5, 34, 0.16); /* focus ring tint            */
  --field-border: #d6d6da;               /* input/select border           */
  --field-bg: #ffffff;
  --ink: #1f2024;                        /* body text                     */
  --muted: #6b7280;                      /* secondary text                */
}

/* ===========================================================================
   Header
   =========================================================================== */
.site-header {
  background-color: var(--brand-dark);
  border-bottom: 4px solid var(--brand-red);
}
.site-header,
.site-header a,
.site-header .site-title a,
.main-navigation ul li a {
  color: #fff;
}
/* Highlight the active / hovered nav item with the brand red. */
.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item > a {
  color: var(--brand-red);
}

/* ===========================================================================
   Buttons & calls to action
   =========================================================================== */
.button,
button,
input[type="submit"],
.woocommerce a.button,
.woocommerce button.button,
.woocommerce #respond input#submit,
.woocommerce .widget_price_filter .ui-slider .ui-slider-handle {
  background-color: var(--brand-red);
  border-color: var(--brand-red);
  color: var(--brand-red-ink);
  border-radius: var(--brand-radius);
}
.button:hover,
button:hover,
input[type="submit"]:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce #respond input#submit:hover {
  background-color: #b6041c;   /* darker red on hover */
  border-color: #b6041c;
  color: var(--brand-red-ink);
}
/* Storefront's "alt" (add-to-cart) buttons also follow the brand. */
.woocommerce a.button.alt,
.woocommerce button.button.alt {
  background-color: var(--brand-red);
  border-color: var(--brand-red);
}

/* ===========================================================================
   Links
   =========================================================================== */
a {
  color: var(--brand-red);
}
a:hover {
  color: var(--brand-dark);
}

/* ===========================================================================
   WooCommerce sale badges & price
   =========================================================================== */
.woocommerce span.onsale,
.woocommerce ul.products li.product .onsale {
  background-color: var(--brand-red);
  color: var(--brand-red-ink);
}
.woocommerce ul.products li.product .price,
.woocommerce div.product p.price,
.woocommerce div.product span.price {
  color: var(--brand-dark);
  font-weight: 700;
}

/* ===========================================================================
   Footer accents
   =========================================================================== */
.site-footer {
  background-color: var(--brand-dark);
  color: #d8d8d8;
  border-top: 4px solid var(--brand-red);
}
.site-footer a {
  color: #fff;
}
.site-footer a:hover {
  color: var(--brand-red);
}

/* ===========================================================================
   Homepage hero (see front-page.php)
   =========================================================================== */
.ts-hero {
  position: relative;
  /* Full-bleed: break out of Storefront's centered .col-full container so the
     hero spans the entire viewport width (edge to edge). The calc() margins
     pull it out symmetrically without causing horizontal scroll. */
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  /* Tall enough to feel like a banner, but capped so it never dominates huge
     monitors. */
  min-height: clamp(420px, 68vh, 680px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--brand-dark);
}
/* Pull the hero flush under the header on the homepage so it reads as one big
   banner like dimacofi. Storefront sets a large margin-bottom on .site-header
   via .home.blog / .home.page rules (specificity 0,3,0); prefixing with `body`
   gives us 0,3,1 so we win, on whichever front-page config is in use. Inner
   pages keep their normal header spacing. */
body.home.blog .site-header,
body.home.page .site-header { margin-bottom: 0; }
/* The looping video sits behind the content and covers the area. */
.ts-hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
/* Scrim that keeps white text readable while still showing the product video.
   Vertical darkening top/bottom + a subtle brand-red tint on one side. */
.ts-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0.60) 100%),
    linear-gradient(120deg, rgba(223, 5, 34, 0.28) 0%, rgba(223, 5, 34, 0) 60%);
}
.ts-hero__content {
  position: relative;
  z-index: 2;
  max-width: 820px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: #fff;
}
.ts-hero__title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  margin: 0 0 0.75rem;
  color: #fff;
  /* Legibility over the moving video. */
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}
.ts-hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin: 0 0 1.75rem;
  color: #f1f1f1;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}
.ts-hero__cta.button {
  font-size: 1.1rem;
  padding: 0.9em 2em;
}

/* ===========================================================================
   Homepage product sections
   =========================================================================== */
.ts-section {
  padding: 3rem 0 1rem;
}
.ts-section__title {
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
}
/* Small red underline under each section title. */
.ts-section__title::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin: 0.6rem auto 0;
  background: var(--brand-red);
  border-radius: 2px;
}

/* Make Storefront's product grid a touch cleaner / more clickable. */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
  text-align: center;
  border: 1px solid #ececec;
  border-radius: var(--brand-radius);
  padding: 1rem;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.woocommerce ul.products li.product:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
  transform: translateY(-3px);
}
.woocommerce ul.products li.product img {
  margin-bottom: 0.75rem;
}

/* ===========================================================================
   Small responsive tweaks
   =========================================================================== */
@media (max-width: 768px) {
  .ts-hero {
    min-height: 52vh;
  }
}

/* ===========================================================================
   FORM CONTROLS  (selects, inputs, search, quantity, WooCommerce select2)
   ---------------------------------------------------------------------------
   Replaces the browser's default field chrome with a consistent, on-brand set
   of controls: rounded, subtle border, brand-red focus ring, and a custom
   chevron on every dropdown. Retune globally via the tokens in :root.
   =========================================================================== */

/* Shared look for text-like inputs, textareas and selects. */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
  font: inherit;
  color: var(--ink);
  background-color: var(--field-bg);
  border: 1.5px solid var(--field-border);
  border-radius: var(--brand-radius);
  padding: 0.62rem 0.9rem;
  line-height: 1.3;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: none;
}

/* Focus: brand-red border + soft ring. */
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px var(--brand-red-soft);
}

::placeholder { color: var(--muted); opacity: 1; }

/* --- Native <select> with a custom chevron ------------------------------- */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 2.5rem;          /* room for the chevron */
  cursor: pointer;
  /* Inline SVG chevron (brand-dark). */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231A1A1A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 0.85rem;
}
/* Chevron turns brand-red while focused. */
select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23DF0522' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
select::-ms-expand { display: none; } /* legacy Edge/IE */

/* The shop "Ordenar por" dropdown as a tidy pill. */
.woocommerce .woocommerce-ordering select.orderby {
  min-width: 14rem;
  font-weight: 600;
}

/* --- Quantity stepper ---------------------------------------------------- */
.woocommerce .quantity input.qty {
  width: 4.5rem;
  text-align: center;
  padding: 0.55rem 0.4rem;
  font-weight: 600;
  -moz-appearance: textfield;
}
.woocommerce .quantity input.qty::-webkit-outer-spin-button,
.woocommerce .quantity input.qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ===========================================================================
   WooCommerce select2 (country / state dropdowns on checkout & address forms)
   Make the enhanced selects match our native fields.
   =========================================================================== */
.select2-container--default .select2-selection--single {
  height: auto;
  min-height: 2.7rem;
  border: 1.5px solid var(--field-border);
  border-radius: var(--brand-radius);
  background-color: var(--field-bg);
  display: flex;
  align-items: center;
  padding: 0.2rem 0.4rem 0.2rem 0.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--ink);
  line-height: 1.4;
  padding-left: 0.35rem;
}
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px var(--brand-red-soft);
}
/* Replace the default select2 arrow with our chevron. */
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100%;
  right: 0.6rem;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border: none;
  width: 0.85rem;
  height: 0.85rem;
  margin: 0;
  transform: translate(-50%, -50%);
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231A1A1A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
/* Dropdown panel + options. */
.select2-dropdown {
  border: 1.5px solid var(--field-border);
  border-radius: var(--brand-radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted {
  background-color: var(--brand-red);
  color: var(--brand-red-ink);
}
.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1.5px solid var(--field-border);
  border-radius: var(--brand-radius);
  padding: 0.45rem 0.6rem;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px var(--brand-red-soft);
  outline: none;
}

/* ===========================================================================
   General polish
   =========================================================================== */
body {
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Buttons get a little depth + lift on hover. */
.button,
button,
input[type="submit"],
.woocommerce a.button,
.woocommerce button.button {
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: background-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.button:hover,
button:hover,
input[type="submit"]:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(223, 5, 34, 0.28);
}
.button:active,
.woocommerce a.button:active { transform: translateY(0); }

/* Keyboard focus visibility for links/buttons. */
a:focus-visible,
.button:focus-visible,
button:focus-visible {
  outline: 3px solid var(--brand-red-soft);
  outline-offset: 2px;
}

/* Header subtle shadow + a touch more nav spacing. */
.site-header { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18); }
.main-navigation ul li a { letter-spacing: 0.01em; }

/* Tidy the shop result count. */
.woocommerce .woocommerce-result-count { color: var(--muted); margin-top: 0.5rem; }

/* Add-to-cart spans the product card for a stronger CTA. */
.woocommerce ul.products li.product .button {
  display: inline-block;
  width: 100%;
  margin-top: 0.35rem;
}

/* Mobile: let the sorting dropdown go full width. */
@media (max-width: 768px) {
  .woocommerce .woocommerce-ordering select.orderby { width: 100%; min-width: 0; }
}


/* ===========================================================================
   RESPONSIVE PRODUCT GRID
   ---------------------------------------------------------------------------
   Replace Storefront's float layout with CSS grid so products always show in
   even columns: 2 on mobile, 3 on tablet, 4 on desktop. !important is used to
   override the parent theme's percentage widths/floats cleanly.
   =========================================================================== */
.woocommerce ul.products,
.woocommerce-page ul.products {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: 0 0 2rem;
}
@media (min-width: 600px) {
  .woocommerce ul.products,
  .woocommerce-page ul.products { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 992px) {
  .woocommerce ul.products,
  .woocommerce-page ul.products { grid-template-columns: repeat(4, 1fr); }
}
/* Neutralise Storefront's float/width/clear so the grid governs layout, and
   make cards equal height with the button pinned to the bottom. */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
  width: auto !important;
  margin: 0 !important;
  float: none !important;
  clear: none !important;
  display: flex !important;
  flex-direction: column;
}
.woocommerce ul.products li.product::before { content: none !important; }
/* Storefront adds clearfix ::before/::after on ul.products; in a grid container
   those become phantom cells (an empty first column). Remove them. */
.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce-page ul.products::before,
.woocommerce-page ul.products::after { content: none !important; display: none !important; }
.woocommerce ul.products li.product .button { margin-top: auto; }
/* Keep product thumbnails a consistent shape across the grid. */
.woocommerce ul.products li.product img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
}

/* ===========================================================================
   HOMEPAGE SECTIONS (features, services, categories, stats, contact)
   ---------------------------------------------------------------------------
   Helper: .ts-bleed-* sections break out of Storefront's .col-full to span the
   full viewport width; an inner .col-full re-constrains the content.
   =========================================================================== */

/* --- Value props band (full-bleed light) --------------------------------- */
.ts-features {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: #f7f7f8;
  border-top: 1px solid #ececec;
  border-bottom: 1px solid #ececec;
  padding: 2.25rem 0;
}
.ts-features__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  align-items: stretch;       /* cards in a row share the same height */
}
@media (min-width: 860px) { .ts-features__grid { grid-template-columns: repeat(4, 1fr); } }
.ts-feature {
  display: flex;
  gap: 0.9rem;
  align-items: center;        /* icon + text vertically centered */
  background: #fff;
  border: 1px solid #ececec;
  border-radius: var(--brand-radius);
  padding: 1.05rem 1.15rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.ts-feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
.ts-feature__icon {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--brand-red);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(223, 5, 34, 0.30);
}
.ts-feature__body  { min-width: 0; }
.ts-feature__title { margin: 0 0 0.12rem; font-size: 0.98rem; line-height: 1.2; }
.ts-feature__text  { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.4; }

/* --- Services cards ------------------------------------------------------- */
.ts-services {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 600px) { .ts-services { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .ts-services { grid-template-columns: repeat(4, 1fr); } }
.ts-service {
  background: #fff;
  border: 1px solid #ececec;
  border-top: 3px solid var(--brand-red);
  border-radius: var(--brand-radius);
  padding: 1.5rem;
}
.ts-service__title { margin: 0 0 0.5rem; font-size: 1.1rem; }
.ts-service__text  { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

/* --- Featured categories -------------------------------------------------- */
.ts-cats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 768px) { .ts-cats { grid-template-columns: 1fr 1fr; } }
.ts-cat {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 180px;
  padding: 2rem;
  border-radius: var(--brand-radius);
  color: #fff;
  text-decoration: none;
  background: linear-gradient(120deg, var(--brand-dark), #3a3b42);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.ts-cat--alt { background: linear-gradient(120deg, var(--brand-red), #9c0418); }
.ts-cat:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.18); color: #fff; }
.ts-cat__label { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.ts-cat__sub   { opacity: 0.88; margin: 0.4rem 0 1rem; }
.ts-cat__cta   { font-weight: 700; }

/* --- Contact band (full-bleed red) --------------------------------------- */
.ts-contact {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: var(--brand-red);
  color: #fff;
  padding: 3rem 0;
}
.ts-contact__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  align-items: center;
}
@media (min-width: 768px) { .ts-contact__grid { grid-template-columns: 1.1fr 1fr; } }
.ts-contact__title  { color: #fff; margin: 0 0 0.25rem; }
.ts-contact__slogan { margin: 0 0 1.25rem; opacity: 0.92; font-size: 1.1rem; }
.ts-contact__wa.button { background: #fff; color: var(--brand-red); }
.ts-contact__wa.button:hover { background: var(--brand-dark); color: #fff; }
.ts-contact__list { list-style: none; margin: 0; padding: 0; font-size: 1.02rem; line-height: 1.95; }
.ts-contact__list a { color: #fff; text-decoration: underline; }
