/* Cherry site layer on top of the Claude Design pages: accessibility, visitor mode for empty
   photo slots, the compact header, and the phone and tablet layouts. The pages use inline styles,
   so layout overrides below need !important. Hooks are the r-* classes added by the port. */

/* ── Base behaviour ─────────────────────────────────────────────────────────── */
html { scroll-padding-top: 96px; }
/* The design's per-section scroll margins assumed no scroll padding; one offset for every anchor. */
main [id] { scroll-margin-top: 0 !important; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Keyboard focus: an outline everywhere (several components remove the default ring). */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.r-header :focus-visible, .r-salon-hero :focus-visible, footer :focus-visible,
.r-on-brand :focus-visible, #recursos :focus-visible { outline-color: var(--white); }
.r-sheet :focus-visible, .r-mega-panel :focus-visible { outline-color: var(--brand); }
#demo form :focus-visible { outline-color: var(--black); outline-offset: 2px; }

/* Skip link: hidden until it receives keyboard focus. */
.r-skip {
  position: absolute; left: 16px; top: -64px; z-index: 100;
  padding: 10px 16px; border-radius: var(--radius-pill);
  background: var(--black); color: var(--white); font-size: 15px; font-weight: 500;
}
.r-skip:focus { top: 12px; color: var(--white); }

/* Empty photo slots, for visitors only. Each page sets [data-public] on <html> outside the
   Claude Design editor; the editor keeps its captions, dashed rings and every tile. */
[data-public] image-slot:not([data-filled])::part(empty) { visibility: hidden; }
[data-public] image-slot:not([data-filled])::part(ring) { display: none; }
[data-public] image-slot:not([data-filled])::part(frame) { background: color-mix(in srgb, currentColor 7%, transparent); }
/* Logo walls stay hidden until at least one logo is uploaded; editor notes never reach visitors. */
[data-public] .r-logo-wall:not(:has(image-slot[data-filled])) { display: none !important; }
[data-public] .r-editor-only { display: none !important; }

/* Logo sections: copy that only makes sense with logos, and its stand-in while there are none. */
.r-if-no-logos { display: none; }
[data-public] .r-logo-sec:not(:has(image-slot[data-filled])) .r-if-no-logos { display: block; }
[data-public] .r-logo-sec:not(:has(image-slot[data-filled])) .r-if-logos { display: none; }
/* Canales: rows without an uploaded app logo drop the logo column for visitors. */
[data-public] .r-app-row:not(:has(image-slot[data-filled])) { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) !important; }
[data-public] .r-app-row image-slot:not([data-filled]) { display: none !important; }

/* Contact form honeypot: never visible, never focusable by people. */
.r-honey { position: absolute !important; left: -10000px !important; }

/* Scroll reveals hide content until it enters the viewport; printing shows everything. */
@media print {
  [data-rv] { opacity: 1 !important; translate: none !important; scale: none !important; }
  .r-header { position: static !important; }
}

/* Header menus drop in; closing stays instant. */
@keyframes r-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.r-mega-panel, .r-sheet { animation: r-drop 300ms var(--ease-brand) both; }

/* Hero photo pause button (Inicio). */
.r-hero-pause:hover { background: var(--white) !important; }

/* Payment methods (Inicio): each logo floats in 3D inside its card. The edge comes from
   stacked 1px drop shadows (they follow the logo's own shape) and a soft shadow on the
   card floor breathes with the float. Reduced motion leaves them still, tilted. */
.r-pay-stage { position: relative; perspective: 900px; }
.r-pay-float { position: relative; z-index: 1; transform: rotateX(16deg) rotateY(-20deg) rotateZ(3deg); animation: r-flota 6.4s ease-in-out infinite; }
.r-pay-float > img, .r-pay-float > .r-pay-card { filter: drop-shadow(0 1px 0 var(--pay-edge-1)) drop-shadow(0 1px 0 var(--pay-edge-2)) drop-shadow(0 1px 0 var(--pay-edge-2)) drop-shadow(0 1px 0 var(--pay-edge-3)) drop-shadow(0 1px 0 var(--pay-edge-3)) drop-shadow(0 18px 20px rgba(0,0,0,.4)); }
.r-pay-shine { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, hsla(0,0%,100%,0) 30%, hsla(0,0%,100%,.55) 46%, hsla(0,0%,100%,0) 60%); mix-blend-mode: soft-light; }
.r-pay-floor { position: absolute; left: 50%; bottom: 8%; width: 56%; height: 22px; margin-left: -28%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.6), rgba(0,0,0,0)); animation: r-flota-sombra 6.4s ease-in-out infinite; }
@keyframes r-flota {
  0%, 100% { transform: translateY(0) rotateX(16deg) rotateY(-20deg) rotateZ(3deg); }
  50% { transform: translateY(-14px) rotateX(10deg) rotateY(-8deg) rotateZ(-1deg); }
}
@keyframes r-flota-sombra {
  0%, 100% { transform: scale(1); opacity: .9; }
  50% { transform: scale(.78); opacity: .55; }
}

/* Reduced motion: no loops, no entrances, near-instant transitions. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Compact header: below the width where the full nav fits ──────────────── */
@media (min-width: 940px) {
  .r-sheet { display: none !important; }
}
@media (max-width: 939px) {
  .r-header { padding: 12px 12px 0 !important; }
  .r-bar { width: 100% !important; flex-wrap: nowrap !important; justify-content: space-between !important; }
  .r-bar .r-nav, .r-mega { display: none !important; }
  .r-logo { margin-right: auto !important; }
  .r-menu-btn { display: inline-flex !important; }
}

/* ── Wide desktop down to laptop ───────────────────────────────────────────── */
@media (max-width: 1279px) {
  .r-stats4 .r-stat-v { font-size: clamp(40px, 4.6vw, 64px) !important; line-height: 1.1 !important; }
}

/* ── Soluciones on Inicio: each menu option scrolls to its section here ───── */
/* Side by side, a card that is a menu target keeps its section heading in view. */
@media (min-width: 900px) {
  .r-sol-grid > [id] { scroll-margin-top: calc(clamp(48px, 5vw, 80px) + 196px) !important; }
}
@media (max-width: 899px) {
  .r-sol-grid { grid-template-columns: 1fr !important; }
}

/* ── Tablet ───────────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .r-stats4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; row-gap: 40px !important; }
  .r-stats4 > .r-stat:nth-child(2n) { border-right: 0 !important; }
  .r-salon-hero ~ section .r-stats4 > .r-stat { border-bottom: 1px solid var(--grey-200); }
  .r-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .r-foot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .r-foot-brand { grid-column: 1 / -1; }
  .r-datos-layout { grid-template-columns: 1fr !important; }
  .r-datos-index { position: static !important; }
}

/* ── Phone ────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  /* Side gutters: 20px instead of 32px for every section. */
  main > section, main > sc-if > section, footer, main > div > section { padding-left: 20px !important; padding-right: 20px !important; }

  .r-hero-h1 { font-size: clamp(36px, 10vw, 44px) !important; }
  .r-hero-stage { height: 340px !important; }
  #top p { font-size: 19px !important; line-height: 27px !important; }

  .r-stats-sec { padding-top: 40px !important; padding-bottom: 16px !important; }
  .r-stats4 { grid-template-columns: 1fr !important; row-gap: 0 !important; }
  .r-stats4 > .r-stat { padding: 20px 0 !important; border-right: 0 !important; border-bottom: 1px solid var(--grey-200); }
  .r-stats4 > .r-stat:last-child { border-bottom: 0; }
  .r-stats4 .r-stat-v { font-size: 44px !important; line-height: 1.1 !important; }
  .r-stats-src { padding: 0 !important; }

  .r-hub-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .r-hub-card { min-height: 0 !important; padding: 24px !important; }

  .r-tabs { gap: 12px !important; }
  .r-salon-panels { height: 600px !important; border-radius: 24px !important; }

  .r-integ-card { padding: 24px 24px 0 !important; }
  .r-spacer { height: 24px !important; }

  .r-demo-card { padding: 32px 20px !important; border-radius: 24px !important; }

  .r-foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 32px 20px !important; }


  .r-hub-card image-slot { height: 180px !important; }
  #medios-de-pago .r-integ-card { height: 280px !important; padding-bottom: 8px !important; }
  .r-hub-full { min-height: 0 !important; }
  .r-gap { height: 24px !important; margin-bottom: 24px !important; }
  .r-duo > image-slot:first-child { height: 280px !important; }
  .r-duo > image-slot:last-child { height: 220px !important; }
  .r-app-row { grid-template-columns: 1fr !important; gap: 10px !important; }
  .r-table { overflow-x: auto !important; }
  .r-table > div { min-width: 560px; }
}

@media (max-width: 380px) {
  .r-header { padding: 10px 8px 0 !important; }
}
