/* ── Agrovaru Esilehe Tooted ─────────────────────────────

   Palette: #ffb900 amber | #3c464b charcoal | #ca0101 red

──────────────────────────────────────────────────────── */

:root {

  --ahp-amber:   #ffb900;

  --ahp-amber-d: #e6a700;

  --ahp-dark:    #3c464b;

  --ahp-light:   #f5f4f1;

  --ahp-white:   #ffffff;

  --ahp-border:  #e2e0dc;

  --ahp-radius:  6px;

  --ahp-gap:     14px;

  --ahp-trans:   .22s cubic-bezier(.4,0,.2,1);

  --ahp-delay:   0ms;

}



/* ── BADGE ──────────────────────────────────────────── */

.ahp-item-badge {

  display: inline-block;

  padding: 2px 8px;

  background: var(--ahp-amber);

  color: var(--ahp-dark);

  font-size: 9px;

  font-weight: 800;

  text-transform: uppercase;

  letter-spacing: .8px;

  border-radius: 2px;

  margin-bottom: 5px;

}



/* ══════════════════════════════════════════════════════

   GRID STRUKTUUR

══════════════════════════════════════════════════════ */

.ahp-grid-wrap {

  max-width: 1400px;

  margin: 0 auto;

  display: flex;

  flex-direction: column;

  gap: var(--ahp-gap);

}

.ahp-grid-featured {

  display: grid;

  gap: var(--ahp-gap);

}

.ahp-grid-featured.ahp-featured-1 { grid-template-columns: 1fr; }

.ahp-grid-featured.ahp-featured-2 { grid-template-columns: repeat(2, 1fr); }

.ahp-grid-featured.ahp-featured-3 { grid-template-columns: repeat(3, 1fr); }

.ahp-grid-featured.ahp-featured-4 { grid-template-columns: repeat(4, 1fr); }



.ahp-grid {

  display: grid;

  gap: var(--ahp-gap);

}

.ahp-grid.ahp-cols-2 { grid-template-columns: repeat(2, 1fr); }

.ahp-grid.ahp-cols-3 { grid-template-columns: repeat(3, 1fr); }

.ahp-grid.ahp-cols-4 { grid-template-columns: repeat(4, 1fr); }



/* ══════════════════════════════════════════════════════

   GRID ITEM

══════════════════════════════════════════════════════ */

.ahp-grid-item {

  position: relative;

  /* Staggered entrance */

  opacity: 0;

  transform: translateY(16px);

  transition:

    opacity .4s ease var(--ahp-delay),

    transform .4s ease var(--ahp-delay);

}

.ahp-grid-item.ahp-visible {

  opacity: 1;

  transform: translateY(0);

}



/* ── Jooksev rõngas ─────────────────────────────────── */

.ahp-ring-wrap {

  position: absolute;

  inset: -2px;

  border-radius: calc(var(--ahp-radius) + 2px);

  overflow: hidden;

  pointer-events: none;

  z-index: 2;

  opacity: 0;

  transition: opacity .3s ease;

}

.ahp-grid-item:hover .ahp-ring-wrap { opacity: 1; }



.ahp-ring-spin {

  position: absolute;

  inset: -200%;

  background: conic-gradient(

    from 0deg,

    transparent 0deg,

    transparent 240deg,

    var(--ahp-amber) 285deg,

    rgba(255,185,0,.5) 310deg,

    transparent 360deg

  );

  animation: ahp-ring-rotate 1.8s linear infinite paused;

}

.ahp-grid-item:hover .ahp-ring-spin { animation-play-state: running; }

.ahp-ring-wrap::after {

  content: '';

  position: absolute;

  inset: 2px;

  background: var(--ahp-white);

  border-radius: var(--ahp-radius);

}

@keyframes ahp-ring-rotate { to { transform: rotate(360deg); } }



/* ── Kaardi sisu (card-inner) ───────────────────────── */

.ahp-card-inner {

  position: relative;

  z-index: 3;

  display: flex;

  flex-direction: column;

  height: 100%;

  background: var(--ahp-white);

  border: 1px solid var(--ahp-border);

  border-radius: var(--ahp-radius);

  overflow: hidden;

  text-decoration: none;

  color: inherit;

  box-shadow: 0 2px 8px rgba(0,0,0,.04);

  transition: box-shadow .5s ease, transform .22s ease;

}

.ahp-grid-item:hover .ahp-card-inner {

  transform: translateY(-3px);

  box-shadow: 0 10px 28px rgba(0,0,0,.1);

}



/* Reisiv glow */

.ahp-grid-item.ahp-glow .ahp-card-inner {

  box-shadow: 0 0 0 1px rgba(140,140,140,.28), 0 6px 20px rgba(0,0,0,.08);

}



/* ── Pilt ───────────────────────────────────────────── */

.ahp-img-wrap {

  width: 100%;

  aspect-ratio: 16/9;

  overflow: hidden;

  background: var(--ahp-light);

  flex-shrink: 0;

}

.ahp-featured .ahp-img-wrap { aspect-ratio: 20/9; }

.ahp-img-wrap img {

  width: 100%;

  height: 100%;

  object-fit: cover;

  display: block;

  transition: transform .4s ease;

}

.ahp-grid-item:hover .ahp-img-wrap img { transform: scale(1.04); }

.ahp-img-placeholder {

  background: repeating-linear-gradient(

    45deg,

    var(--ahp-light) 0, var(--ahp-light) 8px,

    #e8e6e1 8px, #e8e6e1 16px

  );

}



/* ── Tekst ──────────────────────────────────────────── */

.ahp-item-body {

  padding: 11px 13px 10px;

  display: flex;

  flex-direction: column;

  flex: 1;

}

.ahp-item-num {

  font-size: 9px;

  font-weight: 800;

  letter-spacing: 1.5px;

  color: var(--ahp-amber);

  margin-bottom: 3px;

}

.ahp-item-title {

  font-size: 13px;

  font-weight: 800;

  color: var(--ahp-dark);

  margin: 0 0 2px;

  line-height: 1.25;

}

.ahp-featured .ahp-item-title { font-size: 16px; }

.ahp-item-desc {

  font-size: 12px;

  color: #6b7479;

  margin: 4px 0 0;

  line-height: 1.45;

}



/* ══════════════════════════════════════════════════════

   CTA — ikoon alati nähtav, tekst laieneb hover-il

══════════════════════════════════════════════════════ */

.ahp-cta {

  display: flex;

  align-items: center;

  justify-content: flex-end;

  gap: 0;

  padding: 0 10px 10px;

  margin-top: auto;

}



/* Kollane nupp-kontainer */

.ahp-cta-icon {

  display: flex;

  align-items: center;

  justify-content: center;

  width: 28px;

  height: 28px;

  background: var(--ahp-amber);

  color: var(--ahp-dark);

  font-size: 14px;

  font-weight: 700;

  border-radius: 4px;

  flex-shrink: 0;

  transition: border-radius .25s ease;

}



/* Tekst — alguses peidetud, laieneb paremalt vasakule */

.ahp-cta-label {

  display: inline-block;

  max-width: 0;

  overflow: hidden;

  white-space: nowrap;

  font-size: 11px;

  font-weight: 800;

  color: var(--ahp-dark);

  text-transform: uppercase;

  letter-spacing: .5px;

  background: var(--ahp-amber);

  height: 28px;

  line-height: 28px;

  padding: 0;

  border-radius: 4px 0 0 4px;

  transition:

    max-width .3s cubic-bezier(.4,0,.2,1),

    padding .3s cubic-bezier(.4,0,.2,1),

    opacity .2s ease;

  opacity: 0;

}



.ahp-grid-item:hover .ahp-cta-label,

.ahp-slide:hover .ahp-cta-label,

.ahp-card:hover .ahp-cta-label {

  max-width: 130px;

  padding: 0 10px;

  opacity: 1;

}

.ahp-grid-item:hover .ahp-cta-icon,

.ahp-slide:hover .ahp-cta-icon,

.ahp-card:hover .ahp-cta-icon {

  border-radius: 0 4px 4px 0;

}



/* Esiletõstetud: suurem CTA */

.ahp-featured .ahp-cta-icon {

  width: 32px;

  height: 32px;

  font-size: 16px;

}

.ahp-featured .ahp-cta-label {

  height: 32px;

  line-height: 32px;

  font-size: 12px;

}



/* ══════════════════════════════════════════════════════

   2. HORIZONTAL CARDS

══════════════════════════════════════════════════════ */

.ahp-cards {

  display: grid;

  gap: var(--ahp-gap);

}

.ahp-cards.ahp-cols-2 { grid-template-columns: repeat(2, 1fr); }

.ahp-cards.ahp-cols-3 { grid-template-columns: repeat(3, 1fr); }

.ahp-cards.ahp-cols-4 { grid-template-columns: repeat(4, 1fr); }



.ahp-card {

  display: flex;

  flex-direction: column;

  background: var(--ahp-white);

  border-radius: var(--ahp-radius);

  overflow: hidden;

  text-decoration: none;

  color: inherit;

  border: 1px solid var(--ahp-border);

  transition: transform var(--ahp-trans), box-shadow var(--ahp-trans);

}

.ahp-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(60,70,75,.13); }

.ahp-card-img { width: 100%; aspect-ratio: 4/3; overflow: hidden; background: var(--ahp-light); flex-shrink: 0; }

.ahp-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }

.ahp-card:hover .ahp-card-img img { transform: scale(1.06); }

.ahp-card-img-ph { width: 100%; height: 100%; background: linear-gradient(135deg, var(--ahp-light), #dedad3); }

.ahp-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; border-top: 3px solid var(--ahp-amber); }

.ahp-card-title { font-size: 14px; font-weight: 800; color: var(--ahp-dark); margin: 0 0 6px; line-height: 1.3; }

.ahp-card-desc { font-size: 12px; color: #6b7479; line-height: 1.5; margin: 0 0 12px; flex: 1; }



/* ══════════════════════════════════════════════════════

   3. CAROUSEL

══════════════════════════════════════════════════════ */

.ahp-carousel-wrap { position: relative; overflow: hidden; border-radius: var(--ahp-radius); user-select: none; touch-action: pan-y; }

.ahp-carousel-track { display: flex; transition: transform .45s cubic-bezier(.4,0,.2,1); will-change: transform; }

.ahp-slide { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 7px; box-sizing: border-box; text-decoration: none; color: inherit; display: flex; flex-direction: column; }

@media (max-width: 900px) { .ahp-slide { flex: 0 0 50%; max-width: 50%; } }

@media (max-width: 600px) { .ahp-slide { flex: 0 0 100%; max-width: 100%; } }

.ahp-slide-img { width: 100%; aspect-ratio: 4/3; overflow: hidden; border-radius: var(--ahp-radius); background: var(--ahp-light); }

.ahp-slide-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }

.ahp-slide:hover .ahp-slide-img img { transform: scale(1.04); }

.ahp-slide-ph { background: linear-gradient(135deg, #dedad3, var(--ahp-light)); }

.ahp-slide-body { padding: 12px 4px 16px; }

.ahp-slide-title { font-size: 14px; font-weight: 800; color: var(--ahp-dark); margin: 0 0 4px; line-height: 1.3; }

.ahp-slide-desc { font-size: 12px; color: #6b7479; margin: 0; line-height: 1.5; }

.ahp-car-btn { position: absolute; top: calc(50% - 28px); transform: translateY(-50%); width: 40px; height: 40px; background: var(--ahp-dark); color: var(--ahp-amber); border: none; border-radius: 4px; font-size: 24px; cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center; transition: background var(--ahp-trans); padding: 0 0 2px; }

.ahp-car-btn:hover { background: var(--ahp-amber); color: var(--ahp-dark); }

.ahp-car-prev { left: 8px; }

.ahp-car-next { right: 8px; }

.ahp-car-dots { display: flex; justify-content: center; gap: 6px; padding: 14px 0 4px; }

.ahp-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--ahp-border); border: none; cursor: pointer; padding: 0; transition: background var(--ahp-trans), width var(--ahp-trans); }

.ahp-dot.active { background: var(--ahp-amber); width: 22px; }



/* ── RESPONSIVE ─────────────────────────────────────── */

@media (max-width: 900px) {

  .ahp-grid.ahp-cols-3,

  .ahp-grid.ahp-cols-4 { grid-template-columns: repeat(2, 1fr); }

  .ahp-cards.ahp-cols-3,

  .ahp-cards.ahp-cols-4 { grid-template-columns: repeat(2, 1fr); }

  .ahp-grid-featured.ahp-featured-3,

  .ahp-grid-featured.ahp-featured-4 { grid-template-columns: repeat(2, 1fr); }

}

@media (max-width: 600px) {

  .ahp-grid,

  .ahp-grid-featured,

  .ahp-cards { grid-template-columns: 1fr !important; }

  .ahp-item-title { font-size: 13px; }

  .ahp-featured .ahp-item-title { font-size: 15px; }

  /* Mobiilil näita CTA tekst alati */

  .ahp-cta-label {

    max-width: 130px;

    padding: 0 10px;

    opacity: 1;

  }

  .ahp-cta-icon { border-radius: 0 4px 4px 0; }

}


/* ── Vaata kõiki tooteid nupp ────────────────────────────── */
.ahp-all-btn-wrap {
  display: flex;
  justify-content: center;
  padding: 20px 0 4px;
}
.ahp-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  background: var(--ahp-amber, #F4B800);
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid var(--ahp-amber, #F4B800);
  border-radius: 6px;
  text-decoration: none;
  letter-spacing: .2px;
  transition: background .15s, color .15s, transform .15s;
}
.ahp-all-btn:hover {
  background: transparent;
  color: var(--ahp-amber, #F4B800);
  transform: translateY(-1px);
}
