/* Mala Personalizada - Novo Layout Inspirado no Design */

/* Modal Base */
.mala-modal {
    display: none;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.mala-modal-content {
    background-color: #D94140;
    margin: 2% auto;
    padding: 0;
    border-radius: 0;
    width: 95%;
    max-width: 1140px;
    height: 90vh;
    max-height: 600px;
    overflow: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.4s;
    position: relative;
}

@keyframes slideIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Botão Fechar */
.mala-modal-close {
    color: #fff;
    position: absolute;
    right: 30px;
    top: 30px;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.3s;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.mala-modal-close:hover {
    transform: rotate(90deg) scale(1.2);
}

/* Layout Principal - Split Screen */
.mala-modal-layout {
    display: grid;
    grid-template-columns: 1fr .7fr;
    height: 100%;
    gap: 0;
}
.mala-modal-content.step-4 {
    max-width: 1300px;
}
.mala-modal-content.step-4 .mala-modal-layout {
    grid-template-columns: 1fr .8fr;
}


/* Lado Esquerdo - Opções */
.mala-options-side {
    padding: 30px 40px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Título Principal */
.mala-title {
    font-size: 4rem;
    color: #fff;
    margin: 0 0 30px 0;
    font-weight: normal;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Títulos dos Passos */
.step-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #fff;
    margin: 0 0 1.5rem 0;
    text-align: center;
}

.step-subtitle {
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    margin: 30px 0 20px 0;
    letter-spacing: 0.5px;
}

/* Design Options - Cards com Imagens */
.design-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.design-card {
    position: relative;
    cursor: pointer;
    max-width: 200px;
    transition: all 0.3s ease;
}

.design-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.design-preview {
    border: 1px solid #F1CEDA;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.design-preview:hover {
    background-color: #fff;
}

.design-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(1.1);
    transition: all 0.3s;
}

.design-card input:checked~.design-preview {
    background: #fff;
    border-color: #fff;
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.design-checkmark {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #4CAF50;
    color: #fff;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.design-card input:checked~.design-checkmark {
    display: flex;
}

/* Estados de Compatibilidade */
[data-design="sem-desenho-02"], [data-design="sem-desenho-01"] {
    order: -1;
}
.design-card.design-incompatible {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(80%);
    display: none;
}

.design-card.design-incompatible .design-preview {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.design-card.design-incompatible .design-preview img {
    filter: grayscale(100%) brightness(0.7);
}

.design-card.design-compatible {
    opacity: 1;
    pointer-events: auto;
}


/* Color Options - Cards com Imagens (igual aos Design Cards) */
.color-options,
.case-color-options,
.color-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    column-gap: 20px;
    row-gap: 40px;
    margin-bottom: 30px;
}

.color-button,
.color-card {
    position: relative;
    cursor: pointer;
    max-width: 200px;
}

.color-button input[type="radio"],
.color-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.color-button span,
.color-card-preview {
    /* background: rgba(255, 255, 255, 0.3); */
    border: 1px solid #F1CEDA;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.mala-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    column-gap: 1rem;
}
.mala-actions.etapa-final {
    flex-wrap: wrap;
}
.mala-step[data-step="1"] .mala-actions {
    justify-content: center;
}
.color-card-preview img {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: brightness(1.1);
    max-height: 250px;
    max-width: 250px;
}

.color-button input:checked+span,
.color-card input:checked~.color-card-preview {
    background: #fff;
    border-color: #fff;
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.color-card input:checked~.color-card-name {
    background-color: #fff;
    color: #41332f;
    transition: all 0.3s;
}

.color-button:hover span,
.color-card:hover .color-card-preview {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 0.7);
}

.color-card-checkmark {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #4CAF50;
    color: #fff;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.color-card input:checked~.color-card-checkmark {
    display: flex;
}

.color-card-name {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    color: #fff;
    font-size: 1rem;
    text-align: center;
    margin-top: 1.25rem;
    max-width: max-content;
    margin-left: auto;
    margin-right: auto;
    min-height: 50px;
    border-radius: 5px;
    border: 1px solid #F1CEDA;
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.qty-option {
    cursor: pointer;
}

.qty-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.qty-option span {
    display: block;
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    font-size: .875rem;
    transition: all 0.3s;
}

.qty-option input:checked+span {
    background: #fff;
    color: #E85D75;
    border-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Patches Grid */
.cases-grid,
.patches-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

dl.variation {
    display: flex;
    flex-wrap: wrap;
    column-gap: .3125rem;
}

dl.variation>dd {
    width: 100%;
    max-width: calc(100% - 90px);
}

dl.variation>dt {
    max-width: 80px;
    width: 100%;
}

.patch-item {
    position: relative;
    cursor: pointer;
}

.patch-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.patch-preview {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.patch-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.patch-item input:checked~.patch-preview {
    border-color: #4CAF50;
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.patch-checkmark {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #4CAF50;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.patch-item input:checked~.patch-checkmark {
    display: flex;
}

/* Cases - Mesmo estilo dos Patches */
.case-item {
    position: relative;
    cursor: pointer;
}

.case-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.case-preview {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.case-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.case-item input:checked~.case-preview {
    border-color: #4CAF50;
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.case-checkmark {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #4CAF50;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.case-item input:checked~.case-checkmark {
    display: flex;
}


/* Botões de Navegação */
.mala-next-btn,
.mala-save-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #E85D75;
    border: none;
    padding: 18px 40px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mala-next-btn:hover,
.mala-save-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
button.mala-save-btn {
    width: 100%;
}
.mala-prev-btn {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
    padding: 15px 35px;
    font-size: .875rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
    letter-spacing: 1px;
}

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

.mala-clear-btn {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.6);
    padding: 12px 30px;
    font-size: .875rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.mala-clear-btn:hover {
    background: rgba(255, 100, 100, 0.3);
    border-color: #fff;
    opacity: 1;
}

/* Lado Direito - Preview */
.mala-preview-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    position: relative;
}

.preview-container {
    position: relative;
    width: 100%;
    max-width: 550px;
    /* margin-bottom: 40px; */
}

/* Sistema de Camadas para Preview */
.preview-layers {
    position: relative;
    width: 100%;
}

.preview-base-layer {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.4));
    /* animation: float 3s ease-in-out infinite; */
}

.preview-stickers-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.preview-sticker-item {
    position: absolute;
    transition: all 0.3s ease;
    animation: stickerPop 0.4s ease-out;
}

@keyframes stickerPop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.preview-container img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.4));
    /* animation: float 3s ease-in-out infinite; */
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

.preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Case Preview Box */
.case-preview-box {
    width: 100%;
    max-width: 120px;
    padding: 0;
    gap: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.case-preview-box .case-preview-item {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border: 1px solid #F1CEDA;
    object-fit: contain;
    border-radius: 5px;
    transition: transform 0.2s;
}

.case-preview-box .case-preview-item:hover {
    transform: scale(1.1);
}


/* Price Display */
.price-display {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    backdrop-filter: blur(10px);
    display: none;
}

.price-label {
    display: block;
    color: #fff;
    font-size: 1rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.price-value {
    display: block;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 1200px) {
    .mala-modal-layout {
        grid-template-columns: 1fr;
    }

    .mala-preview-side {
        display: none;
    }

    .mala-options-side {
        padding: 40px 30px;
    }

    .mala-title {
        font-size: 2.5rem;
    }

    .cases-grid,
    .patches-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .mala-options-side {
        padding: 30px 20px;
    }

    .mala-title {
        font-size: 2.25rem;
    }

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

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

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

/* Scrollbar Customizado */
.mala-options-side::-webkit-scrollbar {
    width: 8px;
}

.mala-options-side::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.mala-options-side::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.mala-options-side::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
