/**
 * Homepage product layouts
 * Makes all product lists scrollable horizontally on desktop (like mobile).
 */

.tecsa-home-main-inner {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.tecsa-carousel-wrapper {
  cursor: grab;
  touch-action: pan-y;
}

.tecsa-carousel-wrapper.tecsa-hero-grabbing {
  cursor: grabbing;
  user-select: none;
}

.tecsa-carousel-wrapper .tecsa-hero-track {
  display: flex;
  align-items: flex-start;
  width: 100%;
  will-change: transform;
  transform: translate3d(0,0,0);
  transition: transform .55s cubic-bezier(.22,.8,.26,1);
}

.tecsa-carousel-wrapper .tecsa-hero-track.is-dragging {
  transition: none;
}

.tecsa-carousel-wrapper .tecsa-hero-slide {
  flex: 0 0 100%;
  width: 100%;
  align-self: flex-start;
}

/* Prevent the browser from dragging images (ghost image) while still allowing link clicks. */
.tecsa-carousel-wrapper .tecsa-hero-img {
  -webkit-user-drag: none;
  user-select: none;
}

.tecsa-carousel-wrapper .tecsa-hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 80px;
  border: 0;
  background: rgba(229, 231, 235, 0.9);
  color: #000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 400;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: opacity .2s ease, background-color .2s ease, transform .2s ease, outline-color .15s ease;
  z-index: 4;
}

.tecsa-carousel-wrapper .tecsa-hero-nav:focus {
  outline: none;
}

.tecsa-carousel-wrapper .tecsa-hero-nav:focus-visible {
  outline: 2px solid rgba(0, 170, 236, 0.9);
  outline-offset: 2px;
}

.tecsa-carousel-wrapper .tecsa-hero-nav-prev {
  left: 0;
  border-radius: 0 12px 12px 0;
}

.tecsa-carousel-wrapper .tecsa-hero-nav-next {
  right: 0;
  border-radius: 12px 0 0 12px;
}

@media (min-width: 1024px) {
  .tecsa-carousel-wrapper:hover .tecsa-hero-nav {
    opacity: 1;
    pointer-events: auto;
  }

  .tecsa-carousel-wrapper .tecsa-hero-nav:hover {
    background: #d1d5db;
    transform: translateY(-50%) scale(1.05);
    outline-color: transparent;
  }
}

/* Homepage compact cards: centered price (mobile + desktop); category line omitted in markup */
#app .tecsa-home-compact-card .tecsa-home-price-row {
  text-align: center;
}

#app .tecsa-home-compact-card .tecsa-home-price.tecsa-price-current--brand {
  color: #00aaec;
}

#app .tecsa-home-compact-card .tecsa-save-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #16a34a;
  color: #fff;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  z-index: 2;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
}

#app .tecsa-home-compact-card {
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, outline-color 0.2s ease;
}

#app .tecsa-home-compact-card:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: 0 16px 26px -14px rgba(0, 0, 0, 0.42);
  outline-color: rgba(0, 170, 236, 0.55);
}

#app .tecsa-home-compact-card .tecsa-home-product-title {
  font-weight: 600;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

/* Make all product lists scrollable horizontally everywhere */
#app .tecsa-home-product-row,
#app #our-products-container {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  touch-action: pan-x pan-y;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#app .tecsa-home-product-row.is-dragging,
#app #our-products-container.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
  user-select: none;
}

#app .tecsa-home-product-row::-webkit-scrollbar,
#app #our-products-container::-webkit-scrollbar {
  display: none;
}

/* Base card sizing for horizontal scroll lists */
#app .tecsa-home-product-row .tecsa-home-compact-card,
#app #our-products-container .tecsa-home-compact-card {
  flex: 0 0 auto !important;
  min-width: 130px !important;
  width: 130px !important;
  scroll-snap-align: start;
}

@media (min-width: 768px) {
  #app .tecsa-home-product-row .tecsa-home-compact-card,
  #app #our-products-container .tecsa-home-compact-card {
    min-width: 160px !important;
    width: 160px !important;
  }
}

@media (min-width: 1024px) {
  #app .tecsa-home-product-row .tecsa-home-compact-card,
  #app #our-products-container .tecsa-home-compact-card {
    min-width: 200px !important;
    width: 200px !important;
  }
  
  /* Disable snap scrolling on desktop so it behaves like a normal grid row */
  #app .tecsa-home-product-row {
    scroll-snap-type: none !important;
  }
  
  /* Desktop-only typography */
  #app .tecsa-home-compact-card .tecsa-home-product-title {
    font-size: 0.9375rem;
    line-height: 1.35;
    font-weight: 600;
    color: #171717;
    letter-spacing: -0.01em;
  }

  #app .tecsa-home-compact-card .tecsa-home-price {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: #171717;
  }

  #app .tecsa-home-compact-card .tecsa-home-price.tecsa-price-current--sale {
    color: #dc2626;
  }

  #app .tecsa-home-compact-card .tecsa-home-price .text-xs {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0;
    color: #525252;
  }

  /* Sale old-price line sits alongside current price */
  #app .tecsa-home-compact-card p .text-gray-400 {
    font-size: 0.8125rem;
  }

  #app .tecsa-home-compact-card p .text-gray-400 .text-\[10px\] {
    font-size: 0.6875rem !important;
  }
}

@media (min-width: 1280px) {
  #app .tecsa-home-product-row .tecsa-home-compact-card,
  #app #our-products-container .tecsa-home-compact-card {
    min-width: 220px !important;
    width: 220px !important;
  }

  #app .tecsa-home-compact-card .tecsa-home-product-title {
    font-size: 1rem;
  }

  #app .tecsa-home-compact-card .tecsa-home-price {
    font-size: 1.125rem;
  }

  #app .tecsa-home-compact-card .tecsa-home-price .text-xs {
    font-size: 0.875rem;
  }
}
