/* Modal Positioning */
.modal {
  position: fixed;
  bottom: 30px;
  right: 30px;
  left: auto;
  top: auto;
  margin: 0;
  width: 350px; /* Reduced width */
  height: 550px; /* Fixed height */
  z-index: 1050;
  display: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Remove modal backdrop */
.modal-backdrop.show {
  display: none !important;
  opacity: 0 !important;
}

.modal.show {
  display: block;
  animation: slide-up 0.3s ease-out;
}

@keyframes slide-up {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-dialog {
  margin: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  transform: none !important;
}

.modal-content {
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: 16px;
}

/* Ensure the close button is clickable */
.close-button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  z-index: 1060;
  position: relative;
}

/* Make sure the modal content is above the button */
.modal-content {
  position: relative;
  z-index: 1061;
}

/* Floating Quote Button Styles */
.floating-quote-btn {
  position: fixed;
  bottom: 120px;
  right: 30px;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Ensure button is above the modal */
  z-index: 1060;
  /* Animation properties */
  animation: floatPulse 3s ease-in-out infinite;
}

/* Hover effect moved to end of file for better organization */

.floating-quote-btn img,
.floating-quote-btn .flip-card img {
  width: 150px; /* Reduced width 300px > 220px > image change */
  height: auto;
  transition: transform 0.3s ease;
}

/* Mobile responsive positioning */
@media (max-width: 768px) {
  .floating-quote-btn {
    right: 15px;
    bottom: 120px;
  }

  .floating-quote-btn img,
  .floating-quote-btn .flip-card img {
    width: 200px;
  }

  /* Mobile footer fixes */
  .copy_right_footer ul {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .copy_right_footer ul li {
    margin: 5px 0;
  }

  /* Mobile social icons */
  .footer_social_icons ul {
    justify-content: center;
    gap: 15px;
  }

  .footer_social_icons ul li {
    margin: 0 5px;
  }

  .footer_social_icons ul li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #f8f9fa;
    border-radius: 50%;
    color: #333;
  }

  .footer_social_icons ul li a i {
    font-size: 18px;
  }
}

/* Chat Modal Styles */
.chat-modal .modal-content {
  border-radius: 12px;
  border: none;
  overflow: hidden;
  max-width: 400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-height: 100%;
}

/* Header Styles */
.chat-header {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.trado-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-image, 
.elementor img.logo-image{
  height: 24px;
  width: auto;
}

.live-text {
  background-color: #10b981;
  color: white;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.close-button {
  background: none;
  border: none;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-icon {
  width: 20px;
  height: 20px;
}

/* Messages Container */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100% - 140px); /* Adjust based on header and input height */
  min-height: 300px;
}

.message-wrapper {
  display: flex;
  gap: 12px;
  max-width: 80%;
  margin-bottom: 12px;
}

.message-wrapper.system-message {
  align-self: flex-start;
}

.message-wrapper.user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-wrapper.user-message .message {
  background-color: #3b82f6;
  color: white;
  margin-left: 0;
  margin-right: 8px;
}

.message-wrapper.system-message .message {
  background-color: #f3f4f6;
  color: #374151;
  margin-right: 0;
  margin-left: 8px;
}

.avatar-container {
  flex-shrink: 0;
}

.avatar {
  display: flex;
  height: 2rem;
  width: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background-color: #f97316;
}

.avatar.user-avatar {
  background-color: #3b82f6;
  color: white;
}

.avatar.user-avatar svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  color: transparent;
}

.message {
  background-color: #f3f4f6;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
}

/* Input Area */
.input-container {
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
}

.input-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-input-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.message-input {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: 12px 50px 12px 16px;
  font-size: 14px;
  resize: none;
  min-height: 48px;
  max-height: 120px;
  outline: none;
}

.send-button {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #3b82f6;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  padding: 0;
}

.send-button:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

.send-button:hover:not(:disabled) {
  background-color: #2563eb;
}

.send-icon {
  width: 16px;
  height: 16px;
}

.char-counter {
  font-size: 12px;
  color: #6b7280;
  padding-left: 8px;
  margin-top: 4px;
}

.send-icon {
  width: 20px;
  height: 20px;
}

/* Message Counter Styles */
.message-counter {
  text-align: center;
  margin-bottom: 8px;
  padding: 4px;
  font-size: 13px;
  color: #6b7280;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.message-counter .counter-text {
  display: inline-block;
}

.message-counter.limit-reached {
  background-color: #fee2e2;
  color: #b91c1c;
  padding: 6px 12px;
  font-weight: 500;
}

/* System notification for message limits */
.system-notification .message.notification {
  background-color: #fef3c7;
  color: #92400e;
  font-weight: 500;
  text-align: center;
  margin: 0 auto;
  max-width: 90%;
  transition: opacity 0.5s ease;
}

/* Error notification styling */
.system-notification .message.notification.error {
  background-color: #fee2e2;
  color: #b91c1c;
  border-left: 4px solid #ef4444;
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Phone request message styling */
.message.phone-request {
  background-color: #fef3c7;
  color: #92400e;
  border-left: 4px solid #f59e0b;
  font-weight: 500;
  animation: gentle-pulse 2s ease-in-out infinite;
}

@keyframes gentle-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 2px 5px rgba(245, 158, 11, 0.1);
  }
  50% {
    transform: scale(1.01);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2);
  }
}

/* Loading spinner */
.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }
  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }
  30%,
  50%,
  70% {
    transform: translate3d(-3px, 0, 0);
  }
  40%,
  60% {
    transform: translate3d(3px, 0, 0);
  }
}

/* Keyframe Animations for Get a Quote Button */
@keyframes floatPulse {
  0%,
  100% {
    transform: translateY(0px) scale(1);
  }
  25% {
    transform: translateY(-5px) scale(1.02);
  }
  50% {
    transform: translateY(-8px) scale(1.05);
  }
  75% {
    transform: translateY(-5px) scale(1.02);
  }
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes glow {
  0%,
  100% {
  }
  50% {
  }
}

/* Enhanced hover effects */
.floating-quote-btn:hover {
  transform: scale(1.1) translateY(-3px);
  animation: bounce 0.6s ease-in-out;
}

.floating-quote-btn:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

/* Add subtle glow effect */
.floating-quote-btn img,
.floating-quote-btn .flip-card img {
  border-radius: 12px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  transition: all 0.3s ease;
}

.floating-quote-btn:hover img,
.floating-quote-btn:hover .flip-card img {
  filter: drop-shadow(0 8px 16px rgba(255, 165, 0, 0.3));
}

/* Flip Card Animation */
.flip-card {
  background-color: transparent;
  width: 300px;
  height: auto;
  perspective: 1000px;
  display: block;
}

@media (max-width: 768px) {
  .flip-card {
    width: 200px;
  }
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
  animation: autoFlip 4s infinite;
}

.floating-quote-btn:hover .flip-card-inner {
  transform: rotateY(180deg);
  animation-play-state: paused;
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* Auto flip animation */
@keyframes autoFlip {
  0%,
  70% {
    transform: rotateY(0deg);
  }
  85%,
  100% {
    transform: rotateY(180deg);
  }
}

/* Keep floating card showing back face */
.flip-card.force-back .flip-card-inner {
transform: rotateY(180deg) !important;
}


/* interntal css */
.qq-box {
        margin-top: 20px;
        margin-bottom: 20px;
        background: #d9d9d9;
        border-radius: 18px;
        padding: 10px 14px; /* reduce padding > 12px 16px */
        display: flex;
        flex-direction: column;
        gap: 10px;
        max-width: 100%;
        overflow: hidden;
        position: relative;
    }
    .qq-row-top {
        display: flex;
        align-items: center;
        gap: 7px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .qq-row-top i {
        font-size: 18px;
        color: #111;
    }
    .qq-row-top .label {
        color: #111;
        font-weight: 600;
        margin: 0 0 0 0;
        font-size: 14px;
        white-space: nowrap;
    }
    .qq-row-top .input {
        background: #fff;
        border: 1px solid rgba(0, 0, 0, 0.15);
        border-radius: 4px;
        padding: 6px 8px;
        height: 32px;
        line-height: 32px;
        flex: 0 0 auto;
    }
    .qq-row-top .zip {
        width: 130px;
    }
    .qq-row-top .dim {
        width: 52px;
        text-align: center;
    }
    .qq-row-top .qty {
        width: 52px;
        text-align: center;
    }
    #qq-height::-webkit-outer-spin-button,
    #qq-height::-webkit-inner-spin-button,
    #qq-width::-webkit-outer-spin-button,
    #qq-width::-webkit-inner-spin-button,
    #qq-depth::-webkit-outer-spin-button,
    #qq-depth::-webkit-inner-spin-button,
    #qq-weight::-webkit-outer-spin-button,
    #qq-weight::-webkit-inner-spin-button,
    #qq-qty::-webkit-outer-spin-button,
    #qq-qty::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }
    #qq-height[type="number"],
    #qq-width[type="number"],
    #qq-depth[type="number"],
    #qq-weight[type="number"],
    #qq-qty[type="number"] {
        appearance: textfield;
        -moz-appearance: textfield;
    }
    .qq-row-top .quote-mark {
        margin-left: 4px;
        margin-right: 8px;
        color: #111;
        font-weight: 600;
    }
    /* Desktop/default: wrappers should not affect layout */
    .qq-dims {
        display: contents;
    }
    .qq-dims .field {
        display: contents;
    }
    .qq-row-bottom {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-top: 4px;
    }
    .qq-cta-text {
        color: #f28500;
        font-weight: 800;
        font-style: italic;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        font-size: 22px;
        flex: 1;
        text-align: center;
    }
    .qq-row-bottom.is-quoted .qq-cta-text {
        color: #28a745;
    }
    .qq-cta-btn {
        background: #f28500;
        color: #fff;
        font-weight: 600;
        border: none;
        padding: 1px 16px;
        border-radius: 26px;
        text-decoration: none;
        font-style: italic;
        display: inline-block;
        white-space: nowrap;
        font-size: 28px;
    }
    .qq-cta-btn:hover {
        filter: brightness(0.96);
    }
    .qq-cta-btn:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }
    .qq-actions {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-left: auto;
    }
    .qq-price-btn {
        background: #28a745;
        color: #fff;
        font-weight: 600; /* Adjusted font-weight */
        border: none;
        padding: 4px 24px;
        border-radius: 25px;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 10px;
        font-style: italic;
        white-space: normal;
        font-size: 20px;
    }
    .qq-price-btn .price {
        font-size: 2em;
        font-weight: 700; /* Adjusted font-weight */
        line-height: 1;
        letter-spacing: -0.3px;
        display: inline-flex; /* Adjusted display center */
        align-items: center;
    }
    .qq-price-btn .price .currency {
        font-weight: 500;
        font-size: 0.65em;
        line-height: 1;
        display: inline-block;
        margin-right: 4px;
        vertical-align: middle;
    }
    .qq-price-btn .cta {
        display: inline-block;
        line-height: 1.05;
        text-align: left;
        font-weight: 700;
        font-size: 0.9em;
    }
    .qq-clear-btn {
        background: #fff;
        border: 1px solid rgba(0, 0, 0, 0.15);
        color: #555;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: none;
        font-size: 18px;
        cursor: pointer;
    }
    .qq-clear-btn:hover {
        background: rgba(0, 0, 0, 0.08);
    }
    .qq-clear-btn i {
        pointer-events: none;
    }
    .qq-clear-btn:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
    }
    .qq-error {
        color: #e53935;
        font-weight: 600;
        margin-left: 8px;
    }
    .qq-form-error {
        color: #e53935;
        font-weight: 600;
        font-size: 12px;
        margin-bottom: 8px;
    }

    @keyframes slideInLR {
        from {
            transform: translateX(-5000%);
            opacity: 0;
        }

        to {
            transform: translateX(0);
            opacity: 1;
        }
    }
    @media (max-width: 576px) {
        .qq-box {
            padding: 10px 12px;
            margin: 12px;
        }
        .qq-row-top {
            display: grid !important;
            grid-template-columns: 1fr 1fr;
            align-items: center;
            column-gap: 8px;
            row-gap: 8px;
            overflow-x: visible;
            white-space: normal;
        }
        .qq-row-top i {
            display: none !important;
        }
        .qq-row-top .label {
            margin: 0;
            width: 68px;
            align-self: center;
            line-height: 1.1;
        }
        .qq-row-top .zip {
            width: 100%;
            min-width: 0;
        }
        .qq-row-top .input {
            height: 40px;
            line-height: 40px;
            font-size: 16px;
        }
        .qq-row-top .dim,
        .qq-row-top .qty {
            width: 100%;
        }
        /* Mobile dims: 2x2 grid (Depth,Width) on first row; (Height,Qty) on second row */
        .qq-dims {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            grid-column: 1 / -1;
            column-gap: 12px;
            row-gap: 8px;
            width: 100%;
        }
        .qq-dims .field:nth-child(1) {
            grid-column: 1;
        }
        .qq-dims .field:nth-child(2) {
            grid-column: 2;
        }
        .qq-dims .field:nth-child(3) {
            grid-column: 3;
        }
        .qq-dims .field:nth-child(4) {
            grid-column: 1 / span 2;
        }
        .qq-dims .field:nth-child(5) {
            grid-column: 3;
        }
        .qq-dims .field {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .qq-dims .field .label {
            width: auto;
            margin: 0;
        }
        .qq-dims .field input {
            flex: 1;
            width: 100%;
        }
        .qq-row-bottom {
            flex-wrap: wrap;
        }
        .qq-actions {
            width: 100%;
            justify-content: center;
            margin-left: 0;
        }
        .qq-cta-text {
            font-size: 16px;
        }
        .trado_banner.home_page .image_over_text {
            padding-top: clamp(104px, 18vw, 140px);
        }
        .image_over_text h2.text_shadow {
            margin-top: 8px;
            margin-bottom: 6px;
        }
        .image_over_text p.text_shadow {
            margin-bottom: 10px;
        }
        .image_over_text .qq-box {
            margin-top: 24px;
        }
    }
    /* Keep floating card showing back face */
    .flip-card.force-back .flip-card-inner {
        transform: rotateY(180deg) !important;
    }