/* ═══════════════════════════════════════════
   AgTopBarBtn v2.0.1 — front.css
   Agroland | Custom TopBar Module
═══════════════════════════════════════════ */

#aglbar {
  position: -webkit-sticky; /* Safari iOS < 13 */
  position: var(--aglbar-position, sticky);
  top: 0;
  z-index: var(--aglbar-z, 9999);
  background: var(--aglbar-bg, #ffd200);
  color: var(--aglbar-text, #1a1a1a);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 2px 12px rgba(0,0,0,.10);
  animation: aglbar-in 0.5s cubic-bezier(.16,1,.3,1) both;
  overflow: hidden;
}

/* Subtle diagonal texture overlay — pointer-events none ca sa nu blocheze click-uri */
#aglbar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -55deg,
    transparent,
    transparent 12px,
    rgba(0,0,0,.025) 12px,
    rgba(0,0,0,.025) 13px
  );
  pointer-events: none;
  z-index: 0;
}

/* Slide-in de sus */
@keyframes aglbar-in {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* Slide-in de jos (pozitie bottom) */
#aglbar[data-position="bottom"] {
  animation-name: aglbar-in-bottom;
  top: auto;
  bottom: 0;
}
@keyframes aglbar-in-bottom {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Inner layout ── */
#aglbar .aglbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 48px 10px 16px; /* padding-right mai mare pt butonul X */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 48px;
  position: relative;
  z-index: 1;
}

/* ── Mesaj (wrapper per rotatie) ── */
#aglbar .aglbar-message {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Text ── */
#aglbar .aglbar-text {
  display: inline-block;
  letter-spacing: -0.01em;
}

/* ── Dot animat (atrage atentia) ── */
#aglbar .aglbar-dot {
  width: 8px;
  height: 8px;
  background: currentColor;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.5;
  animation: aglbar-pulse 2s ease infinite;
}
@keyframes aglbar-pulse {
  0%, 100% { transform: scale(1);   opacity: 0.5; }
  50%       { transform: scale(1.4); opacity: 1;   }
}

/* ── Countdown ── */
#aglbar .aglbar-countdown {
  display: inline-flex;
  align-items: center;
  background: rgba(0,0,0,.12);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

/* ── Buton CTA ── */
#aglbar .aglbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--aglbtn-bg, #1a1a1a);
  color: var(--aglbtn-text, #ffd200) !important;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
  padding: 8px 16px;
  border-radius: 100px;
  text-decoration: none !important;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: transform .15s ease, box-shadow .15s ease;
  position: relative;
}
#aglbar .aglbar-btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
  text-decoration: none !important;
}
#aglbar .aglbar-btn:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

/* ── Buton inchidere ── */
#aglbar .aglbar-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.08);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: inherit;
  font-size: 17px;
  line-height: 1;
  transition: background .15s ease, transform .15s ease;
  flex-shrink: 0;
  z-index: 2;
}
#aglbar .aglbar-close:hover {
  background: rgba(0,0,0,.18);
  transform: translateY(-50%) scale(1.12);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  #aglbar { font-size: 13px; }
  #aglbar .aglbar-inner { padding: 8px 40px 8px 12px; gap: 8px; min-height: 44px; }
  #aglbar .aglbar-btn { font-size: 12px; padding: 7px 13px; }
  #aglbar .aglbar-close { right: 8px; width: 24px; height: 24px; font-size: 15px; }
}

/* ── Etichete unitate countdown (z h m s) ── */
#aglbar .aglbar-countdown .aglbar-cd-unit {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.65;
  margin-left: 1px;
  margin-right: 4px;
  text-transform: lowercase;
  letter-spacing: 0;
}
#aglbar .aglbar-countdown .aglbar-cd-unit:last-child {
  margin-right: 0;
}

/* ════════════════════════════════════════
   ATENTIE LA INACTIVITATE — bara pulseaza
════════════════════════════════════════ */
@keyframes aglbar-attention {
  0%   { transform: scaleY(1);    box-shadow: 0 2px 12px rgba(0,0,0,.10); }
  15%  { transform: scaleY(1.08); box-shadow: 0 4px 20px rgba(0,0,0,.22); }
  30%  { transform: scaleY(1);    box-shadow: 0 2px 12px rgba(0,0,0,.10); }
  45%  { transform: scaleY(1.06); box-shadow: 0 4px 18px rgba(0,0,0,.20); }
  60%  { transform: scaleY(1);    box-shadow: 0 2px 12px rgba(0,0,0,.10); }
  100% { transform: scaleY(1);    box-shadow: 0 2px 12px rgba(0,0,0,.10); }
}
#aglbar.aglbar-attention {
  animation: aglbar-attention 1.2s ease 0s 3;
  transform-origin: top center;
}
#aglbar[data-position="bottom"].aglbar-attention {
  transform-origin: bottom center;
}

/* ════════════════════════════════════════
   SOCIAL COUNTER
════════════════════════════════════════ */
#aglbar .aglbar-counter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0,0,0,.10);
  border-radius: 100px;
  padding: 3px 10px 3px 7px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
#aglbar .aglbar-counter-dot {
  width: 7px;
  height: 7px;
  background: #ff4444;
  border-radius: 50%;
  animation: aglbar-live 1.4s ease infinite;
  flex-shrink: 0;
}
@keyframes aglbar-live {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

/* ── Counter number — mosteneste stilul parintelui, dar explicit pt siguranta ── */
#aglbar .aglbar-counter-num {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}
