/* Estilos para la tienda */
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    padding: 15px 0;
    z-index: 1;
}

.player-coins {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1.2em;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 15px;
}

/* Contenedor principal del modal de la tienda */
#shop-modal .modal-content {
    display: flex;
    flex-direction: column;
    padding: 20px !important;
    margin: 10px;
    position: relative;
    width: 100% !important;
    max-width: 500px !important;
    height: 90vh !important;
    max-height: 80vh !important;
    overflow: hidden;
}

/* Contenedor del contenido scrollable */
.shop-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    min-height: 0; /* Importante para que el flex funcione correctamente */
}

/* Hacer que el scroll sea más suave y estilizado */
.shop-content::-webkit-scrollbar {
    width: 8px;
}

.shop-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.shop-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.shop-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.shop-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    position: sticky;
    top: 60px;
    padding: 10px 0;
    z-index: 1;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
    background: rgb(0 191 255);
    font-weight: bold;
}

.tab-content {
    display: none;
    height: 100%;
}

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

/* Grid de personajes */
.characters-grid {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    overflow: hidden; /* Para contener los floats */
}

.character-option {
    float: left;
    width: 48%;
    margin: 1%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    box-sizing: border-box;
    border: 2px solid transparent; /* Añadir borde transparente por defecto */
    transition: all 0.3s ease;
    position: relative; /* Para el candado */
}

.character-option.current {
    border-color: var(--accent-color);
    background: rgba(0, 255, 57, 0.1);
}

/* Efecto hover */
.character-option:hover:not(.current):not(.locked) {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Estilos para personajes bloqueados */
.character-option.locked {
    opacity: 0.7;
    border-color: rgba(128, 128, 128, 0.3);
}

.character-option.locked::after {
    content: "🔒";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2em;
}

.character-option.locked .character-preview {
    filter: grayscale(0.1);
}

.character-option.locked .select-btn {
    font-size: 0.9em;
}

.character-preview {
    width: 100%;
    height: auto;
    max-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.character-preview img,
.character-preview svg {
    max-width: 100%;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.character-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.character-level {
    font-size: 1.1em;
    color: var(--accent-color);
}

.select-btn {
    background: var(--accent-color);
    color: #333;
    border: none;
    padding: 8px 15px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 57, 0.3);
}

.select-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
}

/* Grid de skins */
.skins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 10px;
}

.skin-coming-soon {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.coming-soon-icon {
    font-size: 3em;
    opacity: 0.5;
}

/* Grid de items */
.items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 10px;
}

.shop-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 2px solid transparent;
}

.shop-item.cant-afford {
    opacity: 0.7;
    border-color: rgba(255, 0, 0, 0.3);
}

.shop-item.locked {
    opacity: 0.7;
    border-color: rgba(128, 128, 128, 0.3);
    position: relative;
}

.shop-item.locked::after {
    content: "🔒";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2em;
}

.item-icon {
    font-size: 2em;
    margin-bottom: 5px;
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.item-name {
    font-size: 1.1em;
    color: var(--accent-color);
}

.item-description {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
}

.item-price {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1.1em;
    margin-top: 5px;
}

.buy-btn {
    background: var(--accent-color);
    color: #333;
    border: none;
    padding: 8px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.buy-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 57, 0.3);
}

.buy-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    font-size: 0.9em;
}

/* Responsive */
/* Tablets y pantallas medianas */
@media screen and (max-width: 768px) {
    .characters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
        padding: 8px;
    }

    .character-preview {
        height: 130px;
    }
}

/* Móviles en landscape */
@media screen and (max-width: 640px) {
    .characters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 6px;
    }

    .character-preview {
        height: 120px;
    }
}

/* Móviles pequeños y portrait */
@media screen and (max-width: 480px) {
    #shop-modal .modal-content {
        padding: 15px !important;
        margin: 5px;
    }

    .shop-header {
        padding: 10px 0;
    }

    .player-coins {
        font-size: 1em;
    }

    .shop-tabs {
        gap: 8px;
    }

    .tab-btn {
        padding: 8px;
        font-size: 0.9em;
    }

    .character-option {
        width: calc(50% - 10px);
        margin: 5px;
    }

    .character-preview {
        max-height: 120px;
    }

    .character-preview img,
    .character-preview svg {
        max-height: 100px;
    }
}

/* Móviles muy pequeños */
@media screen and (max-width: 359px) {
    .character-option {
        float: none;
        width: 98%;
        margin: 1%;
    }

    .character-preview {
        max-height: 140px;
    }

    .character-preview img,
    .character-preview svg {
        max-height: 120px;
    }

    .skins-grid,
    .items-grid {
        grid-template-columns: 1fr;
    }

    .shop-item {
        padding: 10px;
    }
}

/* Soporte específico para iOS */
@supports (-webkit-touch-callout: none) {
    .character-option {
        width: 48%;
        margin: 1%;
    }

    .character-preview img,
    .character-preview svg {
        max-width: 100%;
        max-height: 120px;
        width: auto;
        height: auto;
    }
} 