/* ================================================================
 * BUTTONS.CSS - BEM-based independent button styles
 * Following Block Element Modifier methodology
 * ================================================================ */

/* ================================================================
 * BUTTON BLOCK - Base button component
 * ================================================================ */

.button {
    /* Reset all default button styling */
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    outline: none;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;

    /* Base button styling */
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
    user-select: none;
    white-space: nowrap;
    vertical-align: middle;
    min-height: 40px;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

/* ================================================================
 * BUTTON MODIFIERS - Different button variants
 * ================================================================ */

/* Primary button - Main actions */
.button--primary {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.button--primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #357abd, #2a5298);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.button--primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
}

.button--primary:focus:not(:disabled) {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* Secondary button - Supporting actions */
.button--secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.button--secondary:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.button--secondary:active:not(:disabled) {
    background: #dee2e6;
    transform: translateY(1px);
}

.button--secondary:focus:not(:disabled) {
    outline: 2px solid #6c757d;
    outline-offset: 2px;
}

/* Success button - Positive actions */
.button--success {
    background: #28a745;
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.button--success:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.button--success:active:not(:disabled) {
    background: #1e7e34;
    transform: translateY(0);
}

.button--success:focus:not(:disabled) {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

/* Danger button - Destructive actions */
.button--danger {
    background: #dc3545;
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.button--danger:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.button--danger:active:not(:disabled) {
    background: #bd2130;
    transform: translateY(0);
}

.button--danger:focus:not(:disabled) {
    outline: 2px solid #dc3545;
    outline-offset: 2px;
}

/* Info button - Informational actions */
.button--info {
    background: #186cdf;
    color: white;
    box-shadow: 0 2px 8px rgba(24, 108, 223, 0.3);
}

.button--info:hover:not(:disabled) {
    background: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(24, 108, 223, 0.4);
}

.button--info:active:not(:disabled) {
    background: #2a5298;
    transform: translateY(0);
}

.button--info:focus:not(:disabled) {
    outline: 2px solid #186cdf;
    outline-offset: 2px;
}

/* Ghost button - Minimal styling */
.button--ghost {
    background: transparent;
    color: #4a90e2;
    border: 1px solid #4a90e2;
}

.button--ghost:hover:not(:disabled) {
    background: #4a90e2;
    color: white;
}

.button--ghost:active:not(:disabled) {
    background: #357abd;
    border-color: #357abd;
}

.button--ghost:focus:not(:disabled) {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* ================================================================
 * BUTTON SIZE MODIFIERS
 * ================================================================ */

.button--small {
    padding: 8px 16px;
    font-size: 12px;
    min-height: 32px;
}

.button--large {
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    min-height: 48px;
}

.button--full-width {
    width: 100%;
}

/* ================================================================
 * BUTTON SHAPE MODIFIERS
 * ================================================================ */

.button--rounded {
    border-radius: 50px;
}

.button--square {
    border-radius: 0;
}

/* ================================================================
 * ICON BUTTON BLOCK - Buttons with icons
 * ================================================================ */

.icon-button {
    background: none;
    border: none;
    padding: 8px;
    margin: 0;
    cursor: pointer;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    min-width: 40px;
    min-height: 40px;
}

.icon-button:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
}

.icon-button:active:not(:disabled) {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(0.95);
}

.icon-button:focus:not(:disabled) {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

.icon-button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

/* Icon button modifiers */
.icon-button--primary {
    background: #4a90e2;
    color: white;
}

.icon-button--primary:hover:not(:disabled) {
    background: #357abd;
}

.icon-button--danger {
    background: #dc3545;
    color: white;
}

.icon-button--danger:hover:not(:disabled) {
    background: #c82333;
}

/* ================================================================
 * CLOSE BUTTON BLOCK - Specific close button component
 * ================================================================ */

.close-button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6c757d;
    font-size: 18px;
    line-height: 1;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    min-width: 32px;
    min-height: 32px;
}

.close-button:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.1);
    color: #495057;
}

.close-button:active:not(:disabled) {
    background: rgba(0, 0, 0, 0.15);
    transform: scale(0.95);
}

.close-button:focus:not(:disabled) {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* ================================================================
 * COUNTER BUTTON BLOCK - Plus/minus buttons for counters
 * ================================================================ */

.counter-button {
    background: white;
    border: 2px solid #e1e5e9;
    color: #4a90e2;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
}

.counter-button:hover:not(:disabled) {
    border-color: #4a90e2;
    background: #f8f9fa;
}

.counter-button:active:not(:disabled) {
    background: #e9ecef;
    transform: scale(0.95);
}

.counter-button:focus:not(:disabled) {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

.counter-button:disabled {
    border-color: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

.counter-button:disabled:hover {
    border-color: #dee2e6;
    background: white;
    transform: none;
}

/* ================================================================
 * NAVIGATION BUTTON BLOCK - Tab and navigation buttons
 * ================================================================ */

.nav-button {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.2s ease;
    position: relative;
}

.nav-button:hover:not(:disabled) {
    background: #f8f9fa;
    color: #495057;
}

.nav-button:focus:not(:disabled) {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

.nav-button--active {
    color: #4a90e2;
    border-bottom-color: #4a90e2;
    background: white;
}

.nav-button--active:hover {
    background: white;
}

/* ================================================================
 * CALENDAR BUTTON BLOCK - Calendar navigation buttons
 * ================================================================ */

.calendar-button {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #4a90e2;
    font-weight: bold;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1;
    transition: all 0.2s ease;
    min-width: 28px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.calendar-button:hover:not(:disabled) {
    background: #f8f9fa;
}

.calendar-button:active:not(:disabled) {
    background: #e9ecef;
    transform: scale(0.95);
}

.calendar-button:focus:not(:disabled) {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* ================================================================
 * SEARCH BUTTON BLOCK - Main search form button
 * ================================================================ */

.search-button {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
    padding: 15px 30px;
    min-height: 50px;
}

.search-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #357abd, #2a5298);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.search-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.search-button:focus:not(:disabled) {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* Estilos para el estado de carga del botón */
.search-button:disabled,
.search-button.loading {
    background: linear-gradient(135deg, #94b8e0, #7ba3d1);
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

.search-button.loading {
    pointer-events: none;
}

.search-button .spinner {
    display: inline-block;
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

.search-button .spinner svg {
    width: 16px;
    height: 16px;
    color: currentColor;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Animación suave para la transición de texto */
.search-button span {
    transition: all 0.3s ease;
}

/* ================================================================
 * BOOKING BUTTON BLOCK - Reservation and payment buttons
 * ================================================================ */

.booking-button {
    background: #186cdf;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 16px 24px;
    width: 100%;
    min-height: 48px;
    text-align: center;
    display: block;
}

.booking-button:hover:not(:disabled) {
    background: #3367d6;
}

.booking-button:active:not(:disabled) {
    background: #2c5aa0;
}

.booking-button:focus:not(:disabled) {
    outline: 2px solid #186cdf;
    outline-offset: 2px;
}

/* ================================================================
 * MOBILE RESPONSIVE ADJUSTMENTS
 * ================================================================ */

@media (max-width: 768px) {
    .button {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px;
    }

    .button--small {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 36px;
    }

    .button--large {
        padding: 16px 24px;
        font-size: 16px;
        min-height: 52px;
    }

    .search-button {
        padding: 16px 24px;
        font-size: 14px;
        min-height: 48px;
    }

    .booking-button {
        padding: 16px 20px;
        font-size: 16px;
        min-height: 52px;
    }
}

@media (max-width: 480px) {
    .button {
        padding: 14px 20px;
        min-height: 48px;
    }

    .button--full-width {
        width: 100%;
    }

    .search-button {
        width: 100%;
        padding: 18px 24px;
        min-height: 52px;
    }
}

/* ================================================================
 * ACCESSIBILITY ENHANCEMENTS
 * ================================================================ */

@media (prefers-reduced-motion: reduce) {

    .button,
    .icon-button,
    .close-button,
    .counter-button,
    .nav-button,
    .calendar-button,
    .search-button,
    .booking-button {
        transition: none;
    }

    .button:hover,
    .button--primary:hover,
    .button--success:hover,
    .search-button:hover {
        transform: none;
    }
}

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

    .button--primary {
        background: #000;
        color: #fff;
        border-color: #fff;
    }

    .button--secondary {
        background: #fff;
        color: #000;
        border-color: #000;
    }
}

/* ================================================================
 * FOCUS VISIBLE SUPPORT (for better accessibility)
 * ================================================================ */

.button:focus:not(:focus-visible) {
    outline: none;
}

.button:focus-visible {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}