/* CARRITO HEADER */
  .carrito-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #2a2a4a;
    padding-bottom: 6px;
    margin-bottom: 8px;
  }

  .carrito-label { font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, 0.7); }

  #producto-actual {
    background: #12121f;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 8px;
    font-size: 15px;
    min-height: 44px;
    color: rgba(255, 255, 255, 0.7);
  }

  #producto-actual.vacio {
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .carrito-quitar {
    color: #ff8a80;
    cursor: pointer;
    font-weight: 500;
    padding: 0 4px;
    flex-shrink: 0;
  }

  .carrito-total {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 2px solid #ce93d8;
    font-weight: 500;
    font-size: 15px;
    color: #81c784;
  }

  /* DETALLES */
  .detalles-label {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid #2a2a4a;
    padding-bottom: 6px;
    margin-top: 10px;
    margin-bottom: 8px;
  }

  .detalles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .detalles-group { display: flex; flex-direction: column; }

  .detalles-group label {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    display: block;
    margin-bottom: 3px;
  }

  .detalles-group select,
  .detalles-group input {
    width: 100%;
    font-size: 15px;
    padding: 5px 6px;
    border: 2px solid #2a2a4a;
    border-radius: 8px;
    background: #12121f;
    color: rgba(255, 255, 255, 0.7);
  }

  .descuento-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .descuento-wrapper span { font-size: 15px; color: rgba(255, 255, 255, 0.7); flex-shrink: 0; }
  .descuento-wrapper input { flex: 1; }

  .checkboxes-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 4px;
  }

  .checkbox-label {
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
  }

  .producto-cliente-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
  }
  .producto-cliente-label:hover {
    color: rgba(255, 255, 255, 0.9);
  }

  /* BOTONES DEL CARRITO */
  .carrito-header-btns {
    display: flex;
    gap: 6px;
    align-items: center;
  }

  /* MODAL PDF */
  #modal-preview {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
  }
  #modal-preview.active { display: flex; }

  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

  .modal-contenido {
    background: #1a1a2e;
    width: 340px;
    max-width: 95vw;
    height: 92%;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    border: 1px solid #2a2a4a;
  }

  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #6a1b9a;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
  }
  .modal-header h3 { margin: 0; font-size: 17px; font-weight: 500; }

  .modal-cerrar {
    background: rgba(255,255,255,0.15);
    border: none;
    color: rgba(255, 255, 255, 0.9);
    width: 32px; height: 32px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
  }
  .modal-cerrar:hover { background: rgba(255,255,255,0.3); }

  .modal-body {
    flex: 1;
    overflow: hidden;
    background: #0d0d0d;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  #pdf-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
  }
  #pdf-cargando {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  /* ═══════════════════════════════════════════════════════════════
     PANEL EXPANDIDO: Seguimiento, Cantidad, Descuento, Garantía
     ═══════════════════════════════════════════════════════════════ */
  
  /* Select de seguimiento del producto */
  #producto-actual select[id^="seguimiento-item-"] {
    background: #12121f;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid #2a2a4a;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 15px;
  }
  #producto-actual select[id^="seguimiento-item-"] option {
    background: #12121f;
    color: rgba(255, 255, 255, 0.7);
  }
  #producto-actual select[id^="seguimiento-item-"]:focus {
    border-color: #ce93d8;
    outline: none;
  }

  /* Input cantidad */
  #producto-actual input[id^="cantidad-item-"] {
    background: #12121f;
    color: #e0e0e0;
    border: 1px solid #2a2a4a;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 15px;
    text-align: center;
  }
  #producto-actual input[id^="cantidad-item-"]:focus {
    border-color: #ce93d8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(206, 147, 216, 0.2);
  }

  /* Input descuento + select tipo descuento */
  #producto-actual input[id^="desc-item-"],
  #producto-actual select[id^="desc-tipo-item-"] {
    background: #12121f;
    color: #e0e0e0;
    border: 1px solid #2a2a4a;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 15px;
    text-align: center;
    height: 32px;
    box-sizing: border-box;
  }
  #producto-actual input[id^="desc-item-"]:focus,
  #producto-actual select[id^="desc-tipo-item-"]:focus {
    border-color: #ce93d8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(206, 147, 216, 0.2);
  }
  #producto-actual select[id^="desc-tipo-item-"] option {
    background: #12121f;
    color: rgba(255, 255, 255, 0.7);
  }

  /* Input duración garantía + select unidad */
  #producto-actual input[onchange^="actualizarGarantiaItem"],
  #producto-actual select[onchange^="actualizarGarantiaItem"] {
    background: #12121f;
    color: #e0e0e0;
    border: 1px solid #2a2a4a;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 12px;
    text-align: center;
    box-sizing: border-box;
  }
  #producto-actual select[onchange^="actualizarGarantiaItem"] {
    height: 29px;
  }
  #producto-actual input[onchange^="actualizarGarantiaItem"]:focus,
  #producto-actual select[onchange^="actualizarGarantiaItem"]:focus {
    border-color: #ce93d8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(206, 147, 216, 0.2);
  }
  #producto-actual select[onchange^="actualizarGarantiaItem"] option {
    background: #12121f;
    color: rgba(255, 255, 255, 0.7);
  }
