/* ===============================================
   MANGO BLOSSOM - BUTTON SYSTEM
   Cross-browser compatible, accessibility-first
   =============================================== */

/* ===== BASE BUTTON STYLES ===== */
.btn-base, .btn, button, input[type="button"], input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    background-color: transparent;
    color: inherit;
    
    /* Transitions (safe) */
    transition: background-color 0.3s ease,
                border-color 0.3s ease,
                color 0.3s ease,
                box-shadow 0.3s ease,
                filter 0.3s ease;
    
    user-select: none;
    white-space: nowrap;
    min-height: 44px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    
    /* No transform on buttons */
    -webkit-appearance: button;
    -moz-appearance: button;
    appearance: button;
}

/* Remove default button styles */
button { background: inherit; border: inherit; padding: inherit; }

/* ===== SIZE VARIANTS ===== */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    min-height: 36px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
    min-height: 52px;
}

.btn-xl {
    padding: 1.25rem 2.5rem;
    font-size: 1.125rem;
    min-height: 60px;
}

/* ===== COLOR VARIANTS ===== */

/* Primary Button */
.btn-primary-custom, .btn-primary {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: #ffffff;
    border-color: #FF6B35;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
}

.btn-primary-custom:hover, 
.btn-primary:hover {
    background: linear-gradient(135deg, #E55A2B 0%, #FF8A65 100%);
    border-color: #E55A2B;
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.35);
    filter: brightness(1.05);
}

.btn-primary-custom:active,
.btn-primary:active {
    background: linear-gradient(135deg, #E55A2B 0%, #FF8A65 100%);
    border-color: #E55A2B;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.25);
}

/* Outline Button */
.btn-outline-primary, .btn-outline-custom {
    background: transparent;
    color: #FF6B35;
    border-color: #FF6B35;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.1);
}

.btn-outline-primary:hover,
.btn-outline-custom:hover {
    background: rgba(255, 107, 53, 0.1);
    color: #E55A2B;
    border-color: #E55A2B;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
    filter: brightness(0.95);
}

.btn-outline-primary:active,
.btn-outline-custom:active {
    background: rgba(255, 107, 53, 0.15);
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.15);
}

/* Light/Secondary Button */
.btn-light-custom {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    color: #2D3748;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.btn-light-custom:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.95) 100%);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
}

.btn-light-custom:active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.8) 100%);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.15);
}

/* Delete Button */
.btn-delete {
    background: linear-gradient(135deg, #E53E3E 0%, #C53030 100%);
    color: white;
    border-color: #E53E3E;
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.25);
}

.btn-delete:hover {
    background: linear-gradient(135deg, #C53030 0%, #9B2C2C 100%);
    border-color: #C53030;
    box-shadow: 0 8px 20px rgba(229, 62, 62, 0.35);
}

.btn-delete:active {
    background: linear-gradient(135deg, #9B2C2C 0%, #742A2A 100%);
    box-shadow: 0 2px 8px rgba(229, 62, 62, 0.25);
}

/* ===== HERO BUTTON ===== */
.btn-hero-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    min-height: 52px;
    padding: 1rem 3.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    white-space: nowrap;
}

.btn-hero-custom.btn-primary-custom {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 10px 20px rgba(255, 107, 53, 0.3);
}

.btn-hero-custom.btn-primary-custom:hover {
    background: linear-gradient(135deg, #E55A2B 0%, #FF8A65 100%);
    box-shadow: 0 12px 28px rgba(255, 107, 53, 0.35);
    filter: brightness(1.02);
}

.btn-hero-custom.btn-light-custom {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    color: #2D3748;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-hero-custom.btn-light-custom:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.95) 100%);
    box-shadow: 0 12px 28px rgba(255, 255, 255, 0.2);
}

/* ===== QUANTITY BUTTONS ===== */
.btn-quantity {
    background: linear-gradient(135deg, #F8F9FA 0%, #E9ECEF 100%);
    color: #495057;
    border: 1px solid #CED4DA;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    padding: 0.5rem 0.75rem;
    min-height: 36px;
    font-size: 0.875rem;
    border-radius: 0.375rem;
}

.btn-quantity:hover {
    background: linear-gradient(135deg, #E9ECEF 0%, #DEE2E6 100%);
    border-color: #ADB5BD;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
    filter: brightness(0.98);
}

.btn-quantity:active {
    background: linear-gradient(135deg, #DEE2E6 0%, #CED4DA 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ===== FOCUS & ACCESSIBILITY ===== */
.btn-base:focus-visible,
.btn:focus-visible,
button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible {
    outline: 3px solid #FF6B35;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(255, 107, 53, 0.15);
}

.btn-primary-custom:focus-visible,
.btn-primary:focus-visible {
    outline: 3px solid #FFFFFF;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.3), 0 4px 12px rgba(255, 107, 53, 0.25);
}

/* ===== DISABLED STATE ===== */
.btn-base:disabled,
.btn:disabled,
button:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled,
.btn-base.disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== STATES ===== */
.btn-base.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-base.success {
    background: linear-gradient(135deg, #38A169 0%, #2F855A 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.25);
}

.btn-base.error {
    background: linear-gradient(135deg, #E53E3E 0%, #C53030 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.25);
}

/* ===== BUTTON GROUPS ===== */
.btn-group {
    display: inline-flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ===== FULL WIDTH ===== */
.btn-block {
    width: 100%;
    display: flex;
}

.btn-flex-fill {
    flex: 1 1 auto;
}

/* ===== ICON BUTTONS ===== */
.btn-icon-only {
    padding: 0.75rem;
    min-width: 44px;
    min-height: 44px;
    border-radius: 0.5rem;
}

.btn-icon-only.btn-round {
    border-radius: 50%;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .btn-base, .btn, button {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
        min-height: 40px;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
        min-height: 44px;
    }
    
    .btn-hero-custom {
        padding: 0.875rem 2rem;
        font-size: 0.9375rem;
        min-width: 180px;
    }
    
    .btn-group {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .btn-base, .btn, button {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
        min-height: 36px;
    }
    
    .btn-lg {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
        min-height: 40px;
    }
    
    .btn-hero-custom {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
        min-width: 160px;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ===== UTILITY CLASSES ===== */
.btn-inline { display: inline-flex; }
.btn-block { display: flex; width: 100%; }

/* Cart specific - prevent animations */
.cart-item .btn,
.cart-item .btn-quantity,
.cart-item .btn-delete {
    transition: background-color 0.3s ease,
                border-color 0.3s ease,
                color 0.3s ease,
                box-shadow 0.3s ease,
                filter 0.3s ease;
}
