 /* ============================================================================
   VALENCIA BOAT SHOW 2025 - TEMPLATES CSS
   Estilos para la nueva sección de templates prediseñados
   ============================================================================ */

/* Variables CSS para consistencia */
:root {
    --vbs-blue: #4d6d80;
    --vbs-beige: #f3f2f0;
    --vbs-white: #ffffff;
    --vbs-dark: #2c3e50;
    --vbs-success: #28a745;
    --vbs-danger: #dc3545;
    --vbs-warning: #ffc107;
    --vbs-info: #17a2b8;
    --vbs-instagram: #E4405F;
    --vbs-shadow: 0 4px 15px rgba(77, 109, 128, 0.1);
    --vbs-shadow-hover: 0 8px 25px rgba(77, 109, 128, 0.15);
    --vbs-border-radius: 12px;
    --vbs-transition: all 0.3s ease;
}

/* ============================================================================
   TEMPLATES SECTION
   ============================================================================ */

.mg-templates-section {
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, var(--vbs-beige) 0%, #f8f9fa 100%);
    border-radius: var(--vbs-border-radius);
    border: 2px solid rgba(77, 109, 128, 0.1);
}

.mg-section-header {
    text-align: center;
    margin-bottom: 30px;
}

.mg-section-title {
    font-size: 28px;
    color: var(--vbs-blue);
    margin-bottom: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.mg-section-title i {
    font-size: 24px;
    color: var(--vbs-instagram);
    animation: magicPulse 2s infinite;
}

@keyframes magicPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.mg-section-subtitle {
    font-size: 16px;
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Templates Grid */
.mg-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.mg-template-card {
    background: var(--vbs-white);
    border-radius: var(--vbs-border-radius);
    padding: 25px;
    border: 2px solid rgba(77, 109, 128, 0.1);
    transition: var(--vbs-transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.mg-template-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--vbs-shadow-hover);
    border-color: var(--vbs-blue);
}

.mg-template-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--vbs-blue), var(--vbs-instagram), var(--vbs-success));
    opacity: 0;
    transition: var(--vbs-transition);
}

.mg-template-card:hover::before {
    opacity: 1;
}

.mg-template-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(77, 109, 128, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: var(--vbs-transition);
}

.mg-template-icon i {
    font-size: 28px;
    transition: var(--vbs-transition);
}

.mg-template-card:hover .mg-template-icon {
    background: rgba(77, 109, 128, 0.2);
    transform: scale(1.1);
}

.mg-template-info h4 {
    font-size: 20px;
    color: var(--vbs-blue);
    margin-bottom: 12px;
    font-weight: 600;
}

.mg-template-info p {
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 15px;
    font-size: 14px;
}

.mg-template-specs {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.mg-spec {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--vbs-blue);
    background: rgba(77, 109, 128, 0.1);
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: 500;
}

.mg-spec i {
    font-size: 10px;
}

.mg-template-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--vbs-blue), #5a7a8f);
    color: var(--vbs-white);
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--vbs-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mg-template-btn:hover {
    background: linear-gradient(135deg, #5a7a8f, var(--vbs-blue));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 109, 128, 0.3);
}

.mg-template-btn:active {
    transform: translateY(0);
}

/* Divider */
.mg-divider {
    text-align: center;
    margin: 40px 0;
    position: relative;
}

.mg-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--vbs-blue), transparent);
}

.mg-divider span {
    background: var(--vbs-white);
    padding: 0 20px;
    color: var(--vbs-blue);
    font-weight: 600;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.mg-divider span i {
    margin-right: 8px;
    color: var(--vbs-instagram);
}

/* ============================================================================
   MODAL TEMPLATES
   ============================================================================ */

.mg-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mg-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mg-modal-content {
    background: var(--vbs-white);
    margin: 20px;
    padding: 0;
    border-radius: var(--vbs-border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mg-modal-header {
    background: linear-gradient(135deg, var(--vbs-blue), #5a7a8f);
    color: var(--vbs-white);
    padding: 25px 30px;
    border-radius: var(--vbs-border-radius) var(--vbs-border-radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mg-modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.mg-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    color: var(--vbs-white);
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--vbs-transition);
}

.mg-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.mg-modal-body {
    padding: 30px;
}

/* Template Upload */
.mg-template-upload {
    margin-bottom: 25px;
}

.mg-template-upload label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--vbs-blue);
    font-size: 16px;
}

.mg-upload-area {
    border: 2px dashed var(--vbs-blue);
    border-radius: var(--vbs-border-radius);
    padding: 30px 20px;
    text-align: center;
    transition: var(--vbs-transition);
    cursor: pointer;
    background: rgba(77, 109, 128, 0.02);
}

.mg-upload-area:hover {
    border-color: var(--vbs-instagram);
    background: rgba(228, 64, 95, 0.05);
    transform: translateY(-2px);
}

.mg-upload-area i {
    font-size: 32px;
    color: var(--vbs-blue);
    margin-bottom: 10px;
    transition: var(--vbs-transition);
}

.mg-upload-area:hover i {
    color: var(--vbs-instagram);
    transform: scale(1.1);
}

.mg-upload-area p {
    margin: 10px 0 5px;
    color: var(--vbs-blue);
    font-weight: 500;
}

.mg-upload-area small {
    color: #6c757d;
    font-size: 12px;
}

/* Logo Preview */
.mg-logo-preview {
    position: relative;
    display: inline-block;
    margin-top: 15px;
}

.mg-logo-preview img {
    max-width: 150px;
    max-height: 100px;
    border-radius: 8px;
    border: 2px solid var(--vbs-beige);
    box-shadow: var(--vbs-shadow);
}

.mg-logo-preview button {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--vbs-danger);
    color: var(--vbs-white);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: var(--vbs-transition);
}

.mg-logo-preview button:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Template Options */
.mg-template-options {
    margin: 25px 0;
}

.mg-option-group {
    margin-bottom: 20px;
}

.mg-option-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--vbs-blue);
    font-size: 14px;
}

.mg-option-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mg-option-btn {
    background: var(--vbs-beige);
    border: 2px solid var(--vbs-beige);
    color: var(--vbs-blue);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--vbs-transition);
    font-weight: 500;
}

.mg-option-btn:hover {
    border-color: var(--vbs-blue);
    background: var(--vbs-white);
}

.mg-option-btn.active {
    background: var(--vbs-blue);
    color: var(--vbs-white);
    border-color: var(--vbs-blue);
}

/* Template Actions */
.mg-template-actions {
    margin-top: 30px;
    text-align: center;
}

.mg-generate-btn {
    background: linear-gradient(135deg, var(--vbs-instagram), #ff6b8a);
    color: var(--vbs-white);
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--vbs-transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.mg-generate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff6b8a, var(--vbs-instagram));
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(228, 64, 95, 0.4);
}

.mg-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.mg-loading {
    display: none;
}

.mg-generate-btn.loading .mg-loading {
    display: block;
}

.mg-generate-btn.loading span {
    display: none;
}

/* Template Results */
.mg-template-results {
    margin-top: 25px;
    text-align: center;
}

.mg-result-preview {
    margin-bottom: 20px;
}

.mg-result-preview img {
    max-width: 100%;
    height: auto;
    border-radius: var(--vbs-border-radius);
    box-shadow: var(--vbs-shadow);
}

.mg-result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.mg-download-btn {
    background: linear-gradient(135deg, var(--vbs-success), #20c997);
    color: var(--vbs-white);
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--vbs-transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mg-download-btn:hover {
    background: linear-gradient(135deg, #20c997, var(--vbs-success));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.mg-secondary-btn {
    background: var(--vbs-beige);
    color: var(--vbs-blue);
    border: 2px solid var(--vbs-blue);
    padding: 10px 23px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--vbs-transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mg-secondary-btn:hover {
    background: var(--vbs-blue);
    color: var(--vbs-white);
    transform: translateY(-2px);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .mg-templates-section {
        margin: 30px 0;
        padding: 20px;
    }
    
    .mg-templates-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .mg-template-card {
        padding: 20px;
    }
    
    .mg-section-title {
        font-size: 24px;
        flex-direction: column;
        gap: 8px;
    }
    
    .mg-modal-content {
        margin: 10px;
        width: calc(100% - 20px);
    }
    
    .mg-modal-header {
        padding: 20px;
    }
    
    .mg-modal-body {
        padding: 20px;
    }
    
    .mg-template-specs {
        flex-direction: column;
        gap: 8px;
    }
    
    .mg-result-actions {
        flex-direction: column;
    }
    
    .mg-download-btn,
    .mg-secondary-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .mg-template-card {
        padding: 15px;
    }
    
    .mg-template-icon {
        width: 50px;
        height: 50px;
    }
    
    .mg-template-icon i {
        font-size: 24px;
    }
    
    .mg-template-info h4 {
        font-size: 18px;
    }
    
    .mg-section-subtitle {
        font-size: 14px;
    }
    
    .mg-modal-header h3 {
        font-size: 20px;
    }
}

/* ============================================================================
   ANIMATIONS Y EFECTOS ESPECIALES
   ============================================================================ */

.mg-template-card {
    animation: templateFadeIn 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.mg-template-card:nth-child(1) { animation-delay: 0.1s; }
.mg-template-card:nth-child(2) { animation-delay: 0.2s; }
.mg-template-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes templateFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efecto de ondas en los botones */
.mg-template-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.mg-template-btn:active::before {
    width: 300px;
    height: 300px;
}

/* Loading spinner personalizado */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* Gradient text para títulos especiales */
.mg-gradient-text {
    background: linear-gradient(135deg, var(--vbs-blue), var(--vbs-instagram));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
 
 
 .mg-ai-section {
        background: linear-gradient(135deg, #4d6d80 0%, #6b8a9e 100%);
        margin: 60px 0;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 8px 30px rgba(77, 109, 128, 0.3);
        position: relative;
    }

    .mg-ai-section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="g" cx="50%" cy="50%" r="50%"><stop offset="0%" style="stop-color:rgba(255,255,255,0.1)"/><stop offset="100%" style="stop-color:rgba(255,255,255,0)"/></radialGradient></defs><circle cx="200" cy="200" r="100" fill="url(%23g)"/><circle cx="800" cy="400" r="150" fill="url(%23g)"/><circle cx="300" cy="800" r="120" fill="url(%23g)"/></svg>');
        pointer-events: none;
    }

    .ai-header {
        text-align: center;
        padding: 50px 40px 30px;
        color: white;
        position: relative;
        z-index: 2;
    }

    .ai-title-container h3 {
        font-size: 2.2rem;
        font-weight: 700;
        margin: 0 0 15px 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 15px;
    }

    .ai-title-container h3 i {
        font-size: 2rem;
        background: linear-gradient(45deg, #ffd700, #ffed4e);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .ai-subtitle {
        font-size: 1.1rem;
        opacity: 0.9;
        margin: 0;
        max-width: 600px;
        margin: 0 auto;
        line-height: 1.5;
    }

    .ai-content {
        background: white;
        margin: 0 40px 40px;
        border-radius: 16px;
        position: relative;
        z-index: 2;
    }

    /* AI Features Grid */
    .ai-features-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 25px;
        padding: 40px;
        border-bottom: 1px solid #f0f0f0;
    }

    .ai-feature {
        text-align: center;
        padding: 20px;
    }

    .ai-feature-icon {
        width: 60px;
        height: 60px;
        background: linear-gradient(135deg, #4d6d80, #6b8a9e);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto 15px;
    }

    .ai-feature-icon i {
        color: white;
        font-size: 1.5rem;
    }

    .ai-feature h4 {
        font-size: 1.1rem;
        color: #4d6d80;
        font-weight: 600;
        margin: 0 0 8px 0;
    }

    .ai-feature p {
        font-size: 0.9rem;
        color: #666;
        margin: 0;
        line-height: 1.4;
    }

    /* AI Generator */
    .ai-generator-container {
        padding: 40px;
    }

    .ai-generator-card {
        background: #f8f9fa;
        border-radius: 12px;
        padding: 30px;
        border: 1px solid #e9ecef;
    }

    .ai-generator-header {
        text-align: center;
        margin-bottom: 30px;
    }

    .ai-generator-header h4 {
        font-size: 1.4rem;
        color: #4d6d80;
        font-weight: 600;
        margin: 0 0 8px 0;
    }

    .ai-generator-header p {
        color: #666;
        margin: 0;
    }

    /* Form Groups */
    .ai-form-group {
        margin-bottom: 25px;
    }

    .ai-label {
        display: block;
        font-weight: 600;
        color: #4d6d80;
        margin-bottom: 10px;
        font-size: 0.95rem;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Base Selection */
    .ai-base-options {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }

    .ai-base-option {
        border: 2px solid #ddd;
        border-radius: 8px;
        padding: 15px;
        cursor: pointer;
        transition: all 0.3s ease;
        text-align: center;
        background: white;
    }

    .ai-base-option:hover {
        border-color: #4d6d80;
        transform: translateY(-2px);
    }

    .ai-base-option.selected {
        border-color: #4d6d80;
        background: rgba(77, 109, 128, 0.05);
    }

    .ai-base-thumb {
        width: 60px;
        height: 40px;
        object-fit: cover;
        border-radius: 4px;
        margin-bottom: 8px;
    }

    .ai-base-option span {
        display: block;
        font-size: 0.8rem;
        color: #666;
        font-weight: 500;
    }

    /* Upload Areas */
    .ai-upload-area {
        border: 2px dashed #ddd;
        border-radius: 8px;
        padding: 30px;
        text-align: center;
        transition: all 0.3s ease;
        background: white;
        position: relative;
    }

    .ai-upload-area:hover {
        border-color: #4d6d80;
        background: rgba(77, 109, 128, 0.02);
    }

    .ai-upload-area.dragover {
        border-color: #4d6d80;
        background: rgba(77, 109, 128, 0.05);
    }

    .ai-upload-content i {
        font-size: 2rem;
        color: #4d6d80;
        margin-bottom: 15px;
    }

    .ai-upload-content p {
        margin: 0 0 5px 0;
        color: #666;
    }

    .ai-upload-link {
        color: #4d6d80;
        font-weight: 600;
        cursor: pointer;
    }

    .ai-upload-content small {
        color: #999;
        font-size: 0.8rem;
    }

    /* Logo Preview */
    .ai-logo-preview {
        position: relative;
        max-width: 200px;
        margin: 0 auto;
    }

    .ai-logo-preview img {
        max-width: 100%;
        max-height: 100px;
        border-radius: 4px;
    }

    .ai-remove-logo {
        position: absolute;
        top: -10px;
        right: -10px;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: #dc3545;
        color: white;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Textarea */
    .ai-textarea {
        width: 100%;
        padding: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        font-size: 0.9rem;
        font-family: inherit;
        resize: vertical;
        transition: border-color 0.3s ease;
    }

    .ai-textarea:focus {
        outline: none;
        border-color: #4d6d80;
        box-shadow: 0 0 0 3px rgba(77, 109, 128, 0.1);
    }

    /* Example Tags */
    .ai-examples {
        margin-top: 10px;
    }

    .ai-examples small {
        color: #666;
        margin-bottom: 8px;
        display: block;
    }

    .ai-example-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .ai-example-tag {
        background: #e9ecef;
        color: #495057;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 0.75rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .ai-example-tag:hover {
        background: #4d6d80;
        color: white;
    }

    /* Generate Button */
    .ai-form-actions {
        text-align: center;
        margin-top: 30px;
        padding-top: 25px;
        border-top: 1px solid #eee;
    }

    .ai-generate-btn {
        background: linear-gradient(135deg, #4d6d80, #6b8a9e);
        color: white;
        border: none;
        padding: 15px 30px;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        min-width: 180px;
    }

    .ai-generate-btn:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(77, 109, 128, 0.4);
    }

    .ai-generate-btn:disabled {
        background: #ccc;
        cursor: not-allowed;
    }

    .ai-btn-text {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 1rem;
    }

    .ai-btn-cost {
        font-size: 0.75rem;
        opacity: 0.8;
    }

    .ai-disclaimer {
        margin: 15px 0 0 0;
        font-size: 0.8rem;
        color: #666;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
    }

    /* Loading State */
    .ai-loading {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.8);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10000;
    }

    .ai-loading-content {
        background: white;
        border-radius: 16px;
        padding: 40px;
        text-align: center;
        max-width: 400px;
        margin: 20px;
    }

    .ai-loading-spinner {
        width: 50px;
        height: 50px;
        border: 4px solid #f3f3f3;
        border-top: 4px solid #4d6d80;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin: 0 auto 20px;
    }

    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }

    .ai-loading-steps {
        margin-top: 20px;
    }

    .ai-step {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 8px;
        margin: 5px 0;
        border-radius: 4px;
        font-size: 0.9rem;
        color: #999;
        transition: all 0.3s ease;
    }

    .ai-step.active {
        background: rgba(77, 109, 128, 0.1);
        color: #4d6d80;
    }

    /* Responsive */
    @media (max-width: 768px) {
        .ai-content {
            margin: 0 20px 20px;
        }
        
        .ai-features-grid {
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            padding: 30px 20px;
        }
        
        .ai-generator-container {
            padding: 20px;
        }
        
        .ai-base-options {
            grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        }
    }
    .material-grafico-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 40px 20px;
    }

    /* Header */
    .mg-header {
        text-align: center;
        margin-bottom: 50px;
    }

    .mg-title {
        font-size: 2.5rem;
        color: #4d6d80;
        font-weight: 700;
        margin: 0 0 15px 0;
    }

    .mg-subtitle {
        font-size: 1.1rem;
        color: #666;
        margin: 0;
    }

    /* Grid */
    .mg-downloads-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 30px;
        margin-bottom: 60px;
    }

    /* Items */
    .mg-item {
        background: #ffffff;
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        overflow: hidden;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        border: 2px solid transparent;
    }

    .mg-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(77, 109, 128, 0.2);
        border-color: #4d6d80;
    }

    /* Image Preview Container */
    .mg-preview {
        height: 200px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f8f9fa;
        position: relative;
        overflow: hidden;
    }

    .mg-image-preview {
        position: relative;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        overflow: hidden;
    }

    /* Background variants for different logos */
    .mg-image-preview.dark-bg {
        background: linear-gradient(135deg, #2c3e50, #34495e);
    }

    .mg-image-preview.light-bg {
        background: #ffffff;
        border-bottom: 1px solid #eee;
    }

    .poster-preview {
        background: #f3f2f0;
    }

    .banner-horizontal-preview {
        background: linear-gradient(135deg, #4d6d80, #6b8a9e);
    }

    .banner-vertical-preview {
        background: linear-gradient(135deg, #4d6d80, #6b8a9e);
    }

    .signature-preview {
        background: #ffffff;
        border-bottom: 1px solid #eee;
    }

    /* Preview Images */
    .preview-image {
        max-width: 90%;
        max-height: 90%;
        object-fit: contain;
        transition: transform 0.3s ease;
        border-radius: 4px;
    }

    /* Specific image adjustments */
    .poster-image {
        max-height: 85%;
        max-width: 60%;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }

    .banner-horizontal {
        max-width: 85%;
        max-height: 40%;
        box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    }

    .banner-vertical {
        max-width: 35%;
        max-height: 85%;
        box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    }

    .signature-image {
        max-width: 80%;
        max-height: 70%;
        border: 1px solid #ddd;
        background: white;
    }

    /* Overlay effect */
    .preview-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(77, 109, 128, 0.9);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mg-image-preview:hover .preview-overlay {
        opacity: 1;
    }

    .mg-image-preview:hover .preview-image {
        transform: scale(1.05);
    }

    .preview-text {
        color: white;
        font-weight: 600;
        font-size: 0.9rem;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    /* Info Section */
    .mg-info {
        padding: 25px;
        text-align: center;
    }

    .mg-info h4 {
        font-size: 1.2rem;
        color: #4d6d80;
        font-weight: 600;
        margin: 0 0 8px 0;
    }

    .mg-info p {
        font-size: 0.9rem;
        color: #666;
        margin: 0 0 20px 0;
    }

    /* Download Button */
    .mg-download-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 12px 24px;
        background: #4d6d80;
        color: white;
        text-decoration: none;
        border-radius: 6px;
        font-weight: 600;
        font-size: 0.9rem;
        transition: all 0.3s ease;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .mg-download-btn:hover {
        background: #3c5a6a;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(77, 109, 128, 0.3);
    }

    .mg-download-btn:active {
        transform: translateY(0);
    }

    /* Instructions */
    .mg-instructions {
        background: linear-gradient(135deg, #f8f9fa, #ffffff);
        border-radius: 12px;
        padding: 35px;
        border-left: 4px solid #4d6d80;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }

    .mg-instructions h3 {
        color: #4d6d80;
        font-size: 1.4rem;
        font-weight: 600;
        margin: 0 0 25px 0;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

    .mg-tips {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }

    .mg-tip {
        display: flex;
        align-items: flex-start;
        gap: 15px;
        padding: 20px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        transition: transform 0.2s ease;
    }

    .mg-tip:hover {
        transform: translateY(-2px);
    }

    .mg-tip i {
        color: #4d6d80;
        font-size: 1.2rem;
        flex-shrink: 0;
        margin-top: 2px;
    }

    .mg-tip span {
        font-size: 0.95rem;
        color: #555;
        line-height: 1.5;
    }

    /* Responsive */
    @media (max-width: 768px) {
        .material-grafico-container {
            padding: 30px 15px;
        }
        
        .mg-title {
            font-size: 2rem;
        }
        
        .mg-downloads-grid {
            grid-template-columns: 1fr;
            gap: 25px;
        }
        
        .mg-tips {
            grid-template-columns: 1fr;
            gap: 15px;
        }

        .mg-preview {
            height: 180px;
        }
    }

    @media (max-width: 480px) {
        .mg-title {
            font-size: 1.8rem;
        }
        
        .mg-info {
            padding: 20px;
        }
        
        .mg-instructions {
            padding: 25px;
        }
    }
    
    /* Galería de productos */
.ai-product-gallery {
    margin-top: 15px;
    display: none;
    flex-wrap: wrap;
    gap: 10px;
}

.ai-product-preview {
    position: relative;
    display: inline-block;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #ddd;
    background: #f8f9fa;
}

.ai-product-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-remove-product {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ai-remove-product:hover {
    background: #c82333;
}