﻿/* Estilos del Personalizador de Lonas - Paleta Neutra adaptable a WooCommerce */
:root {
    --fg-primary: #1f2937;        /* Gris CarbÃ³n Neutro */
    --fg-primary-dark: #111827;   /* CarbÃ³n Oscuro Hover */
    --fg-secondary: #374151;      /* Acento Neutro BotÃ³n Principal */
    --fg-secondary-hover: #1f2937;
    --fg-accent: #4b5563;         /* Gris Medio / Detalles */
    --fg-bg: #f8fafc;             /* Fondo limpio / armonioso con WooCommerce */
    --fg-card-bg: #ffffff;        /* Tarjetas Blancas elegantes */
    --fg-border: #e2e8f0;         /* Bordes suaves */
    --fg-border-dark: #cbd5e1;
    --fg-text: #1e293b;           /* Texto grafito oscuro de alta legibilidad */
    --fg-text-muted: #64748b;     /* Texto secundario */
    --fg-radius: 12px;
}

.fg-lonas-container {
    max-width: 1240px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--fg-text);
    background: #ffffff;
    padding: 2.5rem;
    border-radius: var(--fg-radius);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--fg-border);
}

.fg-lonas-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.fg-lonas-badge {
    display: inline-block;
    background: rgba(31, 41, 55, 0.08);
    color: var(--fg-primary);
    border: 1px solid rgba(31, 41, 55, 0.2);
    padding: 0.4rem 1.2rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.fg-lonas-title {
    font-size: 2.3rem;
    font-weight: 800;
    color: var(--fg-primary);
    margin: 0 0 0.8rem 0;
    line-height: 1.2;
}

.fg-lonas-subtitle {
    color: var(--fg-text-muted);
    font-size: 1.05rem;
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.6;
}

/* GRID PRINCIPAL */
.fg-lonas-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 2.2rem;
    align-items: start;
}

@media (max-width: 950px) {
    .fg-lonas-grid {
        grid-template-columns: 1fr;
    }
}

/* CARDS DE CONFIGURACIÃ“N */
.fg-lonas-card {
    background: #ffffff;
    border: 1px solid var(--fg-border);
    border-radius: var(--fg-radius);
    padding: 1.8rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.fg-lonas-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.07);
}

.fg-card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--fg-primary);
    margin-bottom: 1.4rem;
}

.fg-step {
    background: var(--fg-primary);
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(31, 41, 55, 0.35);
}

/* SELECTOR DE UNIDADES */
.fg-units-switch {
    display: flex;
    background: #f1f5f9;
    padding: 0.3rem;
    border-radius: 8px;
    margin-bottom: 1.2rem;
    border: 1px solid var(--fg-border);
}

.fg-unit-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--fg-text-muted);
    padding: 0.55rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.fg-unit-btn.active {
    background: var(--fg-primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(31, 41, 55, 0.25);
}

/* INPUTS DE MEDIDAS */
.fg-inputs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.fg-field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.5rem;
}

.fg-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.fg-input-wrap input,
.fg-field select,
.fg-field textarea,
.fg-external-link-wrap input {
    width: 100%;
    background: #ffffff;
    border: 1.5px solid var(--fg-border);
    color: #1e293b;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    box-sizing: border-box;
    transition: all 0.2s;
}

.fg-input-wrap input:focus,
.fg-field select:focus,
.fg-field textarea:focus,
.fg-external-link-wrap input:focus {
    border-color: var(--fg-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 41, 55, 0.15);
}

.fg-input-suffix {
    position: absolute;
    right: 1rem;
    color: var(--fg-text-muted);
    font-size: 0.95rem;
    font-weight: 700;
    pointer-events: none;
}

.fg-stats-badge {
    display: flex;
    justify-content: space-between;
    background: rgba(31, 41, 55, 0.05);
    border: 1px solid rgba(31, 41, 55, 0.15);
    padding: 0.85rem 1.2rem;
    border-radius: 8px;
    margin-top: 1.2rem;
    font-size: 0.95rem;
    color: var(--fg-primary);
    font-weight: 600;
}

.fg-stats-badge strong {
    color: var(--fg-primary);
    font-weight: 800;
}

/* MATERIALES RADIO */
.fg-materiales-list {
    display: grid;
    gap: 0.75rem;
}

.fg-radio-card {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.2rem;
    background: #f8fafc;
    border: 1.5px solid var(--fg-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.fg-radio-card:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.fg-radio-card.selected {
    border-color: var(--fg-secondary);
    background: rgba(55, 65, 81, 0.05);
}

.fg-radio-card input[type="radio"] {
    margin-right: 1rem;
    width: 18px;
    height: 18px;
    accent-color: var(--fg-secondary);
}

.fg-radio-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.fg-radio-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}

.fg-radio-extra {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--fg-secondary);
}

.fg-radio-extra.fg-included {
    color: #16a34a;
    font-size: 0.8rem;
}

/* SUBIDA DE ARCHIVO */
.fg-upload-box {
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.fg-upload-box:hover,
.fg-upload-box.dragover {
    border-color: var(--fg-primary);
    background: rgba(31, 41, 55, 0.04);
}

.fg-upload-box input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.fg-upload-icon {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.fg-upload-text strong {
    font-size: 1rem;
    color: #1e293b;
    display: block;
    margin-bottom: 0.3rem;
}

.fg-upload-text p {
    font-size: 0.82rem;
    color: var(--fg-text-muted);
    margin: 0;
}

.fg-file-preview {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(31, 41, 55, 0.08);
    border: 1px solid rgba(31, 41, 55, 0.2);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--fg-primary);
    text-align: left;
    font-weight: 600;
}

.fg-external-link-wrap {
    margin-top: 1.2rem;
}

.fg-external-link-wrap label {
    display: block;
    font-size: 0.85rem;
    color: var(--fg-text-muted);
    margin-bottom: 0.4rem;
}

/* COLUMNA DERECHA: PREVIEW Y RESUMEN */
.fg-lonas-sidebar {
    position: sticky;
    top: 2rem;
}

/* ESTUDIO DE DISEÃ‘O EN VIVO */
.fg-preview-panel {
    background: #ffffff;
    border: 1px solid var(--fg-border);
    border-radius: var(--fg-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.04);
}

.fg-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--fg-border);
}

.fg-preview-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fg-preview-header-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--fg-primary);
}

.fg-preview-header .badge {
    background: #e2e8f0;
    color: #475569;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* PRECIO VISIBLE EN LA VISTA PREVIA */
.fg-canvas-live-price {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(55, 65, 81, 0.08);
    border: 1px solid rgba(55, 65, 81, 0.25);
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
}

.fg-live-price-label {
    font-size: 0.8rem;
    color: var(--fg-text-muted);
    font-weight: 600;
}

.fg-canvas-live-price strong {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--fg-secondary);
}

/* TOOLBAR DE DISEÃ‘O */
.fg-canvas-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    background: #f8fafc;
    padding: 0.45rem;
    border-radius: 8px;
    border: 1px solid var(--fg-border);
}

.fg-tool-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.fg-tool-btn:hover {
    background: var(--fg-primary);
    border-color: var(--fg-primary);
    color: #ffffff;
}

.fg-tool-danger:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

.fg-canvas-color-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.fg-color-chip {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.2s;
}

.fg-color-chip.active,
.fg-color-chip:hover {
    transform: scale(1.15);
    border-color: var(--fg-primary);
    box-shadow: 0 0 0 2px rgba(31, 41, 55, 0.3);
}

/* LIENZO BANNER INTERACTIVO */
.fg-stage-canvas {
    background: #f1f5f9;
    min-height: 230px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow: hidden;
    position: relative;
    border: 1px solid #e2e8f0;
    user-select: none;
}

.fg-canvas-banner {
    background: #ffffff;
    border: 2px dashed #94a3b8;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    position: relative;
    width: 220px;
    height: 110px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s;
    overflow: hidden;
}

.fg-elements-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* ELEMENTOS ARRASTRABLES Y EDITABLES DENTRO DE LA LONA */
.fg-canvas-elem {
    position: absolute;
    cursor: move;
    display: inline-block;
    padding: 2px 6px;
    border: 1px dashed transparent;
    border-radius: 4px;
    transition: border-color 0.15s;
    user-select: text;
}

.fg-canvas-elem:hover,
.fg-canvas-elem.selected {
    border-color: var(--fg-secondary);
    background: rgba(55, 65, 81, 0.08);
}

.fg-elem-content {
    outline: none;
    display: inline-block;
    white-space: pre-wrap;
    line-height: 1.1;
}

.fg-elem-del {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.fg-canvas-elem:hover .fg-elem-del {
    display: flex;
}

/* ETIQUETA DE PRECIO EN LA LONA */
.fg-elem-price-tag {
    background: var(--fg-secondary);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 900;
    font-size: 17px;
    box-shadow: 0 3px 6px rgba(55, 65, 81, 0.3);
}

/* IMAGEN LOGO */
.fg-canvas-elem img {
    max-width: 75px;
    max-height: 75px;
    display: block;
    pointer-events: none;
}

.fg-canvas-dimension-w {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.78rem;
    color: var(--fg-primary);
    font-weight: 800;
}

.fg-canvas-dimension-h {
    position: absolute;
    left: -38px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.78rem;
    color: var(--fg-primary);
    font-weight: 800;
}

.fg-canvas-corner {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #cbd5e1;
    border: 1.5px solid #64748b;
    border-radius: 50%;
    z-index: 5;
}
.corner-tl { top: 4px; left: 4px; }
.corner-tr { top: 4px; right: 4px; }
.corner-bl { bottom: 4px; left: 4px; }
.corner-br { bottom: 4px; right: 4px; }

/* TARJETA DE RESUMEN DE COMPRA */
.fg-summary-card {
    background: #ffffff;
    border: 1px solid var(--fg-border);
    border-radius: var(--fg-radius);
    padding: 1.8rem;
    box-shadow: 0 6px 18px -4px rgba(0, 0, 0, 0.06);
}

.fg-summary-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--fg-primary);
    margin: 0 0 1.2rem 0;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 0.8rem;
}

.fg-summary-breakdown {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.fg-summary-breakdown li {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--fg-text-muted);
    margin-bottom: 0.65rem;
}

.fg-summary-breakdown li strong {
    color: #1e293b;
    font-weight: 700;
}

.fg-quantity-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    background: #f8fafc;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--fg-border);
}

.fg-quantity-selector label {
    font-weight: 700;
    font-size: 0.95rem;
    color: #334155;
}

.fg-qty-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fg-qty-btn {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #1e293b;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.fg-qty-btn:hover {
    background: var(--fg-primary);
    border-color: var(--fg-primary);
    color: #ffffff;
}

.fg-qty-controls input {
    width: 48px;
    text-align: center;
    background: transparent;
    border: none;
    color: #1e293b;
    font-weight: 800;
    font-size: 1.1rem;
}

.fg-total-box {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.5rem;
    padding-top: 1rem;
    border-top: 2px dashed #e2e8f0;
}

.fg-total-label {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--fg-primary);
}

.fg-total-price {
    font-size: 2.3rem;
    font-weight: 900;
    color: var(--fg-secondary);
    letter-spacing: -0.5px;
}

.fg-add-cart-btn {
    width: 100%;
    background: var(--fg-secondary);
    color: #ffffff;
    border: none;
    padding: 1.1rem 1.5rem;
    border-radius: 10px;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 8px 20px rgba(55, 65, 81, 0.35);
    transition: all 0.2s;
}

.fg-add-cart-btn:hover {
    background: var(--fg-secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(55, 65, 81, 0.45);
}

.fg-add-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.fg-guarantee-note {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--fg-text-muted);
    font-weight: 600;
}
