
/* =====================================================
   SHOPYDAS - FORMULARIO DE PRODUCTOS
   Diseño responsive para PC, tablet y celular
===================================================== */

/* 1. VARIABLES GENERALES */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;

    --orange: #f59e0b;
    --orange-light: #fff7ed;

    --success: #059669;
    --success-light: #ecfdf5;

    --danger: #dc2626;

    --background: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;

    --text: #172339;
    --text-secondary: #64748b;
    --border: #e2e8f0;

    --radius-sm: 9px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --shadow: 0 5px 25px rgba(15, 23, 42, 0.045);
    --shadow-hover: 0 12px 35px rgba(15, 23, 42, 0.08);
}


/* 2. ESTILOS BASE */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

.app-container {
    min-height: 100vh;
}


/* =====================================================
   3. HEADER
===================================================== */

.app-header {
    width: 100%;
    min-height: 78px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;

    padding: 15px 5%;

    position: sticky;
    top: 0;
    z-index: 100;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 19px;
    min-width: 0;
}

.brand-logo {
    font-size: 27px;
    font-weight: 850;
    letter-spacing: -1.2px;
    white-space: nowrap;
}

.brand-logo span {
    color: #16243b;
}

.brand-logo strong {
    color: var(--orange);
}

.brand-divider {
    width: 1px;
    height: 27px;
    background: var(--border);
}

.header-section {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    padding: 10px 17px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;

    font-weight: 650;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-back span {
    font-size: 19px;
}

.btn-back:hover {
    background: var(--primary-light);
    border-color: #bfdbfe;
    color: var(--primary);
}


/* =====================================================
   4. CONTENIDO PRINCIPAL
===================================================== */

.main-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 38px 35px 70px;
}

.page-heading {
    margin-bottom: 30px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 11px;

    margin-bottom: 25px;
    color: var(--text-secondary);
    font-size: 13px;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb strong {
    color: var(--text);
    font-weight: 650;
}

.heading-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.page-eyebrow {
    display: block;
    margin-bottom: 7px;

    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.6px;
}

.page-heading h1 {
    margin: 0;
    font-size: clamp(25px, 3vw, 35px);
    font-weight: 800;
    letter-spacing: -1.1px;
    line-height: 1.2;
}

.page-heading p {
    color: var(--text-secondary);
    margin: 10px 0 0;
    font-size: 14px;
}

.heading-badge {
    display: flex;
    align-items: center;
    gap: 9px;

    background: var(--success-light);
    color: var(--success);

    border: 1px solid #a7f3d0;
    border-radius: 30px;
    padding: 9px 15px;

    font-weight: 700;
    white-space: nowrap;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}


/* =====================================================
   5. DISTRIBUCIÓN DEL FORMULARIO
===================================================== */

.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 25px;
    align-items: start;
}

.form-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.form-sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
}


/* =====================================================
   6. TARJETAS PRINCIPALES
===================================================== */

.form-card,
.sidebar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.form-card {
    transition: box-shadow 0.25s ease;
}

.form-card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;

    padding: 23px 27px;
    border-bottom: 1px solid var(--border);
}

.card-icon {
    width: 43px;
    height: 43px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--primary-light);
    color: var(--primary);

    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
}

.card-header h2 {
    font-size: 17px;
    line-height: 1.3;
    margin: 0;
    font-weight: 750;
}

.card-header p {
    margin: 5px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.card-body {
    padding: 27px;
}


/* =====================================================
   7. CAMPOS DEL FORMULARIO
===================================================== */

.form-group {
    margin-bottom: 23px;
    min-width: 0;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
}

.form-group label {
    display: block;
    margin-bottom: 9px;

    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.required {
    color: var(--danger);
    margin-left: 3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    display: block;
    width: 100%;
    min-width: 0;

    padding: 13px 15px;
    border: 1px solid #d9e1eb;
    border-radius: var(--radius-sm);

    background: #fff;
    color: var(--text);
    font-size: 14px;

    outline: none;
    transition: all 0.2s ease;
}

.form-group input,
.form-group select {
    min-height: 48px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #94a3b8;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #94a3b8;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.form-group textarea {
    min-height: 155px;
    resize: vertical;
    line-height: 1.7;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;

    padding-right: 38px;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 12px;
}

.field-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.field-footer small:last-child {
    white-space: nowrap;
}


/* =====================================================
   8. CAMPOS DE MONEDAS
===================================================== */

.input-currency {
    position: relative;
}

.currency-symbol {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);

    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 750;

    pointer-events: none;
    z-index: 1;
}

.input-currency input {
    padding-left: 37px;
}

.input-currency input[readonly] {
    background: var(--success-light);
    color: var(--success);
    font-weight: 800;
    border-color: #a7f3d0;
}

.input-success .currency-symbol {
    color: var(--success);
}

.profit-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;

    padding: 18px 20px;
    background: var(--success-light);

    border: 1px solid #d1fae5;
    border-radius: var(--radius-md);
}

.profit-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.profit-item span {
    color: #64748b;
    font-size: 12px;
}

.profit-item strong {
    font-size: 20px;
    font-weight: 800;
    color: var(--success);
}

.exchange-note {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 13px 0 0;
}


/* =====================================================
   9. SUBIR FOTOGRAFÍAS
===================================================== */

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
    padding: 45px 20px;

    background: var(--surface-soft);
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);

    transition: all 0.2s ease;
}

.upload-area:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 60px;
    height: 60px;

    margin-bottom: 15px;
    background: #dbeafe;
    border-radius: 16px;

    color: var(--primary);
    font-size: 32px;
    font-weight: 700;
}

.upload-area h3 {
    font-size: 16px;
    margin: 0 0 8px;
}

.upload-area p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0 0 20px;
}

.btn-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 11px 21px;
    border-radius: 10px;

    background: var(--primary);
    color: white;

    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-upload:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.upload-area small {
    color: var(--text-secondary);
    margin-top: 15px;
    font-size: 11px;
}


/* =====================================================
   10. VISTA PREVIA DE FOTOGRAFÍAS
===================================================== */

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 15px;

    margin-top: 20px;
}

.preview-grid:empty {
    display: none;
}

.preview-item {
    position: relative;
    aspect-ratio: 1 / 1;

    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.preview-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item:first-child {
    border: 2px solid var(--primary);
}


/* =====================================================
   11. PANEL LATERAL
===================================================== */

.sidebar-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    padding: 19px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-card-header h3 {
    font-size: 15px;
    font-weight: 750;
    margin: 0;
}

.status-draft {
    background: var(--orange-light);
    color: #b45309;

    border-radius: 25px;
    padding: 5px 11px;

    font-size: 11px;
    font-weight: 750;
}

.sidebar-card-body {
    padding: 20px;
}

.summary-thumbnail {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    aspect-ratio: 4 / 3;

    background: #f1f5f9;
    border-radius: 13px;
    overflow: hidden;

    color: #94a3b8;
    font-size: 13px;
}

.summary-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-card-body h4 {
    margin: 18px 0 4px;
    font-size: 17px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.sidebar-card-body > p {
    margin: 0 0 18px;
    color: var(--text-secondary);
    font-size: 12px;
}

.sidebar-price {
    background: var(--primary-light);
    padding: 16px;
    border-radius: 12px;

    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-price span {
    font-size: 12px;
    color: var(--text-secondary);
}

.sidebar-price strong {
    color: var(--primary);
    font-size: 27px;
    font-weight: 850;
}

.sidebar-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;

    margin-top: 17px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.sidebar-detail span {
    color: var(--text-secondary);
    font-size: 12px;
}

.sidebar-detail strong {
    color: var(--success);
    font-size: 15px;
}

.tips-card {
    padding: 23px;
}

.tips-card h3 {
    margin: 0 0 16px;
    font-size: 15px;
}

.tips-card ul {
    padding-left: 18px;
    margin: 0;
}

.tips-card li {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 12px;
}

.tips-card li:last-child {
    margin-bottom: 0;
}

.tips-card li::marker {
    color: var(--primary);
}


/* =====================================================
   12. BOTONES DE ACCIÓN
===================================================== */

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 13px;

    margin-top: 27px;
    padding: 22px 25px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.btn-cancel,
.btn-save {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;

    min-height: 47px;
    padding: 12px 24px;

    border-radius: 11px;
    font-size: 14px;
    font-weight: 750;

    transition: all 0.2s ease;
}

.btn-cancel {
    color: var(--text);
    background: white;
    border: 1px solid var(--border);
}

.btn-cancel:hover {
    background: #f1f5f9;
}

.btn-save {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
}

.btn-save:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(37, 99, 235, 0.2);
}

.btn-save span {
    font-size: 20px;
    line-height: 1;
}


/* =====================================================
   13. MENSAJES DEL SERVIDOR
===================================================== */

.alerta {
    padding: 15px 20px;
    margin-bottom: 24px;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface);
}

.alerta.success,
.alerta.exito {
    background: var(--success-light);
    border-color: #a7f3d0;
    color: #047857;
}

.alerta.error,
.alerta.danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.alerta.warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}


/* =====================================================
   14. ACCESIBILIDAD
===================================================== */

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.4);
    outline-offset: 3px;
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}


/* =====================================================
   15. RESPONSIVE - LAPTOP Y TABLET
===================================================== */

@media (max-width: 1100px) {

    .form-layout {
        grid-template-columns: minmax(0, 1fr) 270px;
        gap: 18px;
    }

    .main-content {
        padding: 30px 22px 60px;
    }

    .card-body {
        padding: 22px;
    }

    .card-header {
        padding: 20px 22px;
    }

}


/* =====================================================
   16. RESPONSIVE - TABLETS PEQUEÑAS
===================================================== */

@media (max-width: 850px) {

    .form-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .heading-content {
        align-items: flex-start;
    }

}


/* =====================================================
   17. RESPONSIVE - TELÉFONOS
===================================================== */

@media (max-width: 600px) {

    .app-header {
        min-height: 67px;
        padding: 12px 16px;
        gap: 10px;
    }

    .brand-logo {
        font-size: 23px;
    }

    .brand-divider,
    .header-section {
        display: none;
    }

    .btn-back {
        font-size: 12px;
        padding: 9px 12px;
    }

    .main-content {
        padding: 23px 13px 45px;
    }

    .breadcrumb {
        font-size: 11px;
        gap: 7px;
        margin-bottom: 18px;
    }

    .heading-content {
        flex-direction: column;
        gap: 15px;
    }

    .page-heading {
        margin-bottom: 23px;
    }

    .page-heading h1 {
        font-size: 26px;
    }

    .page-heading p {
        font-size: 13px;
    }

    .heading-badge {
        font-size: 11px;
        padding: 7px 12px;
    }

    .form-main {
        gap: 17px;
    }

    .form-card,
    .sidebar-card {
        border-radius: 15px;
    }

    .card-header {
        gap: 12px;
        padding: 18px;
    }

    .card-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .card-header h2 {
        font-size: 15px;
    }

    .card-header p {
        font-size: 11px;
    }

    .card-body {
        padding: 19px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

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

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
    }

    .profit-summary {
        grid-template-columns: 1fr 1fr;
        padding: 15px;
        gap: 12px;
    }

    .profit-item strong {
        font-size: 18px;
    }

    .upload-area {
        padding: 33px 15px;
    }

    .upload-area h3 {
        font-size: 14px;
    }

    .preview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 9px;
    }

    .form-sidebar {
        grid-template-columns: 1fr;
        gap: 17px;
    }

    .form-actions {
        padding: 15px;
        gap: 10px;
    }

    .btn-cancel,
    .btn-save {
        flex: 1;
        padding: 12px;
        font-size: 13px;
    }

}


/* =====================================================
   18. PANTALLAS MUY PEQUEÑAS
===================================================== */

@media (max-width: 360px) {

    .brand-logo {
        font-size: 21px;
    }

    .page-heading h1 {
        font-size: 23px;
    }

    .card-body {
        padding: 15px;
    }

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

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn-save,
    .btn-cancel {
        width: 100%;
    }

}


/* =====================================================
   19. REDUCCIÓN DE ANIMACIONES
===================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

}
