/* ==========================================================================
   1. VARIABLES Y BASE
   ========================================================================== */
:root {
    --primary-color: #0d6efd;
    --sidebar-bg: #212529;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    font-size: 0.9rem;
    color: #333;
    margin: 0;
    padding: 0;
}

.fw-black { font-weight: 900; }

/* ==========================================================================
   2. LAYOUT Y OFFCANVAS (Menú Lateral)
   ========================================================================== */
.main-content {
    /* padding: 20px; */
    min-height: 100vh;
    width: 100%;
}

.offcanvas {
    background-color: var(--sidebar-bg) !important;
    color: #fff !important;
}

.offcanvas .nav-link {
    color: #fff !important;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: 0.2s;
}

.offcanvas .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.offcanvas .nav-link.active {
    background-color: var(--primary-color) !important;
}

.navbar { z-index: 1040; }
.navbar-brand { font-weight: 900; letter-spacing: -1px; }
.navbar-brand .brand-logo-admin.brand-logo-wrap {
    min-height: 36px;
}

.navbar-brand .brand-logo-admin .brand-logo-img,
.navbar-brand .brand-logo-img.brand-logo-admin,
.navbar-brand .brand-logo-img {
    max-height: 40px;
}

/* ==========================================================================
   3. COMPONENTES (Glassmorphism & UI)
   ========================================================================== */
.glass-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    height: 100%;
}

.glass-card:hover {
    transform: translateY(-5px);
}

.brand-rs { color: #ffffff; font-weight: 900; }
.brand-trunk { color: var(--primary-color); font-weight: 900; }

.brand-logo-wrap {
    display: inline-flex;
    align-items: center;
}

.brand-logo-img {
    height: 34px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

.brand-logo-text {
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #ffffff;
    background: linear-gradient(90deg, #ffffff 0%, #8ec5ff 60%, #6be2c8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Gestión de Imágenes */
.image-upload-container { position: relative; width: 140px; height: 140px; margin: 0 auto 20px; }
.image-preview-wrapper { 
    width: 100%; height: 100%; border-radius: 20px; border: 3px solid var(--primary-color);
    background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.image-preview-wrapper img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }

.camera-icon-badge {
    position: absolute; bottom: -5px; right: -5px; background: var(--primary-color);
    color: white; width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; border: 3px solid #fff;
}

.img-pala { width: 45px; height: 45px; object-fit: contain; background: #fff; border: 1px solid #dee2e6; border-radius: 8px; }
.img-pala.product-preview-trigger { cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.img-pala.product-preview-trigger:hover { transform: scale(1.08); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12); }
.fila-discontinuo { opacity: 0.5; filter: grayscale(100%); }
input[type="file"]#foto-editar, input[type="file"]#foto-nuevo { display: none; }

/* Vista de producto */
.product-preview-modal {
    border: 0;
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(180deg, #fdfdfd 0%, #f7f7f7 100%);
}

.preview-image-wrap {
    background: linear-gradient(160deg, #f3efe9 0%, #ebe7e1 100%);
    border-radius: 18px;
    padding: 10px;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image-wrap img {
    max-width: 100%;
    max-height: 260px;
    object-fit: contain;
}

.preview-category {
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #6f6f6f;
    font-weight: 500;
}

.preview-title {
    font-size: 2rem;
    line-height: 1.05;
    letter-spacing: 1px;
    color: #2b2b2b;
    font-weight: 300;
}

.preview-brand {
    color: #3d3d3d;
    font-weight: 600;
    text-transform: uppercase;
}

.preview-prices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.preview-prices small {
    color: #767676;
    display: block;
}

.preview-prices h4 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 700;
    color: #101010;
}

.preview-chip {
    border: 1px solid #d7d7d7;
    border-radius: 10px;
    background: #fff;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-chip span {
    color: #707070;
    font-size: 0.85rem;
}

.preview-chip strong {
    font-size: 1rem;
    color: #232323;
}

.preview-status-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-etiqueta-comercial {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    letter-spacing: 0.2px;
    font-weight: 700;
    line-height: 1;
}

.badge-etiqueta-icon {
    width: 1.2rem;
    height: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    font-size: 0.72rem;
}

.badge-etiqueta-text {
    display: inline-block;
}

.badge-etiqueta-modal {
    font-size: 0.85rem;
}

.ahorro-label {
    display: inline-block;
    font-weight: 700;
}

.ahorro-label-destacado {
    color: #0f5132;
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.18), rgba(255, 193, 7, 0.22));
    border: 1px solid rgba(25, 135, 84, 0.28);
    border-radius: 999px;
    padding: 0.18rem 0.6rem;
    box-shadow: 0 4px 10px rgba(25, 135, 84, 0.2);
}

.rs-modal-feedback {
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

.rs-modal-feedback.alert-success {
    color: #d1f7e0;
    background: rgba(25, 135, 84, 0.28);
    border-color: rgba(141, 240, 187, 0.45);
}

.rs-modal-feedback.alert-danger {
    color: #ffe0e0;
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(255, 167, 176, 0.52);
}

.rs-modal-feedback.alert-warning {
    color: #fff0cc;
    background: rgba(255, 193, 7, 0.24);
    border-color: rgba(255, 224, 138, 0.45);
}

.badge-etiqueta-animada {
    animation: badgePulse 2.2s ease-in-out infinite;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

@keyframes badgePulse {
    0%, 100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
    }
    50% {
        transform: translateY(-1px) scale(1.04);
        box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
    }
}

@media (max-width: 768px) {
    .preview-title { font-size: 1.8rem; }
}

/* ==========================================================================
   4. RESPONSIVE
   ========================================================================== */
@media (max-width: 576px) {
    .form-control, .form-select { font-size: 16px !important; padding: 12px; }
    .btn-agregar-text { display: none; }
}

/* form usuarios */

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}