/**
 * MASTROMEC - SISTEMA DE BOTONES
 * Botones y CTAs extraídos del HTML inline
 */

/* ===== CTA BUTTON SYSTEM ===== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    font-weight: var(--font-weight-semibold);
    font-size: 1rem;
    line-height: 1;
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    min-height: 48px; /* Touch target optimization */
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--whatsapp-green);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: #20B858;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--mastromec-blue);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    background: var(--mastromec-blue-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--mastromec-blue);
    border: 2px solid var(--mastromec-blue);
}

.btn-outline:hover {
    background: var(--mastromec-blue);
    color: var(--white);
}

.btn-white {
    background: var(--white);
    color: var(--mastromec-blue);
}

.btn-white:hover {
    background: var(--gray-100);
    transform: translateY(-2px);
}

/* ===== BUTTON GROUPS ===== */

.btn-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    justify-content: center;
    margin-top: var(--spacing-xl);
}

@media (min-width: 640px) {
    .btn-group {
        flex-direction: row;
    }
}

/* ===== SCROLL TO TOP BUTTON ===== */

.scroll-to-top {
    position: fixed;
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
    width: 50px;
    height: 50px;
    background: var(--mastromec-blue);
    color: var(--white);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: var(--mastromec-blue-light);
    transform: translateY(-2px);
}

/* ===== BUTTON ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
    .btn {
        transition-duration: 0.01ms;
        transform: none;
    }

    .btn:hover {
        transform: none;
    }
}

@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
}

/* ===== BUTTON STATES ===== */

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn:focus-visible {
    outline: 2px solid var(--mastromec-blue);
    outline-offset: 2px;
}

.btn:active {
    transform: scale(0.98);
}

/* ===== BUTTON SIZES ===== */

.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
    min-height: 36px;
}

.btn-lg {
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: 1.125rem;
    min-height: 56px;
}

/* ===== ICON BUTTONS ===== */

.btn-icon {
    padding: var(--spacing-md);
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.btn-icon-sm {
    padding: var(--spacing-sm);
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

/* ===== LOADING STATE ===== */

.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-spin 1s linear infinite;
}

@keyframes btn-spin {
    to {
        transform: rotate(360deg);
    }
}