#cod-banner-container {
  position: fixed;
  top: 35px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: block;
}

#minimal-cod-banner {
  position: relative;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4), 0 1px 3px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  width: 180px;
  user-select: none;
  transform: scale(0.9);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#cod-close-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: white;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  transform: scale(0.8) rotate(-90deg);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(10px);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
  padding: 0;
  box-sizing: border-box;
}

#icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  opacity: 0;
  transform: translateX(-20px) scale(0.5);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#banner-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

#truck-icon {
  font-size: 24px;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

#text-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  line-height: 1.2;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 0;
}

#main-text {
  font-weight: 700;
  font-size: 11px;
  margin-bottom: 1px;
  transform: translateY(-5px);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

#cod-highlight {
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 800;
  text-shadow: none;
  box-shadow: 0 2px 8px rgba(255, 255, 0, 0.4);
  transform: scale(0.9);
  display: inline-block;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 10px;
}

#sub-text {
  font-weight: 500;
  font-size: 10px;
  opacity: 0;
  transform: translateY(5px);
  transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

@keyframes bannerSlideIn {
  0% {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-50px) scale(0.8);
    filter: blur(10px);
  }
  50% {
    opacity: 0.7;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px) scale(0.95);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes bannerSlideOut {
  0% {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
    filter: blur(0);
  }
  50% {
    opacity: 0.5;
    transform: translateX(-50%) translateY(-15px) scale(0.95);
    filter: blur(2px);
  }
  100% {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-50px) scale(0.8);
    filter: blur(10px);
  }
}

.banner-entering #cod-banner-container {
  animation: bannerSlideIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.banner-exiting #cod-banner-container {
  animation: bannerSlideOut 0.8s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

@keyframes iconMove {
  0%,
  100% {
    transform: translateX(0) scale(1);
  }
  25% {
    transform: translateX(2px) scale(1.08) rotate(2deg);
  }
  75% {
    transform: translateX(-1px) scale(1.05) rotate(-1deg);
  }
}

@keyframes codGlow {
  0%,
  100% {
    background: linear-gradient(
      45deg,
      rgba(255, 255, 0, 0.95),
      rgba(255, 215, 0, 0.9)
    );
    box-shadow: 0 2px 8px rgba(255, 255, 0, 0.4);
    transform: scale(1);
  }
  50% {
    background: linear-gradient(
      45deg,
      rgba(255, 255, 0, 1),
      rgba(255, 215, 0, 1)
    );
    box-shadow: 0 4px 16px rgba(255, 255, 0, 0.6);
    transform: scale(1.08);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.banner-active #minimal-cod-banner {
  transform: scale(1) !important;
}

.banner-active #cod-close-btn {
  opacity: 1 !important;
  transform: scale(1) rotate(0deg) !important;
}

.banner-active #icon-container {
  opacity: 1 !important;
  transform: translateX(0) scale(1) !important;
}

.banner-active #text-content {
  opacity: 1 !important;
  transform: translateX(0) !important;
}

.banner-active #main-text {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.banner-active #sub-text {
  opacity: 0.95 !important;
  transform: translateY(0) !important;
}

.banner-active #cod-highlight {
  transform: scale(1) !important;
  animation: codGlow 3s ease-in-out infinite;
}

#minimal-cod-banner:hover {
  transform: translateY(-4px) scale(1.03) !important;
  box-shadow: 0 8px 30px rgba(255, 107, 53, 0.6),
    0 4px 20px rgba(247, 147, 30, 0.3) !important;
  animation: float 2s ease-in-out infinite;
}

#minimal-cod-banner:hover #banner-icon,
#minimal-cod-banner:hover #truck-icon {
  animation: iconMove 1.2s ease-in-out infinite;
}

#minimal-cod-banner:hover #banner-icon {
  width: 30px;
  height: 30px;
}

#minimal-cod-banner:hover #truck-icon {
  font-size: 26px;
}

#minimal-cod-banner:hover #icon-container {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.12);
  border-color: rgba(255, 255, 255, 0.2);
}

#minimal-cod-banner:hover #cod-highlight {
  animation: codGlow 1.5s ease-in-out infinite !important;
  transform: scale(1.1) !important;
}

#cod-close-btn:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  transform: scale(1.2) rotate(90deg) !important;
  border-color: rgba(255, 255, 255, 1) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
}

#cod-close-btn:active {
  transform: scale(0.9) rotate(90deg) !important;
}

@media (max-width: 480px) {
  #cod-banner-container {
    top: 40px !important;
    /* left property is now dynamic via PHP */
    right: auto !important;
    transform: translateY(-30px) !important;
  }
  #minimal-cod-banner {
    width: 130px !important;
    font-size: 10px !important;
    padding: 6px 8px !important;
    gap: 6px !important;
    border-radius: 8px !important;
  }
  #icon-container {
    width: 30px !important;
    height: 30px !important;
    border-radius: 6px !important;
  }
  #banner-icon {
    width: 22px !important;
    height: 22px !important;
  }
  #truck-icon {
    font-size: 18px !important;
  }
  #main-text {
    font-size: 9px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    margin-bottom: 1px !important;
    font-weight: 700 !important;
  }
  #sub-text {
    font-size: 8px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    font-weight: 500 !important;
  }
  #cod-highlight {
    padding: 1px 3px !important;
    font-size: 8px !important;
    border-radius: 2px !important;
    font-weight: 800 !important;
  }
  #cod-close-btn {
    width: 20px !important;
    height: 20px !important;
    font-size: 12px !important;
    top: -8px !important;
    right: -8px !important;
  }
}

@media (max-width: 360px) {
  #cod-banner-container {
    top: 45px !important;
    /* left property is now dynamic via PHP */
  }
  #minimal-cod-banner {
    width: 115px !important;
    padding: 5px 7px !important;
    gap: 5px !important;
    border-radius: 6px !important;
  }
  #icon-container {
    width: 26px !important;
    height: 26px !important;
    border-radius: 5px !important;
  }
  #banner-icon {
    width: 18px !important;
    height: 18px !important;
  }
  #truck-icon {
    font-size: 16px !important;
  }
  #main-text {
    font-size: 8px !important;
    font-weight: 700 !important;
  }
  #sub-text {
    font-size: 7px !important;
    font-weight: 500 !important;
  }
  #cod-highlight {
    font-size: 7px !important;
    padding: 0px 2px !important;
    border-radius: 2px !important;
  }
  #cod-close-btn {
    width: 18px !important;
    height: 18px !important;
    font-size: 11px !important;
    top: -7px !important;
    right: -7px !important;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  #cod-banner-container {
    top: 40px !important;
    /* left property is now dynamic via PHP */
    right: auto !important;
    transform: translateY(-30px) !important;
  }
  #minimal-cod-banner {
    width: 160px !important;
    font-size: 11px !important;
    padding: 7px 10px !important;
    gap: 7px !important;
  }
  #icon-container {
    width: 34px !important;
    height: 34px !important;
  }
  #banner-icon {
    width: 26px !important;
    height: 26px !important;
  }
  #truck-icon {
    font-size: 22px !important;
  }
  #main-text {
    font-size: 10px !important;
    line-height: 1.2 !important;
  }
  #sub-text {
    font-size: 9px !important;
    line-height: 1.2 !important;
  }
  #cod-highlight {
    font-size: 9px !important;
    padding: 1px 3px !important;
  }
}

@media (min-width: 769px) {
  #cod-banner-container {
    top: 35px !important;
    left: 50% !important;
    right: auto !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .banner-active #cod-close-btn,
  .banner-active #icon-container,
  .banner-active #text-content,
  .banner-active #main-text,
  .banner-active #sub-text {
    opacity: 1 !important;
    transform: none !important;
  }
}
