/* ============================================
   MSB GROUP - SOLUÇÕES - ESTILOS CUSTOMIZADOS
   Versão atualizada com produtos dinâmicos
   ============================================ */

/* ============================================
   RESET E CONFIGURAÇÕES GLOBAIS
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #f97316;   /* laranja 500 */
    --primary-hover: #ea580c;   /* laranja 600 */
    --secondary-color: #0ea5e9; /* sky 500 */
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #0ea5e9;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --transition-speed: 0.3s;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.loading-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Loading pequeno para botões */
.loading-spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

/* ============================================
   BOTÕES DE PAGAMENTO
   ============================================ */
.payment-btn-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 2px solid #d1d5db;
    background-color: transparent;
    color: #6b7280;
    transition: all 0.3s ease;
    cursor: pointer;
}

.payment-btn-card:hover {
    border-color: #9ca3af;
    background-color: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.payment-btn-pix {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 2px solid var(--primary-color);
    background-color: #fff7ed; /* laranja-50 */
    color: var(--primary-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.payment-btn-pix:hover {
    background-color: #e0e7ff;
    border-color: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

/* ============================================
   CARDS DE PRODUTOS
   ============================================ */
.product-card {
    transition: transform var(--transition-speed) ease, 
                box-shadow var(--transition-speed) ease;
    border-radius: 0.75rem;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
                0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Badge de destaque nos produtos */
.product-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* ============================================
   CAMPOS DE CARTÃO (MERCADO PAGO IFRAMES)
   ============================================ */
#cardNumber,
#expirationDate,
#securityCode,
#issuer,
#installments {
    min-height: 48px;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: white;
    transition: border-color 0.3s ease;
}

#cardNumber:focus-within,
#expirationDate:focus-within,
#securityCode:focus-within {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Garantir que iframes do Mercado Pago sejam visíveis */
#cardNumber iframe,
#expirationDate iframe,
#securityCode iframe {
    width: 100% !important;
    height: 48px !important;
    border: none !important;
}

iframe[name^="__privateStripeMetricsController"],
iframe[name^="__privateStripeFrame"] {
    display: block !important;
    visibility: visible !important;
}

/* ============================================
   MODAIS
   ============================================ */
.modal-overlay {
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    animation: slideUp 0.4s ease-out;
}

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

/* ============================================
   INPUTS E FORMULÁRIOS
   ============================================ */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
select,
textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    border-color: #4f46e5;
}

/* ============================================
   SCROLLBAR CUSTOMIZADO
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--gray-100);
}

/* ============================================
   TRANSIÇÕES SUAVES
   ============================================ */
.transition-all {
    transition: all var(--transition-speed) ease;
}

.transition-colors {
    transition: background-color var(--transition-speed) ease,
                color var(--transition-speed) ease,
                border-color var(--transition-speed) ease;
}

.transition-transform {
    transition: transform var(--transition-speed) ease;
}

/* ============================================
   BADGES E TAGS
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-error {
    background-color: #fee2e2;
    color: #991b1b;
}

/* ============================================
   ALERTAS E NOTIFICAÇÕES
   ============================================ */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    border-width: 1px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}

.alert-error {
    background-color: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.alert-warning {
    background-color: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.alert-info {
    background-color: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   HOVER EFFECTS
   ============================================ */
.hover-scale {
    transition: transform var(--transition-speed) ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-lift {
    transition: transform var(--transition-speed) ease,
                box-shadow var(--transition-speed) ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* ============================================
   GRID DE PRODUTOS - EMPTY STATE
   ============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-text {
    color: var(--gray-600);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* ============================================
   QR CODE PIX
   ============================================ */
#pixQrCode img {
    border: 4px solid var(--primary-color);
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.2);
    max-width: 280px;
    width: 100%;
    height: auto;
}

/* ============================================
   BOTÕES CUSTOMIZADOS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

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

.btn-outline:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .payment-btn-pix,
    .payment-btn-card {
        padding: 0.75rem;
    }
    
    .product-card:hover {
        transform: translateY(-4px);
    }
    
    #pixQrCode img {
        max-width: 240px;
    }
}

/* Mobile pequeno */
@media (max-width: 480px) {
    .loading-spinner {
        width: 48px;
        height: 48px;
    }
    
    .modal-content {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* ============================================
   ANIMAÇÕES DE ENTRADA
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Delay progressivo para cards */
.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }

/* ============================================
   ESTADOS DE FOCO (ACESSIBILIDADE)
   ============================================ */
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    header,
    footer,
    button,
    .modal-overlay {
        display: none !important;
    }
    
    .product-card {
        break-inside: avoid;
    }
    
    body {
        background: white !important;
    }
}

/* ============================================
   DARK MODE SUPPORT (PREPARADO PARA FUTURO)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Descomente para habilitar dark mode automático */
    /*
    :root {
        --gray-50: #111827;
        --gray-100: #1f2937;
        --gray-200: #374151;
        --gray-300: #4b5563;
        --gray-400: #6b7280;
        --gray-500: #9ca3af;
        --gray-600: #d1d5db;
        --gray-700: #e5e7eb;
        --gray-800: #f3f4f6;
        --gray-900: #f9fafb;
    }
    */
}

/* ============================================
   UTILITÁRIOS
   ============================================ */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shadow-soft {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.shadow-medium {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.shadow-strong {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}


/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.status-paid {
    background-color: #dbeafe;
    color: #1e40af;
}

/* ============================================
   FIM DO ARQUIVO
   ============================================ */