/* ==========================================
   ESTILOS PERSONALIZADOS
   ========================================== */

/* Optimizacion global para mobile */
*,
*::before,
*::after {
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior-y: none;
}

/* Botones */
.btn-primary {
    background: linear-gradient(135deg, #5D5CDE, #4c4bcc);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4c4bcc, #3d3cb8);
}

.btn-primary:active {
    background: linear-gradient(135deg, #3d3cb8, #3332a8);
}

.input-focus {
    transition: box-shadow 0.15s ease;
}

.input-focus:focus {
    box-shadow: 0 0 0 3px rgba(93, 92, 222, 0.1);
}

/* Inputs: prevenir zoom en iOS */
input[type="text"],
input[type="tel"],
input[type="number"],
textarea,
select {
    font-size: 16px !important;
}

/* Estilos para descripcion adaptable tipo WhatsApp */
.descripcion-adaptable {
    resize: none;
    transition: height 0.15s ease;
    min-height: 2.5rem;
    line-height: 1.5;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.descripcion-adaptable::-webkit-scrollbar {
    display: none;
    width: 0;
    background: transparent;
}

.descripcion-comprimida {
    height: 2.5rem !important;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    overflow-y: hidden;
}

.descripcion-expandida {
    white-space: normal;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 7.5rem;
}

/* Estilos para imagen de producto */
.imagen-producto-container {
    position: relative;
    margin-top: 0.5rem;
}

.imagen-preview {
    width: 100%;
    max-height: 120px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 2px solid #e5e7eb;
}

.dark .imagen-preview {
    border-color: #4b5563;
}

.imagen-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.imagen-placeholder:hover {
    border-color: #5D5CDE;
    background: rgba(93, 92, 222, 0.05);
}

.dark .imagen-placeholder {
    border-color: #4b5563;
}

.dark .imagen-placeholder:hover {
    border-color: #5D5CDE;
}

.btn-remove-img {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* PWA standalone: ajustar para safe areas */
@supports (padding: env(safe-area-inset-bottom)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Seleccion de usuario: evitar seleccion accidental en botones */
button,
[role="button"] {
    user-select: none;
    -webkit-user-select: none;
}