/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Prevenir parpadeo en móviles */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Permitir selección de texto solo donde sea necesario */
p, span, .producto-descripcion, .hero-content p {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

:root {
    --primary-color: #d4b896;
    --secondary-color: #8b6f47;
    --accent-color: #f4e6d7;
    --text-dark: #2c2c2c;
    --text-light: #6b6b6b;
    --background-light: #faf8f5;
    --white: #ffffff;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--background-light);
    scroll-behavior: smooth;
}

/* Header */
header {
    background: var(--white);
    box-shadow: 0 2px 20px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.logo i {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.logo h1 {
    color: var(--secondary-color);
    font-size: 2.2em;
    margin-bottom: 5px;
    font-weight: bold;
    letter-spacing: 1px;
}

.subtitle {
    color: var(--text-light);
    font-style: italic;
    font-size: 0.9em;
}

nav {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 12px 25px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--secondary-color);
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-hover);
}

.nav-btn.active {
    background: var(--secondary-color);
    color: var(--white);
    border-color: var(--secondary-color);
}

.admin-btn {
    border-color: var(--warning);
    color: var(--warning);
}

.admin-btn:hover {
    background: var(--warning);
    color: var(--white);
}

/* Secciones */
.section {
    display: none;
    min-height: 80vh;
}

.section.active {
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--background-light) 100%);
    padding: 80px 20px;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
}

.hero-content h2 {
    font-size: 3.5em;
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-weight: bold;
}

.hero-content p {
    font-size: 1.3em;
    color: var(--text-light);
    margin-bottom: 30px;
    line-height: 1.8;
}

.btn-hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border: none;
    padding: 18px 40px;
    font-size: 1.2em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.btn-hero:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-hover);
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.feature {
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 20px var(--shadow);
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature i {
    font-size: 3em;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.feature h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.feature p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.8em;
    color: var(--secondary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.section-header p {
    font-size: 1.2em;
    color: var(--text-light);
    font-style: italic;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 10px 25px;
    border: 2px solid var(--primary-color);
    background: var(--white);
    color: var(--secondary-color);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: var(--white);
}

/* Productos Grid */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.producto-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px var(--shadow);
    transition: all 0.3s ease;
    position: relative;
}

.producto-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px var(--shadow-hover);
}

.producto-card .producto-images {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
}

.producto-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    image-rendering: optimizeQuality;
    image-rendering: -webkit-optimize-contrast;
}

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

.producto-category {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
}

.producto-info {
    padding: 25px;
}

.producto-info h3 {
    color: var(--secondary-color);
    margin-bottom: 12px;
    font-size: 1.4em;
    font-weight: bold;
}

.producto-info p {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.producto-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.producto-precio {
    font-size: 1.6em;
    color: var(--secondary-color);
    font-weight: bold;
}

.producto-tiempo {
    color: var(--text-light);
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-pedir {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-pedir:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow-hover);
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text h2 {
    font-size: 2.5em;
    color: var(--secondary-color);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.about-text p {
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.skills {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.skill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 3px 10px var(--shadow);
}

.skill i {
    font-size: 1.5em;
    color: var(--primary-color);
}

.skill span {
    color: var(--secondary-color);
    font-weight: 600;
}

.about-image {
    text-align: center;
}

.profile-image-container {
    position: relative;
    display: inline-block;
}

.profile-image-container img {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--primary-color);
    box-shadow: 0 10px 30px var(--shadow);
}

.image-placeholder {
    width: 300px;
    height: 300px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border: 5px solid var(--primary-color);
}

.image-placeholder i {
    font-size: 5em;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.image-placeholder p {
    color: var(--text-light);
    font-style: italic;
}

/* Perfil Admin Section */
.perfil-section h3 {
    color: var(--secondary-color);
    margin-bottom: 30px;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.perfil-form {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.form-section {
    background: var(--background-light);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid var(--accent-color);
}

.form-section h4 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 10px;
}

.photo-upload-area {
    display: flex;
    gap: 30px;
    align-items: center;
}

.current-photo {
    position: relative;
}

.current-photo img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.photo-placeholder {
    width: 150px;
    height: 150px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px dashed var(--primary-color);
}

.photo-placeholder i {
    font-size: 3em;
    color: var(--text-light);
    margin-bottom: 10px;
}

.photo-placeholder p {
    color: var(--text-light);
    font-size: 0.9em;
}

.photo-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-upload-photo {
    padding: 12px 25px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-upload-photo:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

.btn-remove-photo {
    padding: 10px 20px;
    background: var(--danger);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-remove-photo:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.btn-save-profile {
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--success), #2ecc71);
    color: var(--white);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.btn-save-profile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow-hover);
}

/* Admin Panel */
.admin-header {
    text-align: center;
    margin-bottom: 40px;
}

.admin-header h2 {
    font-size: 2.5em;
    color: var(--secondary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.admin-header p {
    color: var(--text-light);
    font-size: 1.1em;
    font-style: italic;
}

.admin-login {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-card i {
    font-size: 3em;
    color: var(--warning);
    margin-bottom: 20px;
}

.login-card h3 {
    color: var(--secondary-color);
    margin-bottom: 25px;
    font-size: 1.5em;
}

.login-card input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    font-size: 16px;
    margin-bottom: 20px;
    font-family: inherit;
}

.login-card button {
    width: 100%;
    padding: 15px;
    background: var(--warning);
    color: var(--white);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.admin-panel {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow);
    overflow: hidden;
}

.admin-tabs {
    display: flex;
    background: var(--accent-color);
    border-bottom: 2px solid var(--primary-color);
}

.tab-btn {
    flex: 1;
    padding: 20px;
    border: none;
    background: transparent;
    color: var(--secondary-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

.tab-btn.active {
    background: var(--secondary-color);
    color: var(--white);
}

.tab-content {
    display: none;
    padding: 40px;
}

.tab-content.active {
    display: block;
}

/* Upload Form */
.upload-form h3 {
    color: var(--secondary-color);
    margin-bottom: 30px;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 12px;
}

#uploadForm {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: var(--secondary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 15px;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group small {
    color: var(--text-light);
    font-size: 0.9em;
}

#uploadForm button {
    padding: 18px;
    background: linear-gradient(135deg, var(--success), #2ecc71);
    color: var(--white);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

#uploadForm button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow-hover);
}

/* Admin Lists */
.productos-admin h3 {
    color: var(--secondary-color);
    margin-bottom: 25px;
    font-size: 1.6em;
    display: flex;
    align-items: center;
    gap: 12px;
}

#productosAdminList,
#pedidosList {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.producto-admin-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border: 2px solid var(--accent-color);
    border-radius: 15px;
    transition: all 0.3s ease;
}

.producto-admin-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px var(--shadow);
}

.producto-admin-item img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 12px;
    background: var(--background);
}

.producto-admin-info {
    flex: 1;
}

.producto-admin-info strong {
    color: var(--secondary-color);
    font-size: 1.2em;
}

.producto-admin-info small {
    color: var(--text-light);
    line-height: 1.5;
}

.btn-eliminar {
    padding: 10px 20px;
    background: var(--danger);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-eliminar:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* Pedidos */
.pedidos-section h3 {
    color: var(--secondary-color);
    margin-bottom: 25px;
    font-size: 1.6em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pedidos-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--accent-color);
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 2px solid var(--primary-color);
}

.stat-card i {
    font-size: 2.5em;
    color: var(--secondary-color);
}

.stat-card span {
    font-size: 2em;
    font-weight: bold;
    color: var(--secondary-color);
}

.stat-card small {
    color: var(--text-light);
    font-size: 0.9em;
}

.pedido-item {
    padding: 25px;
    border: 2px solid var(--accent-color);
    border-radius: 15px;
    background: var(--background-light);
}

.pedido-info {
    margin-bottom: 20px;
    line-height: 1.8;
}

.pedido-info strong {
    color: var(--secondary-color);
}

.btn-completar {
    padding: 10px 25px;
    background: var(--success);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-completar:hover {
    background: #229954;
    transform: translateY(-1px);
}

/* Estadísticas */
.estadisticas h3 {
    color: var(--secondary-color);
    margin-bottom: 30px;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: var(--white);
    margin: 2% auto;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: var(--accent-color);
    padding: 25px;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--secondary-color);
    font-size: 1.8em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.close {
    color: var(--text-light);
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--secondary-color);
}

.producto-pedido {
    padding: 25px;
    background: var(--background-light);
    border-bottom: 1px solid var(--primary-color);
}

#formPedido {
    padding: 30px;
}

.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 10px;
}

.modal-footer {
    text-align: center;
    margin-top: 30px;
}

.btn-enviar {
    padding: 18px 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-enviar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow-hover);
}

.footer-note {
    margin-top: 15px;
    color: var(--text-light);
    font-style: italic;
    font-size: 0.9em;
}

/* Footer */
footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 50px 20px 20px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section p {
    line-height: 1.6;
    margin-bottom: 10px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: var(--white);
    font-size: 1.5em;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 40px;
    border-top: 1px solid var(--primary-color);
    color: var(--accent-color);
}

.empty-message {
    text-align: center;
    padding: 60px;
    color: var(--text-light);
    font-size: 1.2em;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .nav-btn {
        padding: 10px 20px;
        font-size: 12px;
    }
    
    .hero-content h2 {
        font-size: 2.5em;
    }
    
    .hero-features {
        grid-template-columns: 1fr;
    }
    
    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .skills {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1 1 50%;
        min-width: 150px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .producto-admin-item {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 2em;
    }
    
    .productos-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-btn {
        flex: 1 1 100%;
        font-size: 12px;
        padding: 15px;
    }
}

/* Modal visor de imágenes */
.modal-imagen {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    /* Eliminar animaciones que pueden causar parpadeo */
    /* animation: fadeIn 0.3s ease; */
    /* Simplificar optimizaciones */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.modal-imagen-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.close-imagen {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s ease;
    user-select: none;
}

.close-imagen:hover {
    color: var(--primary-color);
}

.imagen-container {
    position: relative;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.imagen-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    cursor: zoom-in;
    user-select: none;
    /* Eliminar transiciones que causan parpadeo en móvil */
    /* transition: transform 0.3s ease; */
    /* Optimizaciones para mejor rendimiento */
    will-change: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* Suavizado de bordes */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Indicador visual de swipe en móviles */
@media (max-width: 768px) {
    .imagen-container {
        position: relative;
    }
    
    .imagen-container.multiple-images::before {
        content: '👈 Desliza 👉';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 6px 16px;
        border-radius: 25px;
        font-size: 0.75em;
        z-index: 20;
        opacity: 0;
        animation: showSwipeHint 4s ease-in-out;
        pointer-events: none;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        font-weight: 500;
    }
    
    .imagen-container img {
        cursor: grab;
        touch-action: pan-x;
        transition: all 0.3s ease;
    }
    
    .imagen-container img:active {
        cursor: grabbing;
    }
}

@keyframes showSwipeHint {
    0% { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-15px) scale(0.8); 
    }
    10% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0) scale(1); 
    }
    90% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(0) scale(1); 
    }
    100% { 
        opacity: 0; 
        transform: translateX(-50%) translateY(-15px) scale(0.8); 
    }
}

.imagen-container img:hover {
    transform: scale(1.02);
}

.imagen-navegacion {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

.imagen-dots {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

.imagen-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.imagen-dot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(212, 184, 150, 0.8), rgba(139, 111, 71, 0.8));
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.imagen-dot:hover {
    transform: scale(1.2);
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 15px rgba(212, 184, 150, 0.6);
}

.imagen-dot.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.3);
    box-shadow: 0 0 20px rgba(212, 184, 150, 0.8);
}

.imagen-dot.active::before {
    transform: scale(1);
}

/* Efecto de pulso para el dot activo */
@keyframes pulseDot {
    0% { box-shadow: 0 0 20px rgba(212, 184, 150, 0.8); }
    50% { box-shadow: 0 0 30px rgba(212, 184, 150, 1), 0 0 0 8px rgba(212, 184, 150, 0.1); }
    100% { box-shadow: 0 0 20px rgba(212, 184, 150, 0.8); }
}

.imagen-dot.active {
    animation: pulseDot 2s infinite;
}

.imagen-info {
    margin-top: 30px;
    text-align: center;
    color: white;
    max-width: 600px;
}

.imagen-info h3 {
    font-size: 1.8em;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.imagen-info p {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 15px;
    opacity: 0.9;
}

.imagen-contador {
    position: static;
    background: rgba(212, 184, 150, 0.2);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: bold;
    margin-top: 10px;
    display: inline-block;
    border: 1px solid rgba(212, 184, 150, 0.3);
}

.imagen-contador {
    font-size: 1em;
    opacity: 0.7;
    font-weight: 500;
}

/* Hacer las imágenes de productos clickeables */
.producto-card .producto-images {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.producto-card .producto-images::after {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2em;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.producto-card .producto-images:hover::after {
    opacity: 1;
}

/* Responsive para dispositivos móviles */
@media (max-width: 768px) {
    .modal-imagen-content {
        padding: 10px 5px;
        justify-content: flex-start;
        gap: 10px;
    }
    
    .close-imagen {
        top: 10px;
        right: 15px;
        font-size: 30px;
        background: rgba(0, 0, 0, 0.7);
        border-radius: 50%;
        width: 45px;
        height: 45px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .imagen-container {
        max-width: 98vw;
        max-height: 70vh;
        margin: 0;
        flex-shrink: 0;
    }
    
    .imagen-container img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
        border-radius: 8px;
    }
    
    .imagen-navegacion {
        bottom: 15px;
    }
    
    .imagen-dots {
        gap: 10px;
    }
    
    .imagen-dot {
        width: 10px;
        height: 10px;
        border-width: 1.5px;
    }
    
    .imagen-dot:hover {
        transform: scale(1.3);
    }
    
    .imagen-dot.active {
        transform: scale(1.4);
    }
    
    .imagen-info {
        position: static;
        margin-top: 20px;
        margin-bottom: 20px;
        padding: 15px;
        background: rgba(0, 0, 0, 0.8);
        border-radius: 12px;
        max-width: 90%;
        margin-left: auto;
        margin-right: auto;
        backdrop-filter: blur(15px);
        border: 1px solid rgba(255, 255, 255, 0.15);
        text-align: center;
    }
    
    .imagen-info h3 {
        font-size: 1.2em;
        margin-bottom: 5px;
        color: white;
    }
    
    .imagen-info p {
        font-size: 0.9em;
        color: #cccccc;
        line-height: 1.4;
    }
}

/* Optimizaciones específicas para móviles en orientación horizontal */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-imagen-content {
        padding: 5px;
        justify-content: flex-start;
        gap: 8px;
    }
    
    .imagen-container {
        max-width: 98vw;
        max-height: 65vh;
        flex-shrink: 0;
    }
    
    .imagen-info {
        position: static;
        margin-top: 15px;
        margin-bottom: 15px;
        padding: 10px;
        background: rgba(0, 0, 0, 0.9);
        border-radius: 8px;
        max-width: 85%;
        margin-left: auto;
        margin-right: auto;
        backdrop-filter: blur(15px);
        border: 1px solid rgba(255, 255, 255, 0.15);
        text-align: center;
    }
    
    .imagen-navegacion {
        bottom: 10px;
    }
    
    .imagen-dots {
        gap: 8px;
    }
    
    .imagen-dot {
        width: 8px;
        height: 8px;
    }
    
    .close-imagen {
        top: 5px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
}

/* Animaciones suaves para toda la página */

/* Animación de aparición gradual */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Aplicar animaciones a elementos específicos */
.hero-content h2 {
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-content p {
    animation: fadeInUp 1s ease-out 0.4s both;
}

.btn-hero {
    animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-features .feature {
    animation: fadeInUp 0.8s ease-out both;
}

.hero-features .feature:nth-child(1) {
    animation-delay: 0.3s;
}

.hero-features .feature:nth-child(2) {
    animation-delay: 0.5s;
}

.hero-features .feature:nth-child(3) {
    animation-delay: 0.7s;
}

/* Animaciones para productos */
.producto-card {
    animation: fadeInUp 0.6s ease-out both;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.producto-card:nth-child(1) { animation-delay: 0.1s; }
.producto-card:nth-child(2) { animation-delay: 0.2s; }
.producto-card:nth-child(3) { animation-delay: 0.3s; }
.producto-card:nth-child(4) { animation-delay: 0.4s; }
.producto-card:nth-child(5) { animation-delay: 0.5s; }
.producto-card:nth-child(6) { animation-delay: 0.6s; }

/* Mejorar efectos hover existentes */
.producto-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 50px var(--shadow-hover);
}

.nav-btn {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-btn:hover {
    transform: translateY(-3px) scale(1.05);
}

/* Animaciones para las habilidades */
.skill {
    animation: fadeInLeft 0.8s ease-out both;
    transition: transform 0.3s ease;
}

.skill:nth-child(1) { animation-delay: 0.2s; }
.skill:nth-child(2) { animation-delay: 0.4s; }
.skill:nth-child(3) { animation-delay: 0.6s; }
.skill:nth-child(4) { animation-delay: 0.8s; }

.skill:hover {
    transform: translateX(10px) scale(1.05);
}

.skill i {
    transition: all 0.3s ease;
}

.skill:hover i {
    color: var(--primary-color);
    transform: rotate(10deg) scale(1.2);
}

/* Animación para los filtros */
.filter-btn {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow);
}

/* Animaciones para estadísticas */
.stat-card {
    animation: fadeInUp 0.8s ease-out both;
    transition: transform 0.3s ease;
}

.stat-card:nth-child(1) { animation-delay: 0.2s; }
.stat-card:nth-child(2) { animation-delay: 0.4s; }
.stat-card:nth-child(3) { animation-delay: 0.6s; }

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    transition: all 0.3s ease;
}

.stat-card:hover i {
    animation: pulse 1s infinite;
}

/* Animación sutil para el header */
.header-content h1 {
    animation: fadeInUp 1s ease-out 0.1s both;
}

.header-content .subtitle {
    animation: fadeInUp 1s ease-out 0.3s both;
}

/* Animación para botones al cargar la página */
nav {
    animation: fadeInUp 1s ease-out 0.5s both;
}

/* Efecto de carga suave para imágenes */
img {
    transition: opacity 0.3s ease;
}

img:not([src]) {
    opacity: 0;
}

/* Animación para los iconos de FontAwesome */
.fas, .fab {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Animación para formularios */
.form-group {
    animation: fadeInUp 0.6s ease-out both;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }

/* Reducir movimiento para usuarios que prefieren menos animación */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Optimizaciones para móviles - Prevenir parpadeo */
@media (max-width: 768px) {
    /* Desactivar animaciones al cargar para prevenir flasheo */
    body:not(.animations-ready) * {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
    
    /* Una vez que las animaciones están listas, usar versiones reducidas */
    body.animations-ready *, 
    body.animations-ready *::before, 
    body.animations-ready *::after {
        animation-duration: 0.2s !important;
        animation-delay: 0s !important;
        transition-duration: 0.15s !important;
    }
    
    /* Forzar aceleración de hardware para prevenir parpadeo */
    .section, .product-card, .feature, .btn {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-perspective: 1000px;
        perspective: 1000px;
    }
    
    /* Deshabilitar hover effects en móviles */
    .nav-btn:hover,
    .btn-hero:hover,
    .product-card:hover,
    .feature:hover,
    .btn:hover,
    .admin-btn:hover {
        transform: none !important;
        background: inherit !important;
        color: inherit !important;
    }
    
    /* Optimizar smooth scroll */
    html {
        scroll-behavior: auto;
    }
}

/* Optimizaciones adicionales para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    /* Deshabilitar transiciones hover en dispositivos táctiles */
    .nav-btn, .btn-hero, .product-card, .feature, .btn, .admin-btn {
        transition: none !important;
    }
    
    /* Prevenir efectos de hover en pantallas táctiles */
    .nav-btn:hover,
    .btn-hero:hover,
    .product-card:hover,
    .feature:hover,
    .btn:hover,
    .admin-btn:hover {
        transform: none !important;
        background: var(--primary-color) !important;
        color: var(--white) !important;
    }
}

/* Optimizaciones adicionales para prevenir flasheo */
@media (max-width: 768px) {
    /* Optimizar carga de imágenes */
    img {
        content-visibility: auto;
        contain-intrinsic-size: 300px 200px;
    }
    
    /* Prevenir reflows durante la carga */
    .producto-card {
        contain: layout style paint;
        will-change: auto;
    }
    
    /* Optimizaciones específicas para la sección de productos */
    #productosGrid {
        contain: layout;
    }
    
    /* Reservar espacio para las imágenes de productos para evitar reflow */
    .producto-card .producto-images {
        min-height: 200px;
        background: var(--accent-color);
    }
    
    .producto-card img {
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .producto-card img[src] {
        opacity: 1;
    }
    
    /* Forzar compositing en elementos que se animan */
    .section, .hero, .product-card {
        will-change: auto;
        contain: layout;
    }
    
    /* Deshabilitar animaciones automáticas de productos en móviles */
    .producto-card:nth-child(1),
    .producto-card:nth-child(2),
    .producto-card:nth-child(3),
    .producto-card:nth-child(4),
    .producto-card:nth-child(5),
    .producto-card:nth-child(6) {
        animation: none !important;
    }
}
