/* Cortinas de Cristal Configurador SVG - v1.0 */

/* === LAYOUT VERTICAL === */
.ccr-layout {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* === PREVIEW SVG === */
.ccr-preview-container {
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    overflow: hidden;
    transition: border-color 0.3s;
    width: 100%;
}

.ccr-preview-container.active {
    border-color: #2AB9AD;
}

.ccr-preview-label {
    font-size: 0.8em;
    color: #888;
    text-align: center;
    padding: 8px 15px;
    background: #f8f9fa;
    font-weight: 500;
    border-bottom: 1px solid #e8e8e8;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.ccr-preview {
    background: #fff;
    padding: 15px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ccr-preview svg {
    width: 100%;
    max-height: 320px;
}

/* === FILA MEDIDAS + HOJAS INFO === */
.ccr-measures-row {
    display: flex;
    gap: 15px;
    align-items: stretch;
}

.ccr-measure-field {
    flex: 1;
    min-width: 0;
}

.ccr-measure-field label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.ccr-measure-field label .required {
    color: #e53935;
}

/* === SHARED INPUT WRAP === */
.ccr-input-wrap {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.ccr-input-wrap:focus-within {
    border-color: #2AB9AD;
    box-shadow: 0 0 0 3px rgba(42, 185, 173, 0.1);
}

.ccr-input-wrap input {
    flex: 1;
    border: none;
    padding: 10px 12px;
    font-size: 1em;
    outline: none;
    background: transparent;
    min-width: 0;
    -moz-appearance: textfield;
}

.ccr-input-wrap input::-webkit-outer-spin-button,
.ccr-input-wrap input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ccr-input-unit {
    padding: 10px 12px;
    background: #f5f5f5;
    color: #666;
    font-size: 0.85em;
    font-weight: 600;
    border-left: 1px solid #e0e0e0;
    white-space: nowrap;
}

/* === HOJAS INFO BADGE === */
.ccr-hojas-info {
    flex: 0 0 120px;
    background: linear-gradient(135deg, #e8faf9, #d4f5f3);
    border: 2px solid #2AB9AD;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-align: center;
}

.ccr-hojas-num {
    font-size: 1.8em;
    font-weight: 800;
    color: #000065;
    line-height: 1;
}

.ccr-hojas-label {
    font-size: 0.78em;
    font-weight: 600;
    color: #2AB9AD;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ccr-hojas-ancho {
    font-size: 0.72em;
    color: #666;
    margin-top: 2px;
}

/* === SECCIONES COLAPSABLES === */
.ccr-section {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.ccr-section.active {
    border-color: #2AB9AD;
    box-shadow: 0 2px 12px rgba(42, 185, 173, 0.12);
}

.ccr-section.completed {
    border-color: #4caf50;
}

.ccr-section-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.ccr-section-header:hover {
    background: #f0f2f5;
}

.ccr-section.active .ccr-section-header {
    background: linear-gradient(135deg, #e8faf9, #d4f5f3);
}

.ccr-section.completed .ccr-section-header {
    background: #f1f8e9;
}

.ccr-section-number {
    width: 26px;
    height: 26px;
    background: #2AB9AD;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82em;
    margin-right: 12px;
    flex-shrink: 0;
}

.ccr-section.completed .ccr-section-number {
    background: #4caf50;
}

.ccr-section-title {
    flex: 1;
    font-weight: 600;
    color: #333;
    font-size: 0.92em;
}

.ccr-section-summary {
    font-size: 0.82em;
    color: #2AB9AD;
    margin-right: 10px;
    font-weight: 500;
}

.ccr-section-toggle {
    color: #999;
    font-size: 0.7em;
    transition: transform 0.3s;
}

.ccr-section.collapsed .ccr-section-toggle {
    transform: rotate(-90deg);
}

.ccr-section-content {
    padding: 16px;
    max-height: 800px;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.ccr-section.collapsed .ccr-section-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

/* === SISTEMA OPTIONS === */
.ccr-system-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.ccr-system-option {
    cursor: pointer;
}

.ccr-system-option input {
    display: none;
}

.ccr-system-card {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.ccr-system-option:hover .ccr-system-card {
    border-color: #b2dfdb;
    background: #fafffe;
}

.ccr-system-option.selected .ccr-system-card {
    border-color: #2AB9AD;
    background: linear-gradient(135deg, #e8faf9, #d4f5f3);
    box-shadow: 0 2px 8px rgba(42, 185, 173, 0.15);
}

.ccr-system-icon {
    margin-bottom: 6px;
}

.ccr-system-name {
    display: block;
    font-weight: 600;
    font-size: 0.82em;
    color: #333;
    margin-bottom: 2px;
}

.ccr-system-desc {
    display: block;
    font-size: 0.7em;
    color: #888;
}

/* === GLASS OPTIONS (grid botones) === */
.ccr-glass-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.ccr-glass-option {
    cursor: pointer;
}

.ccr-glass-option input {
    display: none;
}

.ccr-glass-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 12px;
    transition: border-color 0.2s, background 0.2s;
    text-align: left;
}

.ccr-glass-option:hover .ccr-glass-btn {
    border-color: #b2dfdb;
    background: #fafffe;
}

.ccr-glass-option.selected .ccr-glass-btn {
    border-color: #2AB9AD;
    background: linear-gradient(135deg, #e8faf9, #d4f5f3);
}

.ccr-glass-swatch {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.08);
}

.ccr-glass-name {
    font-weight: 600;
    font-size: 0.82em;
    color: #333;
    line-height: 1.2;
}

/* === COLOR PERFILES OPTIONS === */
.ccr-color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.ccr-color-option {
    cursor: pointer;
}

.ccr-color-option input {
    display: none;
}

.ccr-color-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 12px;
    transition: border-color 0.2s, background 0.2s;
}

.ccr-color-option:hover .ccr-color-btn {
    border-color: #b2dfdb;
    background: #fafffe;
}

.ccr-color-option.selected .ccr-color-btn {
    border-color: #2AB9AD;
    background: linear-gradient(135deg, #e8faf9, #d4f5f3);
}

.ccr-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
}

.ccr-color-name {
    font-weight: 600;
    font-size: 0.82em;
    color: #333;
}

/* === LOCATION OPTIONS === */
.ccr-location-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.ccr-location-option {
    cursor: pointer;
}

.ccr-location-option input {
    display: none;
}

.ccr-location-card {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 14px;
    transition: border-color 0.2s, background 0.2s;
}

.ccr-location-option:hover .ccr-location-card {
    border-color: #b2dfdb;
}

.ccr-location-option.selected .ccr-location-card {
    border-color: #2AB9AD;
    background: linear-gradient(135deg, #e8faf9, #d4f5f3);
}

.ccr-location-icon {
    font-size: 1.4em;
}

.ccr-location-name {
    font-weight: 600;
    font-size: 0.85em;
    color: #333;
}

/* === OPCIONES ADICIONALES (lado puerta + techo) === */
.ccr-options-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.ccr-option-group {
    flex: 1;
    min-width: 0;
}

.ccr-option-label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

/* Lado puerta */
.ccr-side-options {
    display: flex;
    gap: 8px;
}

.ccr-side-option {
    flex: 1;
    cursor: pointer;
}

.ccr-side-option input {
    display: none;
}

.ccr-side-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    font-size: 0.82em;
    font-weight: 600;
    color: #666;
}

.ccr-side-option:hover .ccr-side-btn {
    border-color: #b2dfdb;
    background: #fafffe;
}

.ccr-side-option.selected .ccr-side-btn {
    border-color: #2AB9AD;
    background: linear-gradient(135deg, #e8faf9, #d4f5f3);
    color: #000065;
}

/* Techo */
.ccr-techo-options {
    display: flex;
    gap: 8px;
}

.ccr-techo-option {
    flex: 1;
    cursor: pointer;
}

.ccr-techo-option input {
    display: none;
}

.ccr-techo-btn {
    display: block;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: 35px;
    padding: 10px 14px;
    font-size: 0.82em;
    font-weight: 600;
    color: #666;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.ccr-techo-option:hover .ccr-techo-btn {
    border-color: #b2dfdb;
    background: #fafffe;
}

.ccr-techo-option.selected .ccr-techo-btn {
    border-color: #2AB9AD;
    background: linear-gradient(135deg, #e8faf9, #d4f5f3);
    color: #000065;
}

/* === PASO LIBRE CHECKBOX === */
.ccr-paso-libre-wrap {
    margin-top: 16px;
}

.ccr-paso-libre-label {
    cursor: pointer;
    display: block;
}

.ccr-paso-libre-label input {
    display: none;
}

.ccr-paso-libre-card {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 14px 18px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.ccr-paso-libre-label:hover .ccr-paso-libre-card {
    border-color: #b2dfdb;
    background: #fafffe;
}

.ccr-paso-libre-label.checked .ccr-paso-libre-card {
    border-color: #2AB9AD;
    background: linear-gradient(135deg, #e8faf9, #d4f5f3);
    box-shadow: 0 2px 8px rgba(42, 185, 173, 0.15);
}

.ccr-paso-libre-icon {
    flex-shrink: 0;
}

.ccr-paso-libre-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ccr-paso-libre-name {
    font-weight: 600;
    font-size: 0.9em;
    color: #333;
}

.ccr-paso-libre-desc {
    font-size: 0.75em;
    color: #888;
    margin-top: 2px;
}

.ccr-paso-libre-tick {
    width: 28px;
    height: 28px;
    border: 2px solid #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    color: transparent;
    flex-shrink: 0;
    transition: all 0.2s;
}

.ccr-paso-libre-label.checked .ccr-paso-libre-tick {
    background: #2AB9AD;
    border-color: #2AB9AD;
    color: #fff;
}

/* === RESUMEN TECNICO === */
.ccr-summary {
    background: linear-gradient(135deg, #f8fffe, #edf9f8);
    border: 1px solid #b2dfdb;
    border-radius: 12px;
    padding: 16px;
}

.ccr-summary-title {
    font-size: 0.82em;
    font-weight: 700;
    color: #000065;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 12px;
}

.ccr-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.ccr-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.ccr-summary-label {
    font-size: 0.82em;
    color: #666;
}

.ccr-summary-value {
    font-size: 0.85em;
    font-weight: 700;
    color: #333;
}

/* === DROPZONE (FOTOS) === */
.ccr-dropzone {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.ccr-dropzone:hover {
    border-color: #2AB9AD;
    background: #f5fffe;
}

.ccr-dropzone.dragover {
    border-color: #2AB9AD;
    background: #e8faf9;
    border-style: solid;
}

.ccr-dropzone-inner {
    pointer-events: none;
}

.ccr-dropzone-icon {
    font-size: 2em;
    display: block;
    margin-bottom: 8px;
}

.ccr-dropzone-text {
    font-size: 0.9em;
    color: #555;
    margin: 0 0 4px 0;
}

.ccr-dropzone-link {
    color: #2AB9AD;
    font-weight: 600;
    text-decoration: underline;
}

.ccr-dropzone-hint {
    font-size: 0.75em;
    color: #999;
    margin: 0;
}

.ccr-photo-thumbs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.ccr-photo-thumbs:empty {
    display: none;
}

.ccr-photo-thumb {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    border: 2px solid #e0e0e0;
    overflow: hidden;
}

.ccr-photo-thumb.loading {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ccr-photo-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: #2AB9AD;
    border-radius: 50%;
    animation: ccr-spin 0.8s linear infinite;
}

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

.ccr-photo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(229, 57, 53, 0.85);
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s;
}

.ccr-photo-thumb:hover .ccr-photo-remove {
    opacity: 1;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .ccr-summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .ccr-system-options {
        grid-template-columns: 1fr 1fr;
    }

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

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

@media (max-width: 600px) {
    .ccr-measures-row {
        flex-direction: column;
    }

    .ccr-hojas-info {
        flex: none;
        flex-direction: row;
        gap: 10px;
        padding: 10px 16px;
    }

    .ccr-hojas-num {
        font-size: 1.4em;
    }

    .ccr-options-row {
        flex-direction: column;
    }

    .ccr-summary-grid {
        grid-template-columns: 1fr;
    }

    .ccr-system-options {
        grid-template-columns: 1fr;
    }

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

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

    .ccr-location-options {
        grid-template-columns: 1fr;
    }

    .ccr-section-content {
        padding: 12px;
    }

    .ccr-techo-options {
        flex-direction: column;
    }
}

@media (max-width: 400px) {
    .ccr-summary {
        padding: 12px;
    }

    .ccr-preview {
        padding: 10px;
    }

    .ccr-side-options {
        flex-direction: column;
    }
}
