.customizer{
    display:flex;
    /* Respiro antes do mosaico de fotos do rodape (pedido 2026-11-04). */
    margin-bottom:60px;
}

/* PREVIEW */
.preview {
    width:60%;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:flex-start;
    background:white;
    padding: 30px 0 20px;
}

.preview-container {
    position:relative;
    width:640px;
    max-width: 100%;
    min-height:500px;
    overflow:hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-container img {
    width:100%;
    object-fit: contain;
    /* Source photos are shot on a large white canvas with some margin around
       the cap — a light zoom trims that margin without cropping into the cap
       itself (keep this modest; the source margin isn't identical on every
       photo, so an aggressive zoom here clips the cap on some views). */
    transform: scale(1.12);
    transform-origin: center 46%;
}

/* Fixed customization guidelines box, below the preview image */
.customizer-info-box {
    width: 550px;
    max-width: 100%;
    margin-top: 30px;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    background: #f7f6ff;
    border: 1px solid #e4e0fb;
    border-radius: 14px;
    padding: 20px 24px;
}

.customizer-info-box__accent {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    color: var(--roxo-vivo, var(--azul));
    margin-top: 2px;
}

.customizer-info-box__text h4 {
    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--azul);
    margin-bottom: 10px;
}

.customizer-info-box__text ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.customizer-info-box__text li {
    position: relative;
    padding-left: 16px;
    font-size: 14px;
    color: #444;
}

.customizer-info-box__text li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--roxo-vivo, var(--azul));
}

#logoPreview {
    position:absolute;
    top:120px;
    left:150px;
    width:80px;
    height:auto;
    object-fit:contain;
    max-width:100%;
}

#textPreview {
    position:absolute;
    top:160px;
    left:120px;
    font-size:20px;
    font-weight:bold;
}

/* CONTROLES */
.controls {
    width:40%;
    padding:40px;
    background:#fafafa;
    border-left:1px solid #dedede;
    /* So o box fecha com linha, nao a largura toda (pedido 2026-11-04). */
    border-bottom:1px solid #dedede;
}

.controls h2 {
    font-weight:bold;
    color: #fff;
    font-size:35px;
    padding: 10px 20px;
    text-align: center;
    border-radius: 10px 10px 0 0;
    background: var(--azul);
}

.controls select,
.controls input[type="text"] {
    width:100%;
    padding:10px;
    border:1px #9e9e9e solid;
    border-radius:4px;
}

.controls h3 {
    font-size:23px;
    font-weight:bold;
    margin-bottom:10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dedede;
    color: var(--azul);
    text-transform: uppercase;
}

.controls label {
    display:block;
    margin-bottom:10px;
}

.controls input:not([type="color"]) {
    width:100%;
    margin-bottom:15px;
}

.file-upload {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
}

.file-upload .logo-upload-input,
.logo__custom .file-upload input[type="file"] {
    display: none !important;
}

.file-upload-button {
    display: inline-block !important;
    padding: 8px 14px;
    margin: 0 !important;
    border: 1px solid #888;
    border-radius: 2px;
    background: #f2f2f2;
    color: #000;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
}

.file-upload-name {
    overflow: hidden;
    color: #000;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.views {
    margin-top:20px;
    display:flex;
    justify-content:center;
    align-items:center;
}

.views button,
.export button {
    margin-right:10px;
    margin-bottom:10px;
    padding:8px 30px;
    cursor:pointer;
    border:none;
}

.cta__secondary {
    background:#666;
    color:white;
    margin:0;
    border-radius:50px;
}

.cta__secondary:hover {
    background:#555;
}


.export {
    margin-top:20px;
    display:flex;
    justify-content:center;
    align-items:center;
}

.preview-container {
    position:relative;
}

#logoPreview,
#logoPreview2,
#logoPreview3,
#logoPreview4,
#logoPreview5 {
    position:absolute;
    cursor:move;
}

#textPreview{
    position:absolute;
    cursor:move;
}

/* Preview da logo */
.logo-preview-container {
    margin-bottom:20px;
}

.logo-preview-wrapper {
    position:relative;
    width:100%;
    height:120px;
    border:2px dashed #ddd;
    border-radius:8px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#fafafa;
}

.logo-preview-wrapper img {
    max-width:90%;
    max-height:70%;
    width:90%;
    height:70%;
    object-fit:contain;
}

#logoThumb {
    max-width:100%;
    max-height:100%;
    object-fit:contain;
    border-radius:4px;
}

.remove-btn {
    position:absolute;
    top:5px;
    right:5px;
    width:25px;
    height:25px;
    border-radius:50%;
    border:none;
    background:#ff4444;
    color:white;
    font-size:16px;
    font-weight:bold;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:background 0.3s;
}

.remove-btn:hover {
    background:#cc0000;
}

.no-logo {
    color:#999;
    font-style:italic;
    text-align:center;
}

#exportBtn{
    background:#397e01;
}


section.title__page {
    background: var(--azul);
    padding: 40px 0;
}

section.title__page h1 {
    font-size: 60px;
    text-align: center;
    color: #fff;
}

@media (max-width: 767px) {
    section.title__page {
        padding: 28px 0;
    }

    section.title__page h1 {
        font-size: 28px;
    }
}


.controls .steps {
    display: flex;
    gap: 5px;
    justify-content: center;
    align-items: center;
    padding-bottom: 10px;
    padding-top: 10px;
    margin-bottom: 30px;
    border-top: 1px solid #dedede;
    border-bottom: 1px solid #dedede;
}

.controls .steps .step {
    flex: 1;
    background: #fff;
    border: 1px solid #ccc;
    color: var(--azul);
    padding: 10px;
    font-size: 14px;
}

.controls .steps .step.active {
    background: var(--azul);
    color: #fff;
}

.logo__select {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: space-between;
    color: #000;
}

.logo__select button {
    flex: 1;
    background: #ccc;
}

.logo__select button:hover,
.logo__select button.active {
    background: var(--azul);
    color: #fff;
}

.logo__dafault {
    width: 100%;
    height: 200px;
    overflow: auto;
    margin-bottom: 30px;
    border: 2px #dedede solid;
    padding: 20px;
    border-radius: 10px;
}

.logo__dafault ul {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.logo__dafault ul li {
    height:50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo__dafault ul li.active {
    border: 2px solid var(--azul);
}

.logo__dafault ul li img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.logo__custom {
    padding: 20px;
    border: 2px solid #ccc;
    border-radius: 5px;
    margin-bottom: 15px;
}

.logo__custom input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
}

.logo__custom input[type="range"] {
    width: 100%;
    margin-top: 20px;
}

/* Estilos para seleção de cores */
.color__default {
    height: 120px;
    overflow: auto;
    border: 2px solid #dedede;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 15px;
}

.color__default ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.color__default li {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: #fff;
}

.color__default li:hover {
    border-color: var(--azul);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.color__default li.active {
    border-color: var(--azul);
    background: rgba(0,123,255,0.1);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.2);
}

.color__default li img {
    max-width: 100%;
    max-height: 50px;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 5px;
}

.color__default li span {
    display: block;
    font-size: 12px;
    line-height: 1;
    font-weight: 500;
    color: #333;
}

/* Estilos para seleção de logos default */
.logo__default {
    height: 160px;
    overflow: auto;
    border: 2px solid #dedede;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 15px;
}

.logo__default ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.logo__default li {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: #fff;
    display: flex;
}

.logo__default li:hover {
    border-color: var(--azul);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.logo__default li.selected {
    border-color: var(--azul);
    background: rgba(0,123,255,0.1);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.2);
}

.logo__default li img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
    height: auto;
}

/* Estilos para botões de seleção custom/default */
.logo__select {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.logo__select button {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.logo__select button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.logo__select button.active {
    background: var(--azul);
    color: white;
}

.logo__select button:not(.active) {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.logo__select button:not(.active):hover {
    background: #e9ecef;
}

.nav__steps {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    border-top: 1px solid #dedede;
    padding-top: 20px;
}

.nav__steps button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* MODAL STYLING */
.finish-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background: white;
    max-width: 1000px;
    margin: 50px auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #dedede;
    background: #fafafa;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 30px;
    display: grid;
    grid-template-columns: 2fr 2fr;
    gap: 50px;
}

.modal-content--small {
    max-width: 440px;
}

.modal-body--simple {
    display: block;
    padding: 30px;
    font-size: 15px;
    color: #444;
    line-height: 1.5;
}

.modal-body .cap-preview {
    border: 1px #dedede solid;
    padding: 15px;
    border-radius: 6px;
    overflow: hidden;
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 20px auto 0;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.carousel-slide {
    display: none;
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.carousel-slide.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.carousel-slide h5 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--azul);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-prev {
    left: 0;
}

.carousel-next {
    right: 0;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: #0056b3;
    transform: translateY(-50%) scale(1.1);
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: var(--azul);
    transform: scale(1.2);
}

.indicator:hover {
    background: #666;
}


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

.cap-preview h4,
.user-form h4 {
    margin: 0 0 20px 0;
    color: var(--azul);
    font-size:24px;
    font-weight: bold;
}

.cap-preview h4 {
    text-align: center;
    background: var(--azul);
    padding: 10px;
    margin: -15px -15px 0 -15px;
    color: #fff;
}

.preview-container-modal {
    position: relative;
    width: 370px;
    min-height: 150px;
    overflow: visible;
    margin: 0 auto;
}

.preview-container-modal img {
    width: 100%;
}

#modalLogoPreview,
#modalLogoPreviewFront,
#modalLogoPreviewLeft,
#modalLogoPreviewRight,
#modalLogoPreviewBack {
    position: absolute;
    top: 60px;
    left: 75px;
    width: 40px;
    height: auto;
    object-fit: contain;
    max-width: 100%;
    z-index: 10;
}

#modalTextPreview,
#modalTextPreviewFront,
#modalTextPreviewLeft,
#modalTextPreviewRight,
#modalTextPreviewBack {
    position: absolute;
    top: 80px;
    left: 60px;
    font-size: 10px;
    font-weight: bold;
    z-index: 5;
    max-width: 120px;
    word-wrap: break-word;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #dedede;
    background: #fafafa;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-radius: 0 0 8px 8px;
}

/* Responsive design */
@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .modal-content {
        margin: 20px;
        max-height: 95vh;
    }
    
    .preview-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .preview-container-modal {
        width: 200px;
    }
}

/* LOADING OVERLAY STYLES */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.loading-progress {
    font-size: 14px;
    opacity: 0.8;
}

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


.brim-color-info {
    display: block;
    text-align: center;
    padding: 10px;
    background: #fffaca;
    border-radius: 4px;
    margin-top: 10px;
}

.preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    text-align: center;
    color: #6c757d;
    font-size: 16px;
}

.preview-placeholder p {
    margin: 0;
    padding: 20px;
}

.text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.draggable-text {
    position: absolute;
    cursor: move;
    pointer-events: auto;
    user-select: none;
    touch-action: none;
    padding: 5px;
    border: 1px dashed transparent;
    transition: border-color 0.3s ease;
}

.draggable-text:hover {
    border-color: rgba(0, 123, 255, 0.5);
}

.draggable-text.dragging {
    border-color: #007bff;
    opacity: 0.8;
}

.draggable-logo {
    position: absolute;
    cursor: move;
    user-select: none;
    touch-action: none;
    max-width: 150px;
    max-height: 150px;
    pointer-events: auto;
}

.draggable-logo:hover {
    border: 1px dashed rgba(0, 123, 255, 0.5);
}

.draggable-logo.dragging {
    border: 1px solid #007bff;
    opacity: 0.8;
}



#successMessage #closeSuccessBtn {
    margin: auto;
}

.logo__default .logos li.active {
    border: 3px solid var(--azul);
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 900px) {
    .customizer {
        flex-direction: column;
        margin-bottom: 32px;
    }

    .preview,
    .controls {
        width: 100%;
    }

    .controls {
        border-left: 0;
        border-top: 1px solid #dedede;
    }
}

@media (max-width: 600px) {
    .preview {
        padding: 30px 16px;
    }

    .preview-container {
        width: 100%;
        max-width: 400px;
        min-height: 0;
    }

    .customizer-info-box {
        width: 100%;
        margin-top: 20px;
        padding: 16px 18px;
        gap: 12px;
    }

    .controls {
        padding: 24px 18px;
    }

    .controls h2 {
        font-size: 24px;
    }

    .controls h3 {
        font-size: 18px;
    }

    .controls .steps {
        gap: 4px;
    }

    .controls .steps .step {
        padding: 8px 4px;
        font-size: 12px;
    }

    .nav__steps {
        flex-wrap: wrap;
    }

    .nav__steps button {
        flex: 1 1 auto;
        min-width: 100px;
        justify-content: center;
    }

    .color__default ul,
    .logo__default ul,
    .logo__dafault ul {
        grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    .modal-body,
    .modal-body--simple {
        padding: 20px;
    }

    .modal-footer {
        padding: 16px 20px;
        flex-wrap: wrap;
    }

    .modal-footer button {
        width: 100%;
    }
}