:root {
    --facebook-blue: #1877f2;
    --whatsapp-green: #25d366;
    --google-red: #db4437;
}

/* Reset y globales */
* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

body {
    padding: 0;
}

/* Header responsivo */
header {
    background: linear-gradient(135deg, #09418b, #268bc1);
    color: white;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0.5rem 0;
    font-size: 1.8rem;
}

header p {
    margin: 0.5rem 0;
    font-size: 1rem;
    opacity: 0.9;
}

.logo img {
    width: 80px;
    height: auto;
    margin-bottom: 0.5rem;
}

/* Contenedor principal */
.container {
    width: 95%;
    max-width: 1200px;
    margin: 1rem auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* Sección social */
.social-section {
    padding: 1.5rem;
    background: #f9f9f9;
    text-align: center;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.social-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    text-align: center;
}

.social-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.social-button i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.facebook-btn {
    background-color: var(--facebook-blue);
}

.whatsapp-btn {
    background-color: var(--whatsapp-green);
}

/* Secciones de contenido */
.content-section {
    padding: 1.5rem;
}

.section-title {
    color: var(--facebook-blue);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
    font-size: 1.4rem;
    text-align: center;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--facebook-blue);
}

/* Grid de videos responsivo */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    justify-items: center;
    margin: 1.5rem 0;
}

.video-grid iframe {
    width: 100%;
    max-width: 300px;
    height: 169px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Mapa responsivo */
.map-container {
    margin: 2rem 0;
    width: 100%;
    overflow: hidden;
}

.map-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.map-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Estilos para formularios */
.form-section {
    padding: 1.5rem;
}

.warranty-form {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #09418b;
    font-size: 1rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus {
    border-color: #268bc1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(38, 139, 193, 0.2);
}

.form-group input::placeholder {
    color: #aaa;
}

.submit-button {
    background-color: #09418b;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
    margin-top: 1rem;
}

.submit-button:hover {
    background-color: #0d4da0;
}

.submit-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Resultados */
.result-section {
    margin-top: 2rem;
    padding: 0 1rem;
}

.results-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.results-header h3 {
    color: #09418b;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.results-header .results-count {
    color: #666;
    font-size: 0.9rem;
}

.sales-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sale-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
}

.sale-item:hover {
    transform: translateY(-2px);
}

.sale-info {
    flex: 1;
}

.sale-date {
    display: block;
    font-weight: 600;
    color: #09418b;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.sale-date i, .sale-id i {
    margin-right: 0.3rem;
    color: #268bc1;
}

.sale-id {
    font-size: 0.85rem;
    color: #666;
}

.btn-print {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.btn-print:hover {
    background-color: #218838;
}

/* Mensajes de estado */
.error-message, .no-results {
    text-align: center;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.error-message {
    background: #fff8f8;
    border-left: 4px solid #d9534f;
}

.error-message i {
    color: #d9534f;
    margin-bottom: 0.8rem;
    font-size: 1.5rem;
}

.error-message p {
    color: #d9534f;
    font-weight: 600;
    margin: 0.3rem 0;
}

.no-results {
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
}

.no-results i {
    color: #6c757d;
    margin-bottom: 0.8rem;
    font-size: 1.5rem;
}

.no-results p {
    color: #333;
    font-weight: 600;
    margin: 0.3rem 0;
}

.no-results small {
    color: #6c757d;
    font-size: 0.8rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: 0.9rem;
    background: #f5f5f5;
    margin-top: 2rem;
    color: #666;
}

/* ============ MEDIA QUERIES PARA MÓVILES ============ */

/* Tablets y pantallas medianas */
@media (max-width: 992px) {
    .container {
        width: 98%;
        margin: 0.5rem auto;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 0.8rem;
    }
    
    .social-buttons {
        gap: 0.8rem;
    }
}

/* Móviles grandes */
@media (max-width: 768px) {
    header {
        padding: 1rem 0.5rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    header p {
        font-size: 0.9rem;
    }
    
    .logo img {
        width: 70px;
    }
    
    .container {
        width: 98%;
        margin: 0.5rem auto;
        border-radius: 8px;
    }
    
    .content-section, .social-section, .form-section {
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1rem 0;
    }
    
    .video-grid iframe {
        width: 100%;
        max-width: none;
        height: 200px;
    }
    
    .social-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .social-button {
        width: 100%;
        max-width: 250px;
        justify-content: center;
        padding: 0.8rem 1rem;
    }
    
    .sale-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
        padding: 1rem;
    }
    
    .btn-print {
        align-self: stretch;
        justify-content: center;
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .warranty-form {
        padding: 1rem;
    }
    
    .map-wrapper {
        padding-bottom: 75%; /* Más alto en móviles */
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    header {
        padding: 0.8rem 0.5rem;
    }
    
    header h1 {
        font-size: 1.3rem;
        margin: 0.3rem 0;
    }
    
    header p {
        font-size: 0.8rem;
    }
    
    .logo img {
        width: 60px;
    }
    
    .container {
        width: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    .content-section, .social-section, .form-section {
        padding: 0.8rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .video-grid iframe {
        height: 180px;
    }
    
    .social-button {
        padding: 0.7rem;
        font-size: 0.9rem;
        min-width: auto;
    }
    
    .social-button i {
        font-size: 1rem;
    }
    
    .warranty-form {
        padding: 0.8rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group input {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    .submit-button {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    .sale-item {
        padding: 0.8rem;
    }
    
    .sale-date {
        font-size: 0.9rem;
    }
    
    .sale-id {
        font-size: 0.8rem;
    }
    
    .btn-print {
        padding: 0.7rem;
        font-size: 0.8rem;
    }
    
    footer {
        padding: 1rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .map-wrapper {
        padding-bottom: 80%;
    }
}

/* Móviles muy pequeños */
@media (max-width: 360px) {
    .logo img {
        width: 50px;
    }
    
    header h1 {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    .video-grid iframe {
        height: 160px;
    }
    
    .content-section, .social-section, .form-section {
        padding: 0.6rem;
    }
    
    .social-button {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
    
    .warranty-form {
        padding: 0.6rem;
    }
}

/* Orientación horizontal en móviles */
@media (max-width: 768px) and (orientation: landscape) {
    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .video-grid iframe {
        height: 150px;
    }
    
    .map-wrapper {
        padding-bottom: 50%;
    }
}

/* Sección de verificación */
.verification-section {
    padding: 1.5rem;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin: 1.5rem 0;
}

.verification-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.verification-header h3 {
    color: #09418b;
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.verification-header p {
    color: #666;
    font-size: 0.9rem;
}

.verification-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.code-input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s;
    text-align: center;
}

.code-input:focus {
    border-color: #268bc1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(38, 139, 193, 0.2);
}

.verification-buttons {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.verify-button {
    background-color: #09418b;
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
}

.verify-button:hover {
    background-color: #0d4da0;
}

.resend-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    transition: background 0.3s;
    opacity: 0.7;
    cursor: not-allowed;
}

.resend-button:hover {
    background-color: #218838;
}

/* Mensajes de éxito y error en verificación */
.success-message, .error-message {
    display: none;
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.success-message {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.success-message i {
    color: #28a745;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.success-message p {
    color: #155724;
    font-weight: 600;
    margin: 0.3rem 0;
}

.error-message {
    background: #fff8f8;
    border-left: 4px solid #d9534f;
}

.error-message i {
    color: #d9534f;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.error-message p {
    color: #d9534f;
    font-weight: 600;
    margin: 0.3rem 0;
}

.btn-retry {
    background: transparent;
    border: none;
    color: #09418b;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    transition: color 0.3s;
}

.btn-retry:hover {
    color: #0d4da0;
}

/* ============ MEDIA QUERIES PARA VERIFICACIÓN ============ */
@media (max-width: 768px) {
    .verification-section {
        padding: 1rem;
    }
    
    .verification-header h3 {
        font-size: 1.3rem;
    }
    
    .verification-header p {
        font-size: 0.8rem;
    }
    
    .code-input {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    .verify-button, .resend-button {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    .success-message, .error-message {
        padding: 0.8rem;
    }
}

@media (max-width: 480px) {
    .verification-section {
        padding: 0.8rem;
    }
    
    .verification-header h3 {
        font-size: 1.2rem;
    }
    
    .verification-header p {
        font-size: 0.7rem;
    }
    
    .code-input {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
    
    .verify-button, .resend-button {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
    
    .success-message, .error-message {
        padding: 0.7rem;
    }
}