/* =========================================
   DOYPACK MOCKUP - LAYOUT HORIZONTAL
   Preview + Controles (izquierda) | Configurator (derecha)
   ========================================= */

:root {
    --doy-primary: #FA5373;
    --doy-primary-light: rgba(250, 83, 115, 0.1);
    --doy-dark: #1a1a1a;
    --doy-gray-bg: #f5f5f5;
    --doy-gray-light: #fafafa;
    --doy-border: #e0e0e0;
    --doy-text: #333;
    --doy-text-muted: #666;
    --doy-radius: 8px;
    --doy-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.doypack-page-layout,
.doypack-page-layout * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ========== LAYOUT PRINCIPAL ========== */
.doypack-page-layout {
    display: flex;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--doy-text);
    background: #fff;
}

/* --- COLUMNA IZQUIERDA: PREVIEW + CONTROLES --- */
.doypack-preview-column {
    flex: 1 1 50%;
    min-width: 400px;
    background: var(--doy-gray-bg);
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Canvas Container - Proporciones correctas */
.doypack-canvas-container {
    width: 100%;
    max-width: 500px;
    height: 500px;
    background: #d0d0d0;
    border-radius: var(--doy-radius);
    box-shadow: var(--doy-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#doypack-mockup-canvas {
    max-width: 100%;
    max-height: 100%;
    cursor: grab;
}

#doypack-mockup-canvas:active {
    cursor: grabbing;
}

/* Loader */
.doypack-loader {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.doypack-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--doy-border);
    border-top-color: var(--doy-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* View Toggle */
.doypack-view-toggle {
    display: flex;
    background: #fff;
    padding: 4px;
    border-radius: 50px;
    box-shadow: var(--doy-shadow);
    margin: 20px 0;
}

.doypack-btn-toggle {
    padding: 10px 30px;
    border: none;
    background: transparent;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--doy-text-muted);
    transition: all 0.2s;
}

.doypack-btn-toggle.active {
    background: var(--doy-dark);
    color: #fff;
}

/* ========== PANEL DE CONTROLES ========== */
.doypack-controls-panel {
    width: 100%;
    max-width: 500px;
    background: #fff;
    border-radius: var(--doy-radius);
    padding: 20px;
    box-shadow: var(--doy-shadow);
}

.doypack-controls-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--doy-dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--doy-primary);
}

.doypack-control-group {
    margin-bottom: 15px;
}

.doypack-control-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--doy-dark);
    margin-bottom: 8px;
}

.doypack-control-icon {
    font-size: 1.1rem;
}

/* File Input */
.doypack-file-input {
    width: 100%;
    padding: 10px;
    border: 2px dashed var(--doy-border);
    border-radius: var(--doy-radius);
    background: var(--doy-gray-light);
    cursor: pointer;
    font-size: 0.9rem;
}

.doypack-file-input:hover {
    border-color: var(--doy-primary);
}

.doypack-file-name {
    font-size: 0.8rem;
    color: var(--doy-text-muted);
    margin-top: 5px;
    font-style: italic;
}

/* Color Row */
.doypack-color-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: var(--doy-gray-light);
    border-radius: var(--doy-radius);
    border: 1px solid var(--doy-border);
}

.doypack-color-row input[type="color"] {
    width: 50px;
    height: 35px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

.doypack-color-value {
    font-family: monospace;
    font-weight: 600;
    color: var(--doy-text-muted);
}

/* Zoom & Mode Buttons */
.doypack-zoom-buttons,
.doypack-mode-buttons {
    display: flex;
    gap: 8px;
}

.doypack-zoom-btn,
.doypack-mode-btn {
    padding: 10px 15px;
    border: 1px solid var(--doy-border);
    border-radius: var(--doy-radius);
    background: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.doypack-zoom-btn:hover,
.doypack-mode-btn:hover {
    border-color: var(--doy-primary);
    color: var(--doy-primary);
}

.doypack-mode-btn.active {
    background: var(--doy-dark);
    color: #fff;
    border-color: var(--doy-dark);
}

/* Range */
.doypack-range {
    width: 100%;
}

/* Instructions */
.doypack-instructions {
    background: var(--doy-gray-light);
    padding: 12px;
    border-radius: var(--doy-radius);
    margin-bottom: 15px;
}

.doypack-instructions p {
    font-size: 0.85rem;
    color: var(--doy-text-muted);
    margin-bottom: 5px;
}

.doypack-instructions p:last-child {
    margin-bottom: 0;
}

/* Download Button */
.doypack-download-btn {
    width: 100%;
    padding: 12px;
    background: var(--doy-dark);
    color: #fff;
    border: none;
    border-radius: var(--doy-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.doypack-download-btn:hover {
    background: #333;
}

/* --- COLUMNA DERECHA: CONFIGURADOR --- */
.doypack-configurator-column {
    flex: 1 1 50%;
    min-width: 350px;
    padding: 30px;
    overflow-y: auto;
    max-height: 100vh;
}

/* Secciones */
.doypack-config-section {
    margin-bottom: 20px;
}

.doypack-section-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--doy-dark);
}

/* Card Selector Grid */
.doypack-card-selector-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.doypack-card {
    cursor: pointer;
}

.doypack-card input {
    display: none;
}

.doypack-card-inner {
    border: 2px solid var(--doy-border);
    border-radius: var(--doy-radius);
    padding: 15px 10px;
    text-align: center;
    transition: all 0.2s;
    background: #fff;
}

.doypack-card:hover .doypack-card-inner {
    border-color: var(--doy-primary);
}

.doypack-card input:checked+.doypack-card-inner {
    border-color: var(--doy-primary);
    background: var(--doy-primary-light);
}

.doypack-card-icon {
    display: block;
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.doypack-card-img {
    display: block;
    width: 70px;
    height: 70px;
    object-fit: contain;
    margin: 0 auto 8px;
}

/* Imagen de referencia para Muesca Abrefácil */
.doypack-ref-img {
    display: block;
    width: 100%;
    max-height: 40px;
    object-fit: cover;
    object-position: center;
    border-radius: var(--doy-radius);
    margin-bottom: 8px;
    border: 1px solid var(--doy-border);
}

/* Imagen dentro del botón Tipo Sombrero */
.doypack-hole-img {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin: 0 auto 4px;
}

/* Card especial de Muesca Abrefácil */
.doypack-card-inner--muesca {
    cursor: default;
}

.doypack-muesca-toggle {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 8px;
}

.doypack-muesca-opt {
    cursor: pointer;
}

.doypack-muesca-opt input {
    display: none;
}

.doypack-muesca-opt span {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid var(--doy-border);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    background: #fff;
    transition: all 0.2s;
}

.doypack-muesca-opt:hover span {
    border-color: var(--doy-primary);
    color: var(--doy-primary);
}

.doypack-muesca-opt input:checked+span {
    background: var(--doy-primary);
    border-color: var(--doy-primary);
    color: #fff;
}

.doypack-card-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--doy-dark);
}

/* Grid 2 Columnas */
.doypack-config-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

/* Grid 3 Columnas: Medidas, Material, Cantidad */
.doypack-config-grid-3 {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.8fr;
    gap: 12px;
    margin-bottom: 20px;
}

/* Grid 4 columnas: Hang Hole + Muesca */
.doypack-card-selector-grid--4col {
    grid-template-columns: repeat(4, 1fr);
}

.doypack-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doypack-input-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--doy-dark);
}

.doypack-input-group select,
.doypack-input-group input {
    padding: 12px;
    border: 1px solid var(--doy-border);
    border-radius: var(--doy-radius);
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
}

.doypack-input-group select:focus,
.doypack-input-group input:focus {
    outline: none;
    border-color: var(--doy-primary);
}

/* Option Row */
.doypack-option-row {
    display: flex;
    gap: 10px;
}

.doypack-option-btn {
    flex: 1;
    cursor: pointer;
}

.doypack-option-btn.wide {
    flex: 1;
}

.doypack-option-btn input {
    display: none;
}

.doypack-option-btn span {
    display: block;
    padding: 12px 10px;
    border: 1px solid var(--doy-border);
    border-radius: var(--doy-radius);
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    background: #fff;
}

.doypack-option-btn:hover span {
    border-color: var(--doy-primary);
}

.doypack-option-btn input:checked+span {
    border-color: var(--doy-primary);
    background: var(--doy-primary-light);
    color: var(--doy-primary);
}

/* Promo Banner */
.doypack-promo-banner {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #e8f4ff 0%, #f0e8ff 100%);
    border-radius: var(--doy-radius);
    margin-bottom: 20px;
}

.doypack-banner-icon {
    font-size: 2rem;
}

.doypack-banner-text strong {
    display: block;
    font-size: 0.95rem;
    color: var(--doy-dark);
}

.doypack-banner-text p {
    margin-top: 3px;
    font-size: 0.8rem;
    color: var(--doy-text-muted);
}

/* Contact Form */
.doypack-contact-form {
    margin-bottom: 20px;
}

.doypack-contact-form input,
.doypack-contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--doy-border);
    border-radius: var(--doy-radius);
    font-size: 0.95rem;
    font-family: inherit;
    margin-bottom: 10px;
}

.doypack-contact-form input:focus,
.doypack-contact-form textarea:focus {
    outline: none;
    border-color: var(--doy-primary);
}

/* Actions Footer */
.doypack-actions-footer {
    margin-top: 20px;
}

.doypack-btn-primary-full {
    width: 100%;
    padding: 16px;
    background: var(--doy-primary);
    color: #fff;
    border: none;
    border-radius: var(--doy-radius);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s;
}

.doypack-btn-primary-full:hover {
    filter: brightness(1.1);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .doypack-page-layout {
        flex-direction: column;
    }

    .doypack-preview-column,
    .doypack-configurator-column {
        flex: 1 1 100%;
        min-width: 100%;
        max-height: none;
    }

    .doypack-preview-column {
        padding: 20px;
    }

    .doypack-canvas-container {
        height: 350px;
    }

    .doypack-configurator-column {
        padding: 20px;
    }

    .doypack-card-selector-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .doypack-config-grid-2 {
        grid-template-columns: 1fr;
    }

    .doypack-option-row {
        flex-wrap: wrap;
    }
}