/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Proxima Nova', -apple-system, 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Estilos para el panel de administración */
.admin-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-header h1 {
    color: #0055a5;
    margin-bottom: 10px;
}

.admin-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-card h2 {
    margin-bottom: 20px;
    color: #0055a5;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-primary {
    background-color: #0055a5;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #003d7a;
}

.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.generated-link {
    display: flex;
    margin-top: 10px;
}

.generated-link input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 4px 0 0 4px;
}

.generated-link button {
    padding: 10px 15px;
    background: #0055a5;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.link-info h3 {
    margin-bottom: 5px;
    color: #333;
}

.status-pending {
    color: #28a745;
    font-weight: bold;
}

.status-used {
    color: #dc3545;
    font-weight: bold;
}

.link-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.link-actions input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 300px;
}

.link-actions button {
    padding: 8px 12px;
    background: #0055a5;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.delete-btn {
    padding: 8px 12px;
    background: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.delete-btn:hover {
    background: #c82333;
}

/* Selector de logos */
.logo-selector-container {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.logo-selector {
    flex: 2;
}

.logo-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.logo-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.logo-option:hover {
    border-color: #3483fa;
    background-color: #f8f8f8;
}

.logo-option.selected {
    border-color: #0055a5;
    background-color: #e6f0ff;
}

.logo-option img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 5px;
}

.logo-option span {
    font-size: 10px;
    text-align: center;
    word-break: break-all;
}

.no-logos {
    grid-column: 1 / -1;
    text-align: center;
    color: #666;
    padding: 20px;
}

.logo-preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 1px dashed #ddd;
    border-radius: 4px;
    min-height: 150px;
    justify-content: center;
    background-color: #f9f9f9;
}

.logo-preview-container p {
    color: #666;
    margin-bottom: 10px;
    text-align: center;
}

.logo-preview-container img {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
    display: none;
}

/* Estilos para la página de pago */
.mp-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.mp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
}

.merchant-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.merchant-logo img {
    height: 40px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.merchant-name {
    font-weight: bold;
    font-size: 18px;
}

.payment-info-header {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.payment-link-label {
    font-size: 14px;
    color: #666;
}

.payment-amount {
    font-size: 20px;
    font-weight: bold;
    color: #00a650;
}

.mp-main {
    padding: 20px;
}

.checkout-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.payment-form-section {
    background: white;
    padding: 20px;
    border-radius: 6px;
}

.payment-form-section h1 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.order-summary-section {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 6px;
}

.order-summary-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

.product-summary {
    display: flex;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.product-details h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.product-price {
    font-size: 24px;
    font-weight: bold;
    color: #00a650;
}

.order-total {
    text-align: right;
    font-size: 18px;
    font-weight: bold;
}

.order-total span {
    color: #00a650;
}

/* Estilos del formulario de pago */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
}

.field-note {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #3483fa;
    box-shadow: 0 0 0 2px rgba(52, 131, 250, 0.2);
}

.card-icons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.card-icons img {
    height: 24px;
}

.cvv-container {
    display: flex;
    align-items: center;
}

.cvv-help {
    position: relative;
    display: inline-block;
    margin-left: 10px;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #ccc;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    cursor: help;
}

.cvv-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 150px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 10;
}

.cvv-help:hover .cvv-tooltip {
    opacity: 1;
    visibility: visible;
}

.cvv-tooltip img {
    max-width: 100%;
    margin-bottom: 5px;
}

.cvv-tooltip p {
    font-size: 12px;
    color: #666;
    margin: 0;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.back-button {
    padding: 12px 24px;
    background: #f8f8f8;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.back-button:hover {
    background-color: #e8e8e8;
}

.mp-button {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
}

.mp-button-primary {
    background-color: #3483fa;
    color: white;
}

.mp-button-primary:hover {
    background-color: #2968c8;
}

.security-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f8f8;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
}

.security-notice img {
    margin-right: 10px;
    height: 16px;
}

.mp-footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #eee;
    color: #999;
    font-size: 14px;
}

/* Estilos para página de confirmación */
.confirmation-page {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
}

.confirmation-icon {
    margin-bottom: 20px;
}

.confirmation-page h1 {
    font-size: 28px;
    color: #00a650;
    margin-bottom: 10px;
}

.confirmation-message {
    font-size: 18px;
    margin-bottom: 30px;
    color: #666;
}

.order-details {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: left;
}

.order-details h2 {
    margin-bottom: 20px;
    text-align: center;
    color: #333;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
}

.detail-value {
    color: #00a650;
}

.confirmation-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Nuevos estilos para validación */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

/* Responsive mejorado */
@media (max-width: 768px) {
    .admin-container {
        padding: 10px;
    }
    
    .checkout-container {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .link-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .link-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .link-actions input {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .link-actions button,
    .link-actions a {
        width: 100%;
        text-align: center;
    }
    
    .mp-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .merchant-info {
        justify-content: center;
    }
    
    .payment-info-header {
        align-items: center;
    }
    
    .logo-selector-container {
        flex-direction: column;
    }
    
    .logo-options {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .logo-option img {
        width: 30px;
        height: 30px;
    }
    
    .logo-preview-container {
        min-height: 120px;
    }
    
    .logo-preview-container img {
        max-width: 80px;
        max-height: 80px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .back-button, .mp-button {
        width: 100%;
    }
    
    .confirmation-actions {
        flex-direction: column;
    }
    
    .confirmation-actions .mp-button {
        width: 100%;
    }
    
    .admin-card {
        padding: 15px;
    }
    
    .admin-header {
        padding: 15px;
    }
    
    .generated-link {
        flex-direction: column;
    }
    
    .generated-link input {
        border-right: 1px solid #ddd;
        border-radius: 4px 4px 0 0;
    }
    
    .generated-link button {
        border-radius: 0 0 4px 4px;
    }
}

@media (max-width: 480px) {
    .admin-header h1 {
        font-size: 24px;
    }
    
    .admin-card h2 {
        font-size: 20px;
    }
    
    .logo-options {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 8px;
    }
    
    .logo-option img {
        width: 25px;
        height: 25px;
    }
    
    .logo-option span {
        font-size: 8px;
    }
    
    .logo-preview-container {
        min-height: 100px;
    }
    
    .logo-preview-container img {
        max-width: 60px;
        max-height: 60px;
    }
}