/*
 * Instabooster — packs area: hand-written additions/fixes on top of live.css (generated, do not
 * edit). Plain CSS served as is (no build step). Keep every rule inside @layer ib and scoped to
 * html[data-brand="ib"] (add :where(:has(.ibm-<template>)) for page-specific rules), like live.css.
 *
 * Sources: app/modules/bundles/views/packs.php (inline <style>) and detail.php (inline <style>)
 * + assets/css/pack-detail.css — the rules of states the crawl never rendered.
 */
@layer ib {
  /* live.css lost these shorthands (`background: var(--pk-gradient)` / `border: 2px solid …`
     next to a longhand → empty longhands in the crawl): restored from the PHP inline CSS. */
  html[data-brand="ib"]:where(:has(.ibm-packs)) .packs-price__value {
    background: var(--pk-gradient);
    -webkit-background-clip: text;
    background-clip: text;
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkd-spinner {
    border: 2px solid var(--pk-gray-200);
    border-top-color: var(--pk-primary);
  }

  /* pack-detail.css:161, missing from the crawl: dot between the trust items. */
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-buy__trust li + li::before {
    content: "";
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #d1d5db;
  }

  /* /packs: "+ N servicio(s) más" line (packs with > 4 items) and the empty state. */
  html[data-brand="ib"]:where(:has(.ibm-packs)) .packs-items-list li.packs-items-extra {
    background: transparent;
    border-color: transparent;
    color: var(--pk-gray-400);
    font-style: italic;
    padding: 2px 12px 0;
    font-size: 0.83rem;
  }
  html[data-brand="ib"]:where(:has(.ibm-packs)) .packs-items-list li.packs-items-extra:hover {
    transform: none;
  }
  html[data-brand="ib"]:where(:has(.ibm-packs)) .packs-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--pk-gray-600);
  }
  html[data-brand="ib"]:where(:has(.ibm-packs)) .packs-empty svg {
    color: var(--pk-gray-400);
    margin-bottom: 18px;
  }
  html[data-brand="ib"]:where(:has(.ibm-packs)) .packs-empty h3 {
    font-weight: 700;
    color: var(--pk-gray-800);
    margin: 0 0 8px;
    font-size: 1.4rem;
  }
  html[data-brand="ib"]:where(:has(.ibm-packs)) .packs-empty p {
    margin: 0 0 24px;
  }

  /* /pack/{slug}: comments textarea of custom_msg items (detail.php inline <style>). */
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkd-multi-comments-input {
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.5;
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkd-multi-comments-count {
    margin-top: 6px;
    font-size: 0.78rem;
    color: #6b7280;
    font-weight: 600;
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkd-multi-comments-count .pkd-multi-c-now {
    color: #e61c72;
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkd-multi-comments-count.is-ok .pkd-multi-c-now {
    color: #10b981;
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkd-multi-comments-count.is-invalid .pkd-multi-c-now {
    color: #b91c1c;
  }

  /* Platform validation states (live only had the browser's `required` bubbles + #pkd-error). */
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkd-form-input.is-invalid {
    border-color: #f87171;
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkd-form-input.is-invalid:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkd-form-help--error {
    color: #b91c1c;
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkd-form-help--warn {
    color: #854d0e;
  }

  /* Direct buy + «Añadir al carrito» (platform cart, owner exception): the cart action is the
     outline variant of the .pkd-cta pill, same height. The sidebar is too narrow for the live CTA
     label («Lanzar mi cuenta ahora · 32,10 €») and the cart button on one row, so they share a
     row only when both fit (flex-wrap) and otherwise stack full width, like ≤ 480 px. */
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkd-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkd-actions .pkd-cta {
    flex: 1 1 auto;
    width: auto;
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkd-cart-add {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 54px;
    margin: 0;
    padding: 12px 20px;
    border: 2px solid #e61c72;
    border-radius: 999px;
    background: #fff;
    color: #e61c72;
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.18s, background-color 0.18s;
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkd-cart-add:hover:not(:disabled) {
    background: rgba(230, 28, 114, 0.06);
    transform: translateY(-2px);
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkd-cart-add:focus-visible {
    outline: 2px solid #e61c72;
    outline-offset: 2px;
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkd-cart-add:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
  @media (max-width: 480px) {
    html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkd-actions {
      flex-direction: column;
    }
    html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkd-actions > button {
      width: 100%;
    }
  }

  /* Integrated buy card (owner 2026-10-31, same language as the service card `.ibb`): pink
     step numbers, verified profile items collapse into one «✓ @usuario · Cambiar» row,
     payment marks under the trust line. */
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-buy__step i {
    background: linear-gradient(135deg, var(--primary, #e61c72), var(--primary-light, #ff4d94));
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkd-link-row.is-filled {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkd-link-row.is-filled .pkd-link-row-head {
    margin: 0;
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkd-filled {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #111827;
    font-size: 0.88rem;
    font-weight: 700;
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkd-filled__ok {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-size: 0.7rem;
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkd-filled__edit {
    padding: 2px 4px;
    border: 0;
    background: none;
    color: #6b7280;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
  }
  html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-buy__pay {
    margin: 12px 0 0;
  }
  /* phones/tablets: the one-column grid is `1fr`, i.e. at least its widest child's min-content,
     so the «Lo que incluye» card (nowrap badge + long title) grew past the screen and was cut
     off by the page's overflow: hidden. minmax(0, 1fr) keeps the column at the container width. */
  @media (max-width: 1023px) {
    html[data-brand="ib"]:where(:has(.ibm-pack)) .pkx-page .pkx__grid {
      grid-template-columns: minmax(0, 1fr);
    }
  }
}
