/**
 * BMW Creator - Main Stylesheet
 * Colores BMW M Performance
 */

:root {
    /* Colores BMW M */
    --bmw-blue: #1C69D4;
    --bmw-m-blue: #00A8FF;
    --bmw-m-red: #E4002B;
    --bmw-m-violet: #6C1D5F;
    --bmw-black: #000000;
    --bmw-white: #FFFFFF;
    --bmw-gray: #F5F5F5;
    --bmw-dark-gray: #333333;

    /* Degradados M */
    --gradient-m: linear-gradient(135deg, var(--bmw-m-blue) 0%, var(--bmw-m-violet) 50%, var(--bmw-m-red) 100%);
    --gradient-dark: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 100%);

    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);

    /* Transiciones */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'BMW Helvetica', Arial, sans-serif;
    background: var(--bmw-black);
    color: var(--bmw-white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* HEADER */
.header {
    background: var(--bmw-black);
    padding: 1.5rem 0;
    border-bottom: 3px solid;
    border-image: var(--gradient-m) 1;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.container {
    /*max-width: 1400px;*/
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-m);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

/* HERO SECTION */
.hero {
    background: linear-gradient(135deg, rgba(0,168,255,0.1) 0%, rgba(108,29,95,0.1) 100%);
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h100v100H0z" fill="none"/><path d="M50 0v100M0 50h100" stroke="%23ffffff" stroke-width="0.5" opacity="0.05"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero h1 span {
    background: var(--gradient-m);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.3rem;
    color: var(--bmw-gray);
    margin-bottom: 2rem;
}

/* UPLOAD SECTION */
.upload-section {
    background: var(--bmw-dark-gray);
    padding: 3rem 2rem;
    margin: 0;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
}

.upload-area {
    border: 3px dashed var(--bmw-m-blue);
    border-radius: 15px;
    padding: 3rem;
    text-align: center;
    background: rgba(0,168,255,0.05);
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
}

.upload-area:hover {
    border-color: var(--bmw-m-red);
    background: rgba(228,0,43,0.05);
    transform: translateY(-5px);
}

.upload-area.dragover {
    border-color: var(--bmw-m-violet);
    background: rgba(108,29,95,0.1);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

#imageInput {
    display: none;
}

.preview-container {
    margin-top: 2rem;
    display: none;
}

.preview-container.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

#imagePreview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
}

/* THEMES SELECTOR */
.themes-section {
    margin: 3rem 0;
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.theme-card {
    background: var(--bmw-dark-gray);
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.theme-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-m);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 0;
}

.theme-card:hover::before {
    left: 0;
    opacity: 0.1;
}

.theme-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.theme-card.selected {
    border-color: var(--bmw-m-blue);
    background: rgba(0,168,255,0.1);
    box-shadow: 0 0 20px rgba(0,168,255,0.3);
}

.theme-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.theme-name {
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* BUTTONS */
.btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.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;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-m);
    color: var(--bmw-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-3px);
}

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

.btn-secondary {
    background: var(--bmw-dark-gray);
    color: var(--bmw-white);
    border: 2px solid var(--bmw-m-blue);
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    background: rgba(0,168,255,0.1);
    box-shadow: var(--shadow-xl);
    transform: translateY(-3px);
}

/* GALLERY */
.gallery-section {
    padding: 4rem 0;
}

.gallery-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.8rem 1.5rem;
    background: var(--bmw-dark-gray);
    border: 2px solid transparent;
    border-radius: 30px;
    color: var(--bmw-white);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-weight: 600;
}

.filter-btn:hover {
    border-color: var(--bmw-m-blue);
}

.filter-btn.active {
    background: var(--gradient-m);
    border-color: transparent;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.design-card {
    background: var(--bmw-dark-gray);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.design-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.design-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    cursor: pointer;
    transition: transform var(--transition-normal);
}

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

.design-info {
    padding: 1.5rem;
}

.design-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.design-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    color: var(--bmw-gray);
    font-size: 0.9rem;
}

.design-theme {
    background: var(--gradient-m);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.like-btn {
    background: transparent;
    border: none;
    color: var(--bmw-white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.like-btn:hover {
    transform: scale(1.2);
}

.like-btn.liked {
    color: var(--bmw-m-red);
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    animation: fadeInOverlay 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.modal.active {
    display: flex;
}

/* Animación del overlay */
@keyframes fadeInOverlay {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

/* Prevenir scroll del body cuando modal está activo */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
    left: 0;
    right: 0;
    /* Mejorar comportamiento en iOS */
    -webkit-overflow-scrolling: auto;
    touch-action: none;
}

.modal-content {
    background: var(--bmw-dark-gray);
    border-radius: 20px;
    padding: 3rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    margin: auto;
    animation: slideUp 0.4s ease;
    /* Permitir scroll dentro del modal en móvil */
    touch-action: pan-y;
    overscroll-behavior: contain;
    /* Sombra pronunciada para destacar sobre el fondo oscuro */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 8px 24px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--bmw-white);
    font-size: 2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--bmw-m-red);
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--bmw-m-blue);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--bmw-dark-gray);
    border-radius: 10px;
    background: var(--bmw-black);
    color: var(--bmw-white);
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--bmw-m-blue);
    box-shadow: 0 0 10px rgba(0,168,255,0.3);
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.checkbox-group input[type="checkbox"] {
    /* Checkbox personalizado más grande */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border: 2px solid var(--bmw-m-blue);
    border-radius: 5px;
    background: transparent;
    cursor: pointer;
    position: relative;
    margin-top: 0.1rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.checkbox-group input[type="checkbox"]:hover {
    border-color: var(--bmw-m-blue);
    background: rgba(0, 168, 255, 0.1);
    transform: scale(1.05);
}

.checkbox-group input[type="checkbox"]:checked {
    background: var(--bmw-m-blue);
    border-color: var(--bmw-m-blue);
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.checkbox-group input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.3);
}

.checkbox-group label {
    cursor: pointer;
    line-height: 1.7;
    user-select: none;
    color: var(--bmw-white);
    flex: 1;
}

.checkbox-group label a {
    text-decoration: underline;
    transition: opacity 0.2s;
}

.checkbox-group label a:hover {
    opacity: 0.8;
}

/* Mejorar para móvil - touch targets más grandes */
@media (max-width: 768px) {
    .checkbox-group {
        gap: 1rem;
        padding: 1rem;
    }

    .checkbox-group input[type="checkbox"] {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        border-width: 2.5px;
    }

    .checkbox-group input[type="checkbox"]:checked::after {
        font-size: 18px;
    }

    .checkbox-group label {
        font-size: 0.95rem;
        line-height: 1.8;
    }
}

/* LOADING */
.loading {
    display: none;
    text-align: center;
    padding: 3rem;
}

.loading.active {
    display: block;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    border: 5px solid rgba(255,255,255,0.1);
    border-top: 5px solid var(--bmw-m-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-btn {
    padding: 0.8rem 1.2rem;
    background: var(--bmw-dark-gray);
    border: 2px solid transparent;
    border-radius: 10px;
    color: var(--bmw-white);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.page-btn:hover {
    border-color: var(--bmw-m-blue);
}

.page-btn.active {
    background: var(--gradient-m);
}

/* FOOTER */
.footer {
    background: var(--bmw-black);
    padding: 3rem 0;
    margin-top: 4rem;
    border-top: 3px solid;
    border-image: var(--gradient-m) 1;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bmw-dark-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--bmw-white);
    text-decoration: none;
    transition: all var(--transition-normal);
}

.social-btn:hover {
    background: var(--gradient-m);
    transform: translateY(-5px);
}

/* SOCIAL ICONS WITH SVG */
.list-unstyled {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.list-social__item {
    display: inline-block;
}

.list-social__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bmw-dark-gray);
    text-decoration: none;
    transition: all var(--transition-normal);
    position: relative;
}

.list-social__link:hover {
    background: var(--gradient-m);
    transform: translateY(-5px);
}

.list-social__link .svg-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.list-social__link .icon {
    width: 24px;
    height: 24px;
    color: var(--bmw-white);
    transition: all var(--transition-normal);
}

.list-social__link:hover .icon {
    color: var(--bmw-white);
    transform: scale(1.1);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* SOCIAL SHARE GRID */
.social-share-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.social-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--bmw-white);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.social-share-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.social-share-btn.facebook {
    background: #1877F2;
}

.social-share-btn.facebook:hover {
    background: #145dbf;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.social-share-btn.twitter {
    background: #000000;
}

.social-share-btn.twitter:hover {
    background: #1a1a1a;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.social-share-btn.whatsapp {
    background: #25D366;
}

.social-share-btn.whatsapp:hover {
    background: #1da851;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.social-share-btn.linkedin {
    background: #0077B5;
}

.social-share-btn.linkedin:hover {
    background: #005885;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.social-share-btn.telegram {
    background: #0088cc;
}

.social-share-btn.telegram:hover {
    background: #006699;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.social-share-btn.copy {
    background: var(--bmw-dark-gray);
    border: 2px solid var(--bmw-m-blue);
}

.social-share-btn.copy:hover {
    background: rgba(0,168,255,0.1);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

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

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

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

/* SHOPIFY PRODUCTS SECTION */
.shopify-products-section {
    margin-top: 4rem;
    padding: 3rem 0;
}

.shopify-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.shopify-product-card {
    background: #222;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.shopify-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(228, 0, 43, 0.3);
}

.shopify-product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: #1a1a1a;
    transition: transform 0.3s ease;
    cursor: pointer;
}

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

.shopify-product-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.shopify-product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

.shopify-product-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #E4002B;
    margin-bottom: 1rem;
}

.shopify-product-price-compare {
    text-decoration: line-through;
    color: #666;
    font-size: 1rem;
    margin-right: 0.5rem;
}

.shopify-product-btn {
    background: linear-gradient(135deg, #E4002B 0%, #8B0019 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    margin-top: auto;
}

.shopify-product-btn:hover {
    background: linear-gradient(135deg, #ff0033 0%, #b30020 100%);
    transform: scale(1.05);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .upload-section {
        padding: 2rem 1rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-icon {
        font-size: 3rem;
    }

    .themes-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.8rem;
    }

    .theme-card {
        padding: 1rem;
    }

    .theme-icon {
        font-size: 2.5rem;
    }

    .theme-name {
        font-size: 0.9rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .gallery-filters {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .modal {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 2rem;
        /* Mejor para móvil usando variable CSS personalizada */
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
        min-height: -webkit-fill-available;
    }

    .modal-content {
        padding: 2rem 1.5rem;
        margin: 0 auto 2rem;
        max-height: 85vh;
        max-height: calc(var(--vh, 1vh) * 85);
        width: calc(100% - 2rem);
        /* Permitir scroll suave en iOS */
        -webkit-overflow-scrolling: touch;
    }

    .result-modal-content,
    .image-modal-content {
        max-width: 100% !important;
        padding: 1.5rem !important;
    }

    .social-share-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .social-share-btn {
        padding: 0.7rem 0.5rem;
        font-size: 0.85rem;
    }

    .social-share-btn svg {
        width: 18px;
        height: 18px;
    }

    .btn {
        padding: 0.9rem 2rem;
        font-size: 1rem;
    }

    .design-card {
        border-radius: 12px;
    }

    .design-image {
        height: 350px;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .page-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    /* Shopify products responsive - Tablet */
    .shopify-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .shopify-product-image {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .header {
        padding: 1rem 0;
    }

    .logo {
        font-size: 1.5rem;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .upload-section {
        padding: 1.5rem 1rem;
        margin: 1rem 0;
        border-radius: 15px;
    }

    .upload-area {
        padding: 1.5rem 1rem;
    }

    .themes-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
    }

    .theme-card {
        padding: 0.8rem 0.5rem;
    }

    .theme-icon {
        font-size: 2rem;
        margin-bottom: 0.3rem;
    }

    .theme-name {
        font-size: 0.75rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
    }

    .gallery-section h2 {
        font-size: 1.8rem;
    }

    .gallery-filters {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .design-image {
        height: 300px;
    }

    .design-info {
        padding: 1rem;
    }

    .design-title {
        font-size: 1rem;
    }

    .design-meta {
        font-size: 0.85rem;
    }

    .modal {
        padding: 0.5rem;
        padding-top: 1rem;
    }

    .modal-content {
        padding: 1.5rem 1rem;
        padding-bottom: 2rem;
        border-radius: 15px;
        width: calc(100% - 1rem);
        margin: 0 auto 1rem;
    }

    .result-modal-content,
    .image-modal-content {
        padding: 1rem !important;
    }

    .modal-close {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 1.8rem;
        padding: 0.5rem;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0,0,0,0.5);
        border-radius: 50%;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.8rem;
        font-size: 0.95rem;
    }

    .social-share-grid {
        grid-template-columns: 1fr;
    }

    .social-share-btn {
        padding: 0.9rem 1rem;
        font-size: 0.9rem;
    }

    .social-links {
        gap: 1rem;
    }

    .social-btn {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    /* Social Icons SVG - Mobile */
    .list-social {
        gap: 1rem;
    }

    .list-social__link {
        width: 45px;
        height: 45px;
    }

    .list-social__link .icon {
        width: 22px;
        height: 22px;
    }

    .footer {
        padding: 2rem 0;
    }

    .loading {
        padding: 2rem 1rem;
    }

    .spinner {
        width: 50px;
        height: 50px;
    }

    #loadingText {
        font-size: 1.1rem;
    }

    /* Shopify products responsive - Mobile */
    .shopify-products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .shopify-product-image {
        height: 220px;
    }

    .shopify-product-title {
        font-size: 1rem;
    }
}

/* Mejoras adicionales para muy pequeñas pantallas */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.7rem;
    }

    .themes-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .theme-icon {
        font-size: 1.8rem;
    }

    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Mejoras para landscape en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 2rem 1rem;
    }

    .upload-section {
        margin: 1rem 0;
    }

    .modal {
        align-items: flex-start;
    }

    .modal-content {
        max-height: none;
        margin: 1rem auto;
    }
}

/* Fixes para iOS Safari */
@supports (-webkit-touch-callout: none) {
    .modal {
        height: 100vh;
        height: -webkit-fill-available;
    }

    .modal-content {
        -webkit-overflow-scrolling: touch;
    }
}

/* Prevenir zoom al enfocar inputs en iOS */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Mejorar touch targets en móviles */
@media (hover: none) and (pointer: coarse) {
    button,
    .btn,
    .social-share-btn,
    .filter-btn,
    .theme-card,
    .like-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Estilos para intl-tel-input (selector de teléfono) */
.iti {
    width: 100%;
}

.iti__flag-container {
    background: var(--bmw-black);
    border: 2px solid var(--bmw-dark-gray);
    border-radius: 10px 0 0 10px;
}

.iti__selected-flag {
    background: var(--bmw-black);
    padding: 0 10px;
}

.iti__selected-flag:hover {
    background: rgba(0,168,255,0.1);
}

.iti__country-list {
    background: var(--bmw-dark-gray);
    border: 2px solid var(--bmw-m-blue);
    border-radius: 10px;
    box-shadow: var(--shadow-xl);
    max-height: 250px;
}

.iti__country {
    padding: 8px 12px;
    color: var(--bmw-white);
}

.iti__country:hover {
    background: rgba(0,168,255,0.1);
}

.iti__country.iti__highlight {
    background: rgba(0,168,255,0.2);
}

.iti__dial-code {
    color: #999;
}

.iti__divider {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.iti__search-input {
    background: var(--bmw-black) !important;
    border: 2px solid var(--bmw-dark-gray) !important;
    color: var(--bmw-white) !important;
    padding: 8px !important;
    border-radius: 8px !important;
    margin: 8px !important;
    width: calc(100% - 16px) !important;
}

.iti__search-input:focus {
    border-color: var(--bmw-m-blue) !important;
    outline: none !important;
}

.iti__search-input::placeholder {
    color: #666 !important;
}

#userWhatsapp.iti__tel-input {
    padding-left: 60px;
}
