/* ==========================================================================
   Kabayan Center — app-authored additions to the storefront theme.

   These rules belong to the application, not to the theme. They are kept out
   of frontstore/css/style.css because that file is a straight export of the
   design prototype and is replaced wholesale every time the theme is
   re-exported — anything added to it would be silently dropped. master.blade.php
   loads this file after style.css, so equal-specificity rules here win.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero — real, owner-managed pictures
   -------------------------------------------------------------------------- */

/* The theme hardcodes three slides (track 300%, slide 33.3333%). The number of
   slides is now whatever the owner has active, so both sizes are derived from
   the --hero-slides property that the hero partial sets on .hero-carousel. */
.hero-carousel__track {
  width: calc(var(--hero-slides, 1) * 100%);
}

.hero-carousel__slide {
  flex: 0 0 calc(100% / var(--hero-slides, 1));
}

/* The slides now hold real links. A link inside a clipped slide makes the browser
   scroll .hero-carousel sideways to reveal it on Tab, and because the carousel moves
   with transform that scroll offset never goes away - the track stays misaligned for
   the rest of the visit. `clip` is not a scroll container, so there is nothing to
   scroll. Browsers too old for it keep the theme's `hidden` and behave as before. */
.hero-carousel {
  overflow: clip;
}

/* On a phone the theme keeps this box 420px tall while the width drops to ~360px,
   which crops a wide banner into a narrow portrait window and throws most of the
   designed-in wording away (PRD section 8). Below the theme's own breakpoint the box
   takes the banner's shape instead, so the whole picture stays visible. */
@media (max-width: 991.98px) {
  .hero-carousel {
    height: auto;
    aspect-ratio: 1600 / 840;
  }
}

/* Owner-supplied pictures arrive in any size; fill the box without stretching
   the picture out of shape. */
.hero-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The whole picture is the click target, not just the top-left corner of it. */
.hero-carousel__link,
.promo-tile__link {
  display: block;
  width: 100%;
  height: 100%;
}

/* The theme gives every promo tile a pointer cursor because its tiles were always
   links. The link is optional now, so a tile the owner left unlinked must not
   pretend to be clickable. */
.promo-tile {
  cursor: default;
}

.promo-tile__link,
a.promo-tile {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.promo-tile .image-placeholder {
  min-height: 150px;
}

/* Real photos fill the same boxes the theme used for placeholders. */
.catalog-card__media img,
.blog-card__media img,
.blog-post-hero img,
.blog-post-related__media img,
.product-gallery__photo,
.product-gallery__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-gallery__main {
  overflow: clip;
  touch-action: pan-y;
}

.product-gallery__track {
  display: flex;
  height: 100%;
  width: calc(var(--gallery-slides, 1) * 100%);
  transition: transform var(--carousel-transition, 0.35s ease);
  will-change: transform;
}

.product-gallery__slide {
  flex: 0 0 calc(100% / var(--gallery-slides, 1));
  height: 100%;
  min-width: 0;
}

.product-gallery__thumb {
  padding: 0;
  overflow: hidden;
}

.contact-form__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Sticky footer — short pages
   -------------------------------------------------------------------------- */

/* A page with one card (the repair list, an empty search, a legal page) is
   shorter than the window. The theme sizes .site-canvas to its content, so
   the body colour showed as a strip under the footer. The canvas is at
   least the viewport tall and the page <main> grows, so the footer sits on
   the bottom. The theme's 40px footer margin is left alone. */
.site-canvas {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-canvas > main {
  flex: 1 0 auto;
}

/* --------------------------------------------------------------------------
   Cart toasts + badge
   -------------------------------------------------------------------------- */

/* cart.js talks to window.Site.toast on the old storefront. The new theme
   does not load that file, so add-to-cart succeeded with no visible note.
   These rules style the fallback toast cart.js now mounts on the body. */
#kc-toast-region {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.kc-toast {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-float);
  pointer-events: auto;
}

.kc-toast--success {
  border: 1px solid var(--color-primary-tint-2);
  background: var(--color-primary-tint);
  color: var(--color-primary-dark);
}

.kc-toast--error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: var(--color-error);
}

.kc-toast--info {
  border: 1px solid var(--color-border);
}

.kc-toast.is-leaving {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* display:flex on the theme badge beats the HTML hidden attribute, so an
   empty cart still showed "0". Hidden means gone. */
.cart-badge[hidden],
.mobile-fab__badge[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Review slider — slide count is dynamic
   -------------------------------------------------------------------------- */

.review-slider__track {
  width: calc(var(--review-slides, 1) * 100%);
}

.review-slider__slide {
  flex: 0 0 calc(100% / var(--review-slides, 1));
}

/* --------------------------------------------------------------------------
   Mobile cart FAB — vertically centred on the right (taks.md)
   -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
  .mobile-fab--cart-mid {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1059;
  }

  .navbar-floating .tab {
    text-align: center;
    line-height: 1.2;
  }
}

/* --------------------------------------------------------------------------
   Blog pager as links + confirmation cart thumbs
   -------------------------------------------------------------------------- */

a.blog-pagination__arrow,
a.blog-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.blog-pagination__arrow.is-disabled {
  color: var(--color-text-faint);
  cursor: not-allowed;
}

.cart-table__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   Checkout — remove icon, tighter title, Place order shake
   -------------------------------------------------------------------------- */

.checkout-header {
  gap: 2px;
}

.checkout-header h1 {
  line-height: 1.1;
}

.checkout-main {
  gap: 12px;
}

.checkout-aside .booking-card__subtitle {
  margin-top: 4px;
}

.cart-table__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-error);
  cursor: pointer;
}

.cart-table__remove:hover,
.cart-table__remove:focus {
  background: #fef2f2;
  color: #b91c1c;
}

.cart-table__remove:focus-visible {
  outline: 2px solid var(--color-error);
  outline-offset: 2px;
}

.checkout-grid .cart-table {
  table-layout: fixed;
}

.checkout-grid .cart-table__col-qty {
  width: 132px;
}

.checkout-grid .cart-table__col-price {
  width: 120px;
}

.checkout-grid .cart-table__col-action {
  width: 44px;
}

.checkout-grid .cart-table th:nth-child(2),
.checkout-grid .cart-table td:nth-child(2) {
  text-align: center;
}

.checkout-grid .cart-table th:nth-child(3),
.checkout-grid .cart-table td:nth-child(3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.checkout-grid .cart-table th:last-child,
.checkout-grid .cart-table td:last-child:not([colspan]) {
  width: 44px;
  text-align: right;
  padding-left: 8px;
}

.cart-table .qty-stepper {
  display: inline-flex;
  width: 100px;
}

.cart-table .qty-stepper__btn {
  width: 32px;
  height: 32px;
  font-size: 16px;
}

.cart-table .qty-stepper__value {
  width: 36px;
  min-width: 36px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.cart-table .qty-stepper__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cart-table .qty-stepper__btn:disabled:hover {
  background: var(--color-surface);
}

.cart-table .qty-stepper + .cart-table__price-each {
  margin-top: 4px;
}

@keyframes checkout-place-shake {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-8px); }
  65% { transform: translateX(8px); }
}

#co-order-submit:hover,
#co-order-submit:focus-visible,
#co-order-submit.is-shake {
  animation: checkout-place-shake 1.2s ease-in-out 1;
}

@media (prefers-reduced-motion: reduce) {
  #co-order-submit:hover,
  #co-order-submit:focus-visible,
  #co-order-submit.is-shake {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Service details — Submit booking attention wiggle

   Gentle loop that rests most of each cycle so it draws the eye without
   feeling aggressive. Stops while disabled (submitting), while .is-shake
   runs for validation feedback, and for prefers-reduced-motion.
   Transform only — layout box stays put so clicks are unaffected.
   -------------------------------------------------------------------------- */

@keyframes booking-submit-wiggle {
  0%, 14% { transform: translateX(0) rotate(0); }
  3.5% { transform: translateX(-4px) rotate(-1.5deg); }
  7% { transform: translateX(4px) rotate(1.5deg); }
  10.5% { transform: translateX(-3px) rotate(-1deg); }
  14%, 100% { transform: translateX(0) rotate(0); }
}

#kc-booking-submit:not(:disabled):not(.is-shake) {
  animation: booking-submit-wiggle 2.8s ease-in-out infinite;
}

#kc-booking-submit.is-shake {
  animation: btn-shake 0.5s ease-in-out;
}

#kc-booking-submit:disabled {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  #kc-booking-submit:not(:disabled):not(.is-shake),
  #kc-booking-submit.is-shake {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Catalog pager — shop, services, category listings
   -------------------------------------------------------------------------- */

.catalog-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.catalog-pager__btn {
  gap: 6px;
}

.catalog-pager__btn svg {
  flex-shrink: 0;
}

/* Disabled prev/next: muted, no fill — contrast with btn-brand-primary */
.catalog-pager__btn.is-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-faint);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14.5px;
  white-space: nowrap;
  cursor: not-allowed;
  pointer-events: none;
}

.catalog-pager__status {
  min-width: 7em;
  text-align: center;
}

.blog-hero__overlay {
  z-index: 1;
}

.blog-hero__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   Service card — clickable title + From/To price range
   -------------------------------------------------------------------------- */

.catalog-card__title-link {
  color: inherit;
  text-decoration: none;
}

.catalog-card__title-link:hover,
.catalog-card__title-link:focus-visible {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.catalog-card__price-row {
  flex-wrap: wrap;
  row-gap: 2px;
}

.catalog-card__price-sep {
  color: var(--color-text-muted);
  font-size: 13px;
}

