/* =========================================================== */
/* 00. Widget - Elementor Button
/* =========================================================== */
.dplf-button-wrapper {
  position: relative;
}

.dplf-button {
  position: relative;
  overflow: hidden;
}

.dplf-button-text {
  flex-grow: 1;
  display: inline-block;
}

.dplf-button-icon {
  flex-grow: 0;
  flex-shrink: 0;
  display: inline-flex;
  vertical-align: middle;
  transition: all 0.3s ease;
}

.dplf-button-icon svg {
  width: 1.5em;
  height: 1.5em;
  display: inline-block;
}

.dplf-button-text {
  flex-grow: 1;
  display: inline-block;
}

/* Button Size Styles */
.dplf-button.dplf-button-size--xs {
  font-size: 12px;
  padding: 10px 18px;
}

.dplf-button.dplf-button-size--md {
  padding: 16px 32px;
}

.dplf-button.dplf-button-size--lg {
  font-size: 18px;
  padding: 20px 42px;
}

.dplf-button.dplf-button-size--xl {
  font-size: 20px;
  padding: 25px 52px;
}

/* SVG Icon Positioning */
.dplf-button-icon-before {
  margin-right: 0.5em;
  margin-left: 0;
  order: 1;
}

.dplf-button-icon-after {
  margin-left: 0.5em;
  margin-right: 0;
  order: 3;
}

/* Ensure text is properly ordered */
.dplf-button-text {
  order: 2;
}

/* Button Alignment Styles */
.elementor-align-center .dplf-button {
  width: auto;
}

.elementor-align-right {
  text-align: right;
}

.elementor-align-right .dplf-button {
  width: auto;
}

.elementor-align-left {
  text-align: left;
}

.elementor-align-left .dplf-button {
  width: auto;
}

.elementor-align-justify .dplf-button {
  width: 100%; /* Full-width only when justified */
}

.elementor-align-justify.elementor-text-align-left .dplf-button {
  text-align: left;
}

.elementor-align-justify.elementor-text-align-center .dplf-button {
  text-align: center;
}

.elementor-align-justify.elementor-text-align-right .dplf-button {
  text-align: right;
}

/* Tablet Responsive Styles */
@media (max-width: 1024px) {
  .elementor-tablet-align-center .dplf-button {
    width: auto;
  }

  .elementor-tablet-align-right {
    text-align: right;
  }

  .elementor-tablet-align-right .dplf-button {
    width: auto;
  }

  .elementor-tablet-align-left {
    text-align: left;
  }

  .elementor-tablet-align-left .dplf-button {
    width: auto;
  }

  .elementor-tablet-align-justify .dplf-button {
    width: 100%; /* Full-width only when justified on tablet */
  }
}

/* Mobile Responsive Styles */
@media (max-width: 767px) {
  .elementor-mobile-align-center {
    text-align: center;
  }

  .elementor-mobile-align-center .dplf-button {
    width: auto;
  }

  .elementor-mobile-align-right {
    text-align: right;
  }

  .elementor-mobile-align-right .dplf-button {
    width: auto;
  }

  .elementor-mobile-align-left {
    text-align: left;
  }

  .elementor-mobile-align-left .dplf-button {
    width: auto;
  }

  .elementor-mobile-align-justify .dplf-button {
    width: 100%; /* Full-width only when justified on mobile */
  }
  
  /* Adjust icon spacing on mobile if needed */
  .dplf-button-icon-before {
    margin-right: 0.3em;
  }
  
  .dplf-button-icon-after {
    margin-left: 0.3em;
  }
}

/* Icon Rotation Animations */
.dplf-icon-hover-rotate-45 .dplf-button:hover .dplf-button-icon {
  transform: rotate(45deg);
}

.dplf-icon-hover-rotate-90 .dplf-button:hover .dplf-button-icon {
  transform: rotate(90deg);
}

.dplf-icon-hover-rotate-180 .dplf-button:hover .dplf-button-icon {
  transform: rotate(180deg);
}

.dplf-icon-hover-rotate-360 .dplf-button:hover .dplf-button-icon {
  transform: rotate(360deg);
}

/* Icon Flip Animations */
.dplf-icon-hover-flip-x .dplf-button:hover .dplf-button-icon {
  transform: scaleX(-1);
}

.dplf-icon-hover-flip-y .dplf-button:hover .dplf-button-icon {
  transform: scaleY(-1);
}

/* Icon Bounce Animation */
@keyframes dplf-icon-bounce {
  0%, 100% { 
    transform: translateY(0); 
  }
  50% { 
    transform: translateY(-10px); 
  }
}

.dplf-icon-hover-bounce .dplf-button:hover .dplf-button-icon {
  animation: dplf-icon-bounce 0.5s ease infinite;
}

/* Icon Pulse Animation */
@keyframes dplf-icon-pulse {
  0% { 
    transform: scale(1); 
  }
  50% { 
    transform: scale(1.2); 
  }
  100% { 
    transform: scale(1); 
  }
}

.dplf-icon-hover-pulse .dplf-button:hover .dplf-button-icon {
  animation: dplf-icon-pulse 1s ease infinite;
}

/* Icon Shake Animation */
@keyframes dplf-icon-shake {
  0%, 100% { 
    transform: translateX(0); 
  }
  10%, 30%, 50%, 70%, 90% { 
    transform: translateX(-5px); 
  }
  20%, 40%, 60%, 80% { 
    transform: translateX(5px); 
  }
}

.dplf-icon-hover-shake .dplf-button:hover .dplf-button-icon {
  animation: dplf-icon-shake 0.8s ease infinite;
}

/* Icon Tada Animation */
@keyframes dplf-icon-tada {
  0% { 
    transform: scale(1); 
  }
  10%, 20% { 
    transform: scale(0.9) rotate(-3deg); 
  }
  30%, 50%, 70%, 90% { 
    transform: scale(1.1) rotate(3deg); 
  }
  40%, 60%, 80% { 
    transform: scale(1.1) rotate(-3deg); 
  }
  100% { 
    transform: scale(1) rotate(0); 
  }
}

.dplf-icon-hover-tada .dplf-button:hover .dplf-button-icon {
  animation: dplf-icon-tada 1s ease infinite;
}

/* Icon Wobble Animation */
@keyframes dplf-icon-wobble {
  0%, 100% { 
    transform: translateX(0%); 
  }
  15% { 
    transform: translateX(-25%) rotate(-5deg); 
  }
  30% { 
    transform: translateX(20%) rotate(3deg); 
  }
  45% { 
    transform: translateX(-15%) rotate(-3deg); 
  }
  60% { 
    transform: translateX(10%) rotate(2deg); 
  }
  75% { 
    transform: translateX(-5%) rotate(-1deg); 
  }
}

.dplf-icon-hover-wobble .dplf-button:hover .dplf-button-icon {
  animation: dplf-icon-wobble 1s ease infinite;
}

/* Icon Swing Animation */
@keyframes dplf-icon-swing {
  20% { 
    transform: rotate(15deg); 
  }
  40% { 
    transform: rotate(-10deg); 
  }
  60% { 
    transform: rotate(5deg); 
  }
  80% { 
    transform: rotate(-5deg); 
  }
  100% { 
    transform: rotate(0deg); 
  }
}

.dplf-icon-hover-swing .dplf-button:hover .dplf-button-icon {
  transform-origin: top center;
  animation: dplf-icon-swing 1s ease infinite;
}

/* Fade In Animation */
@keyframes dplf-animation-fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Additional Icon Size Control */
.dplf-button.dplf-button-size--xs .dplf-button-icon svg {
  width: 0.9em;
  height: 0.9em;
}

.dplf-button.dplf-button-size--lg .dplf-button-icon svg {
  width: 1.1em;
  height: 1.1em;
}

.dplf-button.dplf-button-size--xl .dplf-button-icon svg {
  width: 1.2em;
  height: 1.2em;
}

/* Icon Color Inheritance */
.dplf-button-icon svg {
  fill: currentColor;
}

.dplf-button-content-wrapper {
  align-items: center;
}

.dplf-button-icon {
  align-self: center;
}