/* Phase 4 — UX and conversion layer. Uses only the established BikerPatches palette. */

.bp-skip-link {
  position: fixed;
  z-index: 100000;
  top: 12px;
  left: 12px;
  transform: translateY(-180%);
  padding: 10px 16px;
  background: var(--bp-background);
  color: var(--bp-text);
  border: 2px solid var(--bp-primary);
  font-weight: 700;
  text-decoration: none;
  transition: transform .15s ease;
}
.bp-skip-link:focus { transform: translateY(0); }

/* Consistent visible keyboard focus without changing normal pointer appearance. */
.bp-phase4 :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--bp-primary);
  outline-offset: 3px;
}
.bp-phase4 .btn-order:focus-visible,
.bp-phase4 .btn-live:focus-visible { outline-color: var(--bp-text-light); box-shadow: 0 0 0 3px var(--bp-primary); }

/* Header/navigation interaction. */
.bp-phase4 .navbar-toggler { min-width: 46px; min-height: 46px; border-radius: 0; }
.bp-phase4 .navbar .nav-link,
.bp-phase4 .navbar .dropdown-item,
.bp-phase4 .bp-store-icon-link,
.bp-phase4 .bp-store-icon-button { min-height: 44px; }
.bp-phase4 .navbar .nav-link[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.bp-mobile-brand { display: none; }

/* Conversion panel deliberately mirrors existing dark/light CTA language. */
.bp-conversion-panel { padding: 52px 0; background: var(--bp-dark-section); color: var(--bp-text-light); }
.bp-conversion-inner { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(250px,.7fr); gap: 38px; align-items: center; }
.bp-conversion-kicker { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; opacity: .78; }
.bp-conversion-panel h2 { margin: 0 0 12px; color: var(--bp-text-light); font-size: clamp(28px,4vw,46px); line-height: 1.05; text-transform: uppercase; }
.bp-conversion-panel p { max-width: 760px; margin: 0; color: var(--bp-text-light); line-height: 1.65; opacity: .9; }
.bp-conversion-actions { display: grid; gap: 10px; justify-items: stretch; }
.bp-conversion-actions a { text-align: center; text-decoration: none; }
.bp-conversion-shop { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; color: var(--bp-text-light); font-weight: 800; text-decoration: underline; text-underline-offset: 4px; }
.bp-conversion-shop:hover { color: var(--bp-text-light); opacity: .8; }
.bp-related-services { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 18px; align-items: baseline; font-size: 13px; }
.bp-related-services > span { font-weight: 800; text-transform: uppercase; letter-spacing: .7px; }
.bp-related-services a { color: var(--bp-text-light); text-decoration: underline; text-underline-offset: 3px; }

/* Cards: stronger affordance while preserving the existing geometry. */
.bp-project-card,
.bp-case-card,
.bp-testimonial-card,
.woocommerce ul.products li.product { transition: transform .18s ease, box-shadow .18s ease; }
.bp-project-card:focus-within,
.bp-case-card:focus-within,
.bp-testimonial-card:focus-within,
.woocommerce ul.products li.product:focus-within { box-shadow: 0 14px 34px rgba(0,0,0,.18); }
.bp-card-cta { min-height: 40px; display: inline-flex; align-items: center; }

/* Forms: make interaction states clear without touching secure submission logic. */
.bp-phase4 .contact :where(input.form-control, select.form-control, textarea.form-control),
.bp-phase4 .woocommerce :where(input.input-text, select, textarea) { min-height: 48px; }
.bp-phase4 .contact textarea.form-control,
.bp-phase4 .woocommerce textarea { min-height: 120px; }
.bp-phase4 .contact .input-group:focus-within .input-group-text { border-color: var(--bp-primary); }
.bp-phase4 .contact :where(input, select, textarea):focus { border-color: var(--bp-primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bp-primary) 20%, transparent); }
.bp-phase4 .bp-field-invalid :where(input, select, textarea),
.bp-phase4 :where(input, select, textarea).bp-field-invalid { border-color: var(--bp-primary); }
.bp-phase4 input[type="file"] { max-width: 100%; padding: 8px; border: 1px solid var(--bp-form-border-soft); background: var(--bp-form-bg); color: var(--bp-form-text); }
.bp-phase4 input[type="file"]::file-selector-button { min-height: 38px; margin-right: 10px; padding: 7px 12px; border: 0; background: var(--bp-button-bg); color: var(--bp-button-text); font-weight: 700; cursor: pointer; }
.bp-phase4 .bp-file-list { margin-top: 10px; }
.bp-phase4 .bp-form-notice { scroll-margin-top: 24px; }
.bp-phase4 .bp-wizard-actions button { min-height: 46px; }
.bp-phase4 .order-summary { position: sticky; top: 24px; }
.admin-bar.bp-phase4 .order-summary { top: 56px; }

/* WooCommerce conversion flow. */
.bp-phase4.woocommerce ul.products li.product .button,
.bp-phase4 .wc-block-components-product-button__button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; }
.bp-phase4.woocommerce ul.products li.product .woocommerce-loop-product__title { min-height: 2.5em; }
.bp-phase4 .woocommerce-result-count { margin-bottom: 12px; }
.bp-phase4 .woocommerce-ordering select { min-height: 44px; }
.bp-phase4 .woocommerce form .form-row .input-text,
.bp-phase4 .woocommerce form .form-row select { min-height: 48px; }
.bp-phase4 .woocommerce-error,
.bp-phase4 .woocommerce-info,
.bp-phase4 .woocommerce-message { scroll-margin-top: 24px; }
.bp-phase4 .woocommerce-cart-form .product-name a,
.bp-phase4 .woocommerce-checkout-review-order-table .product-name { font-weight: 700; }

/* Fixed mobile dock is intentionally mobile-only and respects safe-area insets. */
.bp-mobile-actions { display: none; }

@media (max-width: 991.98px) {
  .bp-phase4.bp-has-mobile-actions { padding-bottom: 72px; }
  .bp-phase4 .top-bar .row > div:first-child { text-align: center; }
  .bp-phase4 .top-bar .social-links { display: none; }
  .bp-phase4 .navbar > .container { position: relative; min-height: 76px; justify-content: space-between; }
  .bp-mobile-brand { display: inline-flex; align-items: center; max-width: 156px; margin-right: auto; }
  .bp-mobile-brand img { width: auto; max-width: 156px; max-height: 70px; object-fit: contain; }
  .bp-phase4 .navbar-toggler { margin-left: 12px; }
  .bp-phase4 .navbar-collapse { width: 100%; max-height: calc(100vh - 140px); overflow-y: auto; overscroll-behavior: contain; background: var(--bp-header-bg); }
  .bp-phase4 .navbar-nav { width: 100%; align-items: stretch !important; padding: 10px 0 18px; }
  .bp-phase4 .navbar-nav > li,
  .bp-phase4 .navbar-nav > .nav-item { width: 100%; }
  .bp-phase4 .navbar-nav .navbar-brand { display: none; }
  .bp-phase4 .navbar .nav-link,
  .bp-phase4 .navbar .dropdown-item,
  .bp-phase4 .bp-store-icon-link,
  .bp-phase4 .bp-store-icon-button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 11px 14px; }
  .bp-phase4 .navbar .dropdown-menu { position: static !important; width: 100%; transform: none !important; }
  .bp-phase4 .bp-store-search-item { position: relative; }
  .bp-phase4 .bp-product-search { position: static; width: 100%; margin: 4px 0 8px; }
  .bp-phase4 .navbar-nav .btn { width: calc(100% - 28px); margin: 8px 14px 0; text-align: center; }

  .bp-conversion-inner { grid-template-columns: 1fr; gap: 24px; }
  .bp-conversion-actions { grid-template-columns: 1fr 1fr; }
  .bp-conversion-shop { grid-column: 1 / -1; }
  .bp-phase4 .order-summary { position: static; }

  .bp-mobile-actions {
    position: fixed;
    z-index: 9998;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    min-height: 64px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--bp-dark);
    border-top: 1px solid var(--bp-border);
    box-shadow: 0 -8px 24px rgba(0,0,0,.18);
  }
  .bp-mobile-action { position: relative; display: flex; min-width: 0; min-height: 64px; align-items: center; justify-content: center; flex-direction: column; gap: 3px; padding: 7px 4px; color: var(--bp-text-light); font-size: 12px; font-weight: 800; text-decoration: none; }
  .bp-mobile-action:hover,
  .bp-mobile-action:focus { color: var(--bp-text-light); }
  .bp-mobile-action i { font-size: 17px; }
  .bp-mobile-action-primary { background: var(--bp-button-bg); color: var(--bp-button-text); }
  .bp-mobile-action-primary:hover,
  .bp-mobile-action-primary:focus { color: var(--bp-button-text); background: var(--bp-button-hover); }
  .bp-mobile-cart-count { position: absolute; top: 6px; left: calc(50% + 8px); display: inline-flex; min-width: 18px; height: 18px; align-items: center; justify-content: center; padding: 0 5px; border-radius: 999px; background: var(--bp-primary); color: var(--bp-text-light); font-size: 10px; line-height: 1; }
  .bp-mobile-cart-count.is-empty { display: none; }
  .bp-input-focused .bp-mobile-actions { transform: translateY(110%); }
}

@media (max-width: 575.98px) {
  .bp-conversion-panel { padding: 42px 0; }
  .bp-conversion-actions { grid-template-columns: 1fr; }
  .bp-conversion-shop { grid-column: auto; }
  .bp-related-services { align-items: flex-start; flex-direction: column; }
  .bp-phase4 .top-bar a { display: inline-flex; min-height: 36px; align-items: center; }
  .bp-phase4 .woocommerce .woocommerce-ordering,
  .bp-phase4 .woocommerce .woocommerce-result-count { float: none; width: 100%; }
  .bp-phase4 .woocommerce .woocommerce-ordering select { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .bp-phase4 *,
  .bp-phase4 *::before,
  .bp-phase4 *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
