/* --- Generic Button Styles --- */

.button-wrapper {
  /* Button specific variables - These will be overridden by Elementor controls */
  --button-primary-color: #D90429;
  --button-accent-color: #27272A;
  --button-font-color: #fff;

  --bg-hover: var(--button-accent-color);
  display: inline-block; /* Allows button to sit naturally */
}

.button-wrapper .stylish-button {
  border-radius: 8px;
  color: var(--button-font-color);
  display: inline-flex;
  position: relative;
  background-color: var(--button-primary-color);
  transition: all 0.3s ease;
  overflow: hidden;
  clip-path: polygon(0 15px, 15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%);
  padding: 24px 54px;
  text-decoration: none;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
}

/* Background hover effect */
.button-wrapper .stylish-button:before {
  position: absolute;
  height: calc(100% + 130px);
  width: 100%;
  top: 50%;
  left: 50%;
  content: "";
  background: linear-gradient(to top left, var(--bg-hover) 50%, #0000 50.1%) bottom right, linear-gradient(to bottom right, var(--bg-hover) 50%, #0000 50.1%) top left;
  background-size: 0 0;
  background-repeat: no-repeat;
  transition: all 0.3s ease;
  z-index: 0; 
  transform: translate(-50%, -50%);
}

.button-wrapper .stylish-button:hover:before {
  background-size: 100% 100%;
}

/* Text flip hover effect */
.button-wrapper .stylish-button .hover-text {
  position: relative;
  z-index: 1; 
  overflow: hidden;
  display: inline-block;
}

.button-wrapper .stylish-button .hover-text span {
  display: block;
  transition: all ease 0.4s;
  transform-style: preserve-3d;
}

.button-wrapper .stylish-button .hover-text:before {
  content: attr(data-name);
  display: block;
  height: 100%;
  position: absolute;
  top: 100%;
  transition: all ease 0.4s;
  transform-style: preserve-3d;
}

.button-wrapper .stylish-button:hover .hover-text span,
.button-wrapper .stylish-button:hover .hover-text:before {
  transform: translateY(-100%);
}

/* --- Outline Button Variation --- */

.button-wrapper.button-outline .stylish-button {
  background-color: transparent;
  box-shadow: 0 0 0 2px var(--button-primary-color) inset;
}

.button-wrapper.button-outline .stylish-button .hover-text:before {
  color: #fff; /* Default hover text color, can be overridden */
}

.button-wrapper.button-outline .stylish-button .hover-text span {
  color: var(--button-primary-color); /* Default text color, can be overridden */
}

/* --- Link Button Variation --- */

.button-wrapper.button-link .stylish-button {
  clip-path: none !important;
  padding: 0;
  border-radius: 0;
  background-color: transparent;
  overflow: hidden;
}

.button-wrapper.button-link .stylish-button:before {
  display: none;
}

.button-wrapper.button-link .stylish-button:after {
  content: "";
  position: absolute;
  top: auto;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background-color: var(--button-primary-color);
  transition: all ease 0.3s;
}

.button-wrapper.button-link .stylish-button .hover-text span {
  color: var(--button-primary-color);
}

.button-wrapper.button-link .stylish-button .hover-text:before {
  color: var(--button-accent-color);
}

.button-wrapper.button-link .stylish-button:hover:after {
  background-color: var(--button-accent-color);
}
