/* ============================================
   LoadingButton Component Styling
   Inspired by Mercado Livre's checkout
   ============================================ */

.c-loading-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font-primary, sans-serif);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
    outline: none;
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
    overflow: hidden; /* Importante para o progresso ficar contido */
}

.c-loading-button--block {
    display: flex;
    width: 100%;
}

/* SIZES */
.c-loading-button--sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.c-loading-button--md {
    padding: 0.85rem 1.75rem;
    font-size: 0.85rem;
}

.c-loading-button--lg {
    padding: 1.1rem 2.25rem;
    font-size: 1rem;
    height: 3.5rem;
}

.c-loading-button--xl {
    padding: 1.5rem 3rem;
    font-size: 1.05rem;
}

/* VARIANTS AND COLORS */

.c-loading-button--primary {
    background-color: var(--secondary-color, #20213D);
    color: #fff;
}

.c-loading-button--success {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    color: #fff;
}

/* PROGRESS BAR STYLES */
.c-loading-button__progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.25); /* Escurece a cor atual do botão */
    transition: width 0.3s linear;
    z-index: 1;
}

/* LOADING CONTENT */
.c-loading-button__loading-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}

.c-loading-button__phrase-container {
    padding: 0 1rem;
    text-align: center;
    width: 100%;
}

.c-loading-button__phrase {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: none; /* Frases ficam melhor em normal case */
    letter-spacing: 0;
    display: block;
}

/* TRANSITIONS */
.phrase-fade-enter-active,
.phrase-fade-leave-active {
    transition: all 0.4s ease;
}

.phrase-fade-enter-from {
    opacity: 0;
    transform: translateY(10px);
}

.phrase-fade-leave-to {
    opacity: 0;
    transform: translateY(-10px);
}

/* NORMAL CONTENT */
.c-loading-button--disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.c-loading-button__content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.c-loading-button__icon-left,
.c-loading-button__icon-right {
    font-size: 0.9em;
}

/* States */
.c-loading-button--primary:hover:not(.c-loading-button--disabled) {
    background-color: #313361;
}

.c-loading-button--success:hover:not(.c-loading-button--disabled) {
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
}
