/*
Theme Name:         FloresYa Blocksy Child
Theme URI:          https://floresya.mx
Description:        Child theme de Blocksy para FloresYa. Mobile-first, AI SEO ready, WooCommerce optimizado. Reemplaza oceanwp-child-theme-master.
Author:             Alex Barreras + Claw
Author URI:         https://grupodess.com
Template:           blocksy
Version:            1.0.0
Requires at least:  6.6
Requires PHP:       8.0
Tested up to:       6.9
License:            GPL-2.0-or-later
Text Domain:        floresya
Tags:               ecommerce, woocommerce, mobile-first, custom-colors, block-patterns, accessibility-ready
*/

/* ═══════════════════════════════════════════════════════════════════
   FloresYa Design Tokens — WCAG 2.1 AA Mobile-First
   ═══════════════════════════════════════════════════════════════════ */
:root {
  /* Brand colors */
  --fy-rose:        #c0284e;
  --fy-rose-dark:   #9c1e3f;
  --fy-rose-light:  #f8e1e8;
  --fy-green:       #2d7a3e;
  --fy-cream:       #fdfaf6;
  --fy-ink:         #1a1a1a;
  --fy-gray-600:    #4a4a4a;
  --fy-gray-400:    #888;
  --fy-gray-200:    #e5e5e5;
  --fy-gray-50:     #fafafa;

  /* Fluid typography — WCAG AA minimum 16px body */
  --fs-xs:     clamp(13px, 2vw,   14px);
  --fs-sm:     clamp(14px, 2.2vw, 15px);
  --fs-body:   clamp(16px, 2.5vw, 17px);   /* nunca <16px */
  --fs-lg:     clamp(17px, 3vw,   19px);
  --fs-xl:     clamp(19px, 3.5vw, 22px);
  --fs-h3:     clamp(20px, 3.5vw, 26px);
  --fs-h2:     clamp(24px, 4.5vw, 32px);
  --fs-h1:     clamp(28px, 5.5vw, 42px);
  --fs-price:  clamp(22px, 3.8vw, 28px);
  --fs-btn:    clamp(17px, 3vw,   18px);

  --lh-tight:  1.25;
  --lh-body:   1.6;
  --lh-loose:  1.8;

  /* Touch targets — WCAG 2.1 AA requires 44×44, mobile we go 48 */
  --touch-min: 44px;
  --touch-mob: 48px;

  /* Spacing scale (8pt base) */
  --sp-xs:  4px;
  --sp-sm:  8px;
  --sp-md:  16px;
  --sp-lg:  24px;
  --sp-xl:  32px;
  --sp-2xl: 48px;
  --sp-3xl: 64px;

  /* Radius */
  --r-sm:   6px;
  --r-md:   12px;
  --r-lg:   20px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.14);

  /* Transitions */
  --t-fast: 150ms ease;
  --t-med:  250ms ease;
}

/* ═══════════════════════════════════════════════════════════════════
   Base reset + a11y
   ═══════════════════════════════════════════════════════════════════ */
html { scroll-behavior: smooth; }

body {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--fy-ink);
  background: var(--fy-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Focus visible for keyboard users only — WCAG 2.4.7 */
:focus:not(:focus-visible) { outline: none; }
:focus-visible {
  outline: 3px solid var(--fy-rose);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link for screen readers */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  padding: var(--sp-md);
  background: var(--fy-rose);
  color: #fff;
  z-index: 99999;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 0; }

/* Reduce motion for users who prefer it — WCAG 2.3.3 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Buttons — global touch-friendly
   ═══════════════════════════════════════════════════════════════════ */
.button,
button,
input[type="submit"],
.wp-element-button {
  min-height: var(--touch-min);
  padding: var(--sp-sm) var(--sp-lg);
  font-size: var(--fs-btn);
  font-weight: 600;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: transform var(--t-fast), background var(--t-fast);
}

@media (max-width: 768px) {
  .button,
  button,
  input[type="submit"],
  .wp-element-button {
    min-height: var(--touch-mob);
    width: auto;
  }
}

/* Primary CTA */
.button.primary,
.button--primary,
.wp-block-button.is-style-fy-primary .wp-block-button__link {
  background: var(--fy-rose);
  color: #fff;
  border: none;
}
.button.primary:hover,
.button--primary:hover {
  background: var(--fy-rose-dark);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════════
   Form inputs — mobile-friendly sizes (iOS no auto-zoom si >=16px)
   ═══════════════════════════════════════════════════════════════════ */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
  font-size: 16px !important;  /* critical: iOS zooms in if <16 */
  min-height: var(--touch-min);
  padding: var(--sp-sm) var(--sp-md);
  border: 1.5px solid var(--fy-gray-200);
  border-radius: var(--r-sm);
  transition: border-color var(--t-fast);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--fy-rose);
}

/* ═══════════════════════════════════════════════════════════════════
   Blocksy palette override — hace que header/footer/links hereden
   la marca rose sin tocar el Customizer
   ═══════════════════════════════════════════════════════════════════ */
:root {
  --theme-palette-color-1: #c0284e;  /* Primary — CTA, accents */
  --theme-palette-color-2: #9c1e3f;  /* Hover primary */
  --theme-palette-color-3: #1a1a1a;  /* Headings */
  --theme-palette-color-4: #4a4a4a;  /* Body text */
  --theme-palette-color-5: #e5e5e5;  /* Borders */
  --theme-palette-color-6: #fdfaf6;  /* Light bg (cream) */
  --theme-palette-color-7: #ffffff;  /* White */
  --theme-palette-color-8: #ffffff;  /* Header bg (white) — Blocksy reads this for ct-header */

  /* Blocksy Gutenberg block palette aliases */
  --wp--preset--color--rose:      #c0284e;
  --wp--preset--color--rose-dark: #9c1e3f;
  --wp--preset--color--cream:     #fdfaf6;
  --wp--preset--color--ink:       #1a1a1a;
}

/* Header: logo max height, nav text size bump */
.ct-header [data-row="main"] {
  --header-height: 72px;
}
.ct-header .site-logo-container img {
  max-height: 52px;
  width: auto;
}
.ct-header .header-menu-1 > li > a {
  font-size: 15px;
  font-weight: 600;
}

/* Category cover gradient overlay - better text contrast */
.wp-block-cover.fy-cat-card .wp-block-cover__inner-container {
  z-index: 1;
}

/* Product cards: cleaner borders + hover lift */
.wc-block-product-template .wp-block-post,
.wp-block-woocommerce-product-template .wp-block-post {
  border: 1px solid var(--fy-gray-200);
  border-radius: var(--r-md);
  padding: 16px;
  background: #fff;
  transition: transform var(--t-med), box-shadow var(--t-med);
}
.wc-block-product-template .wp-block-post:hover,
.wp-block-woocommerce-product-template .wp-block-post:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Product price = rose */
.wc-block-components-product-price,
.wp-block-woocommerce-product-price .price,
.price ins,
.price .woocommerce-Price-amount {
  color: var(--fy-rose) !important;
  font-weight: 700;
}

/* WooCommerce sale badge = rose */
.onsale,
.wc-block-components-product-sale-badge {
  background: var(--fy-rose) !important;
  color: #fff !important;
  border-radius: var(--r-pill);
  font-weight: 600;
  padding: 4px 12px;
}

/* Footer: dark + clean */
.ct-footer {
  background: var(--fy-ink);
  color: rgba(255,255,255,0.85);
}
.ct-footer a { color: rgba(255,255,255,0.85); }
.ct-footer a:hover { color: var(--fy-rose-light); }

/* Modular components live in inc/*.php and assets/css/*.css */
