/*
 * FavoriteCorner — DOAR mobil / tabletă (max 960px)
 * Desktop: NU se aplică nimic de aici. Fișier încărcat mereu, dar
 * toate regulile stau în @media ca să nu atingă varianta desktop.
 */

/* ========== doar telefon + tabletă ========== */
@media (max-width: 960px) {
  /* anti overflow doar pe ecran mic */
  html, body {
    max-width: 100%;
    overflow-x: clip;
  }

  :root {
    --fc-gutter: clamp(0.4rem, 2.5vw, 1rem);
    --fc-header-h: 58px;
  }

  body {
    font-size: 15px;
    /* loc pentru bara FC mobile */
    padding-top: calc(56px + env(safe-area-inset-top));
  }

  /* Header Kadence: pe telefon folosim bara FC, nu dublăm.
     Ascundem tot #masthead ca să nu rămână titlul „Favoritec…” tăiat. */
  #masthead,
  #main-header,
  #mobile-header,
  #mobile-drawer {
    display: none !important;
  }

  /* iOS: fără zoom la focus pe input */
  input, select, textarea {
    font-size: 16px !important;
  }
  .fc-catalog-sort select,
  .fc-price-row input {
    font-size: 16px !important;
    min-height: 44px;
  }

  /* Hero: FĂRĂ zoom / ken-burns pe telefon — imagine naturală */
  .fc-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .fc-hero-copy {
    margin: 0;
    max-width: none;
    text-align: center;
    padding: 1.5rem var(--fc-gutter) 1.75rem;
    order: 1;
  }
  .fc-hero-sub { margin-left: auto; margin-right: auto; }
  .fc-hero-actions {
    justify-content: center;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
  }
  .fc-hero-actions .fc-btn,
  .fc-hero-actions .wp-block-button__link,
  .fc-hero-actions a.button {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .fc-hero-media {
    order: 0;
    min-height: 38vh;
    max-height: 46vh;
    position: relative;
  }
  .fc-hero-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    /* oprește animația de scale de pe desktop */
    animation: none !important;
    transform: none !important;
  }
  .fc-hero h1 {
    font-size: clamp(1.85rem, 8vw, 2.4rem);
  }

  /* Category banner — cinematic pe telefon */
  .entry-hero {
    --fc-hero-pad-y: 1.65rem;
  }
  .entry-hero::before {
    filter: blur(12px);
    animation: none;
  }
  .entry-hero .hero-container::before,
  .entry-hero .hero-container::after {
    width: 16px;
    height: 16px;
  }
  .entry-hero-container-inner .entry-header,
  .entry-hero .entry-header,
  .entry-hero.product-archive-hero-section .entry-header,
  .entry-hero.product-hero-section .entry-header {
    min-height: 0 !important;
    height: auto !important;
    width: 100%;
    max-width: none;
    margin: 0 auto !important;
    padding: var(--fc-hero-pad-y) var(--fc-gutter) 1.45rem !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }
  .fc-hero-kicker {
    font-size: 9px;
    letter-spacing: 0.26em;
    margin-bottom: 0.75rem;
  }
  .fc-hero-kicker::before,
  .fc-hero-kicker::after { width: 12px; }
  .fc-hero-parent {
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    margin-bottom: 0.35rem;
  }
  .fc-hero-sep {
    width: 6px;
    height: 6px;
    margin-bottom: 0.45rem;
  }
  .fc-hero-main {
    font-size: clamp(1.75rem, 9vw, 2.35rem);
    letter-spacing: -0.025em;
  }
  .entry-hero .page-title,
  .entry-hero .archive-title,
  .entry-hero .entry-header .entry-title,
  .page-title {
    font-size: clamp(1.75rem, 9vw, 2.35rem) !important;
    letter-spacing: -0.02em;
    text-transform: none;
    max-width: none;
  }
  .fc-hero-meta {
    margin-top: 0.95rem;
    padding: 0.4rem 0.85rem;
    font-size: 10px;
    letter-spacing: 0.12em;
  }
  .entry-hero .term-description,
  .entry-hero .archive-description,
  .entry-hero .taxonomy-description {
    font-size: 0.82rem;
    max-width: 30ch;
    padding: 0 0.25rem;
  }
  .entry-hero.product-hero-section {
    --fc-hero-pad-y: 1.1rem;
  }
  .entry-hero.product-hero-section .page-title,
  .entry-hero.product-hero-section .entry-title {
    font-size: clamp(1.15rem, 5.5vw, 1.4rem) !important;
  }

  /* Grid 2 coloane pe telefon */
  .woocommerce ul.products,
  .woocommerce-page ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: clamp(0.7rem, 3vw, 1.1rem) clamp(0.3rem, 1.5vw, 0.55rem) !important;
  }
  .woocommerce ul.products li.product .woocommerce-loop-product__title,
  .woocommerce ul.products li.product .woocommerce-loop-product__title a {
    font-size: 12px !important;
    min-height: 2.5em;
  }
  .woocommerce ul.products li.product .price {
    font-size: 12px !important;
  }
  .fc-card-brand {
    font-size: 9px;
    letter-spacing: 0.14em;
  }
  /* pe touch: butonul pe card mereu vizibil (fără hover) */
  .woocommerce ul.products li.product .button,
  .woocommerce ul.products li.product .added_to_cart {
    opacity: 1 !important;
    transform: none !important;
    display: block !important;
    min-height: 42px;
    font-size: 10px !important;
    padding: 0.55rem 0.4rem !important;
  }
  /* no image zoom on touch — prevents accidental navigation issues */
  .woocommerce ul.products li.product:hover img {
    transform: none !important;
  }

  /* Catalog */
  .fc-catalog {
    grid-template-columns: 1fr;
    padding: 0.65rem var(--fc-gutter) 3rem;
  }
  .fc-catalog-toolbar {
    position: sticky;
    top: calc(56px + env(safe-area-inset-top));
    z-index: 40;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.65rem 0;
    margin: 0 0 0.75rem;
    gap: 0.65rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--fc-line);
  }
  .fc-filters-open {
    display: inline-flex !important;
    flex: 1 1 auto;
    justify-content: center;
    min-height: 44px;
    font-size: 12px;
  }
  .fc-catalog-sort { flex: 1 1 45%; }
  .fc-catalog-count {
    width: 100%;
    order: 3;
    font-size: 12px;
  }

  /* Filtre: bottom sheet */
  .fc-filters {
    position: fixed !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: min(88vh, 720px);
    max-height: min(88vh, 720px);
    border-radius: 16px 16px 0 0;
    transform: translateY(105%) !important;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.14);
    padding: 0.5rem 1.1rem calc(1.25rem + env(safe-area-inset-bottom)) !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 9997;
    background: #fff;
  }
  .fc-filters.is-open { transform: translateY(0) !important; }
  .fc-filters::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: var(--fc-line-2);
    margin: 0.35rem auto 0.85rem;
  }
  .fc-filters-close {
    display: flex !important;
    position: absolute;
    top: 0.55rem;
    right: 0.75rem;
    min-width: 44px;
    min-height: 44px;
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--fc-muted);
    cursor: pointer;
  }
  .fc-filters-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 9996;
  }
  .fc-filters-overlay.is-open {
    opacity: 1;
    visibility: visible;
  }
  .fc-filter-list a,
  .fc-filter-list label {
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 14px;
  }
  .fc-size-opt,
  .fc-price-preset {
    min-height: 44px;
    min-width: 48px;
  }
  .fc-filter-actions {
    position: sticky;
    bottom: 0;
    background: linear-gradient(transparent, #fff 28%);
    padding-top: 1rem;
  }
  .fc-filter-actions .fc-btn {
    width: 100%;
    min-height: 48px;
  }

  /* PDP */
  .single-product div.product {
    display: flex !important;
    flex-direction: column !important;
  }
  .single-product div.product .woocommerce-product-gallery,
  .single-product div.product .images {
    width: 100% !important;
    float: none !important;
    margin: 0 0 1rem !important;
    max-width: 100% !important;
  }
  .single-product div.product .summary,
  .single-product div.product .entry-summary {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 0.15rem 1rem !important;
  }
  .single-product .product_title {
    font-size: 1.2rem !important;
  }
  .single-product div.product .woocommerce-product-gallery__image {
    aspect-ratio: 2 / 3;
    background: var(--fc-bg-soft);
  }
  .single-product div.product .woocommerce-product-gallery__image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: top center !important;
    transform: none !important;
  }
  .single-product .flex-control-thumbs {
    display: flex !important;
    gap: 0.4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0 0.25rem;
    margin: 0 !important;
  }
  .single-product .flex-control-thumbs li {
    flex: 0 0 64px;
    width: 64px !important;
    float: none !important;
  }
  .fc-size-pill {
    min-width: 56px;
    height: 48px;
    font-size: 13px;
  }
  .fc-size-guide,
  .woocommerce-Tabs-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .fc-size-guide table { min-width: 420px; }

  /* Sticky ATC */
  .fc-sticky-atc {
    padding: 0.7rem 0.9rem calc(0.7rem + env(safe-area-inset-bottom));
  }
  .fixteen-toast {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }
  body.single-product.fc-has-sticky-atc {
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }
  #fixteen-cart-drawer {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .fixteen-drawer-footer {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }

  /* Checkout */
  .woocommerce form .form-row input.input-text,
  .woocommerce form .form-row textarea,
  .woocommerce form .form-row select {
    min-height: 48px;
    padding: 0.7rem 0.85rem !important;
  }
  .woocommerce #payment #place_order,
  .woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    width: 100% !important;
    min-height: 52px !important;
  }

  .fx-search-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .related.products ul.products,
  .upsells.products ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  /* ——— FC Mobile Nav bar ——— */
  .fc-mnav {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10050;
    height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 0.55rem 0;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(
      180deg,
      rgba(248, 95, 88, 0.07) 0%,
      rgba(248, 95, 88, 0.02) 50%,
      rgba(255, 255, 255, 0.98) 100%
    );
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--fc-line);
    box-shadow: 0 1px 0 rgba(248, 95, 88, 0.35);
  }
  .fc-mnav::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--fc-coral);
  }
  .fc-mnav-burger {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, transform 0.12s ease;
    min-height: 48px;
    padding: 0 !important;
  }
  .fc-mnav-burger:active {
    transform: scale(0.92);
    background: var(--fc-coral-soft);
  }
  .fc-mnav-burger-lines {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 22px;
  }
  .fc-mnav-burger-lines i {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--fc-ink);
    border-radius: 2px;
    transition: transform 0.28s ease, opacity 0.2s ease, width 0.2s ease;
  }
  .fc-mnav-burger.is-active .fc-mnav-burger-lines i:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .fc-mnav-burger.is-active .fc-mnav-burger-lines i:nth-child(2) {
    opacity: 0;
    width: 0;
  }
  .fc-mnav-burger.is-active .fc-mnav-burger-lines i:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .fc-mnav-logo {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
  }
  .fc-mnav-logo img {
    height: 24px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
  }
  .fc-mnav-logo span {
    font-size: 14px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
  }
  .fc-mnav-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
  }
  .fc-mnav-icon {
    position: relative;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--fc-ink);
    border-radius: 12px;
    cursor: pointer;
    min-height: 44px;
    padding: 0 !important;
    transition: background 0.15s ease, transform 0.12s ease;
  }
  .fc-mnav-icon:active {
    transform: scale(0.9);
    background: var(--fc-coral-soft);
    color: var(--fc-coral-deep);
  }
  .fc-mnav-badge {
    position: absolute;
    top: 6px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 99px;
    background: var(--fc-coral-deep);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
  }
  .fc-mnav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10060;
    background: rgba(26, 26, 26, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
  }
  .fc-mnav-overlay.is-open {
    opacity: 1;
    visibility: visible;
  }
  .fc-mnav-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10070;
    max-height: min(88vh, 640px);
    background: #fff;
    border-radius: 18px 18px 0 0;
    padding: 0.35rem 1.15rem calc(1.25rem + env(safe-area-inset-bottom));
    transform: translateY(105%);
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.16);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .fc-mnav-drawer.is-open { transform: translateY(0); }
  .fc-mnav-drawer-handle {
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: var(--fc-line-2);
    margin: 0.45rem auto 0.65rem;
  }
  .fc-mnav-drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
  }
  .fc-mnav-drawer-top strong {
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 600;
  }
  .fc-mnav-close {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--fc-bg-soft);
    border-radius: 50%;
    font-size: 1.6rem;
    color: var(--fc-muted);
    cursor: pointer;
    min-height: 44px;
    padding: 0 !important;
  }
  .fc-mnav-close:active {
    transform: scale(0.9);
    background: var(--fc-coral-soft);
    color: var(--fc-coral);
  }
  .fc-mnav-links {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .fc-mnav-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 0.35rem 0.25rem;
    border-bottom: 1px solid var(--fc-line);
    font-size: 17px;
    color: var(--fc-ink);
    border-radius: 8px;
    transition: background 0.15s ease, transform 0.12s ease;
  }
  .fc-mnav-links a em {
    font-style: normal;
    font-size: 12px;
    background: var(--fc-coral-soft);
    color: var(--fc-coral-deep);
    padding: 0.2rem 0.5rem;
    border-radius: 99px;
  }
  .fc-mnav-links a.is-current { color: var(--fc-coral-deep); font-weight: 500; }
  .fc-mnav-links a.is-pressed,
  .fc-mnav-links a:active {
    transform: scale(0.98);
    background: var(--fc-coral-soft);
    color: var(--fc-coral-deep);
  }
  .fc-mnav-search-cta {
    margin-top: 1.1rem;
    width: 100%;
    min-height: 52px;
    border: 1px solid var(--fc-ink);
    background: #fff;
    color: var(--fc-ink);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 500;
    border-radius: 0;
    cursor: pointer;
  }
  .fc-mnav-search-cta:active {
    background: var(--fc-coral-deep);
    border-color: var(--fc-coral-deep);
    color: #fff;
  }
  .fc-mnav-note {
    text-align: center;
    margin: 1rem 0 0;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fc-muted);
  }
  html.fc-mnav-lock,
  html.fc-filters-lock {
    overflow: hidden;
  }
}

/* tablet landscape: 3 coloane produse */
@media (min-width: 701px) and (max-width: 960px) {
  .woocommerce ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: clamp(1rem, 2.5vw, 1.4rem) clamp(0.5rem, 1.2vw, 0.85rem) !important;
  }
}

/* pe ecran îngust */
@media (max-width: 480px) {
  .woocommerce ul.products {
    gap: clamp(0.55rem, 2.5vw, 0.95rem) clamp(0.25rem, 1vw, 0.45rem) !important;
  }
  .fc-catalog {
    padding: 0.5rem var(--fc-gutter) 3rem;
  }
}

/* Desktop: bara FC nu apare deloc */
@media (min-width: 961px) {
  .fc-mnav,
  .fc-mnav-overlay,
  .fc-mnav-drawer {
    display: none !important;
  }
}
