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

html,
body {
    width: 100%;
    height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #0f0f0f;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* HEADER */
.header {
    width: 100%;
    height: 100px;
    background: #212121;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #000000;
    flex-shrink: 0;
    z-index: 10;
}

.logo-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
   width: 320px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* VISOR */
.viewer-container {
    flex: 1;
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 10px;
}

#ar-viewer {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    background: transparent;
    --poster-color: transparent;
}

/* BOTÓN AR */
.ar-container {
    position: absolute;
    right: 25px;
    bottom: 25px;
    z-index: 20;
}

#ar-button-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    border: none;
    border-radius: 30px;
    background: #111111;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ar-icon {
    font-size: 20px;
    line-height: 1;
}

#ar-button-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.30);
}

/* BARRA DE CARGA */
.progress-bar {
    display: block;
    position: absolute;
    left: 10%;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    height: 5px;
    border-radius: 5px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.15);
}

.progress-bar.hide {
    display: none;
}

.update-bar {
    height: 100%;
    width: 0%;
    background: #111111;
    transition: width 0.2s ease;
}

/* ZONA INFERIOR */
.carousel-container {
    width: 100%;
    min-height: 105px;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
     background: #212121;
    border-top: 1px solid #000000;
    padding: 12px 20px;
    z-index: 10;
}

/* BOTONES DE OBJETOS */
.carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.carousel::-webkit-scrollbar {
    display: none;
}

.slide-item {
    flex-shrink: 0;
    width: 100px;
    height: 80px;
    background: #181818;
    color: gray;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slide-item:hover {
    color: #ffffff;
    background: red;
}

.slide-item.active {
    background: red;
    color: #ffffff;
    border:none;
}

.slide-item:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* CONTROL TEXTURA CENTRADO */
.texture-control {
    position: absolute;
    left: 50%;
    bottom: 106px;
    transform: translateX(-50%);
    z-index: 15; 
}

.texture-toggle {
    min-width: 125px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border: 1px solid #cccccc;
    border-radius: 22px;
    background: #ffffff;
    color: #222222;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.texture-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.18);
}

.texture-toggle.on {
    background-color: red;
    color: #ffffff;
    border: none;
}

.texture-toggle.off {
    background: gray;
    color: #ffffff;
    border: none;
}

#texture-icon {
    font-size: 11px;
}

/* MÓVIL */
@media (max-width: 600px) {
    .header {
        height: 80px;
    }

    .logo {
       width: 320px;
    }

    .viewer-container {
        padding: 5px;
    }

    .carousel-container {
        min-height: 112px;
        padding: 8px 10px;
    }

    .carousel {
        justify-content: flex-start;
        padding-right: 0;
        padding-bottom: 34px;
    }

    .slide-item {
        min-width: 95px;
        padding: 10px 16px;
        font-size: 13px;
    }

    .texture-control {
        bottom: 135px;
    }

    .texture-toggle {
        min-width: 120px;
        padding: 8px 15px;
    }

    .ar-container {
        right: 15px;
        bottom: 15px;
    }

    #ar-button-custom {
        padding: 11px 16px;
        font-size: 13px;
    }

    .ar-icon {
        font-size: 18px;
    }
}


/* =========================================
   BARRA DE CARGA ORIGINAL MODEL-VIEWER
   ========================================= */

.progress-bar {
    position: absolute !important;

    top: 50% !important;
    left: 50% !important;

    transform: translate(-50%, -50%) !important;

    width: 70px !important;
    height: 70px !important;

    background: transparent !important;

    border: 5px solid rgba(255, 0, 0, 0.20) !important;

    border-top-color: red !important;

    border-radius: 50% !important;

    box-sizing: border-box;

    z-index: 100;

    animation: progress-spin 0.8s linear infinite;
}


/* Parte interna de la barra */
.progress-bar .update-bar {
    width: 100% !important;
    height: 100% !important;

    background: transparent !important;

    border: none !important;
}


/* Animación circular */
@keyframes progress-spin {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }

}

/* =====================================================
   BOTÓN AR NATIVO DE MODEL-VIEWER
   ===================================================== */

model-viewer::part(default-ar-button) {
  background-color: #ff0000;
    color: #ffffff;

    border-radius: 12px;

    width: 52px;
    height: 52px;

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.30);

    transition:
        transform 0.2s ease,
        background-color 0.2s ease;
}


/* Cuando se toca */

model-viewer::part(default-ar-button):active {
    transform: scale(0.92);
}