/* =====================================
   VISITS + DOSAGES (ALIGNED WITH OPERATIONS)
===================================== */

/* PAGE WRAPPER */
.services-page {
  padding: 0 8px 24px;
}

/* =====================================
   TOPBAR (same pattern as operations)
===================================== */

.services-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.services-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.services-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

/* =====================================
   LIST
===================================== */

.services-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* =====================================
   CARD (same language as operations-service-card)
===================================== */

.services-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: 0.15s ease;
}

.services-card:hover {
  background: #f9fafb;
}

.services-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.services-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.services-card-sub {
  font-size: 12px;
  color: #6b7280;
}

.services-card-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.services-card-status.active {
  background: #dcfce7;
  color: #166534;
}

.services-card-status.inactive {
  background: #fee2e2;
  color: #991b1b;
}

/* =====================================
   FORM
===================================== */

.services-form-section {
  margin-top: 18px;
}

.services-form-group {
  margin-bottom: 14px;
}

.services-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}

.services-form-group input,
.services-form-group select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #dcdcdc;
  font-size: 13px;
}

.services-form-group input:focus,
.services-form-group select:focus {
  border-color: var(--color-primary, #2563eb);
  outline: none;
}

/* =====================================
   SWITCH (reuse operations style)
===================================== */

.services-switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.services-switch-text {
  font-size: 14px;
  font-weight: 500;
}

/* reuse operations-switch class if exists */
.services-switch {
  position: relative;
  width: 42px;
  height: 24px;
}

.services-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.services-switch-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 999px;
  transition: 0.2s;
}

.services-switch-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 2px;
  top: 2px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

.services-switch input:checked + .services-switch-slider {
  background: var(--color-primary, #2563eb);
}

.services-switch input:checked + .services-switch-slider::before {
  transform: translateX(18px);
}

/* =====================================
   SECTIONS
===================================== */

.services-section-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: 0.15s ease;
}

.services-section-card:hover {
  background: #f9fafb;
}

/* =====================================
   EMPTY
===================================== */

.services-empty {
  text-align: center;
  padding: 24px;
  font-size: 14px;
  color: #9ca3af;
}

.select-with-gear {
  display: flex;
  gap: 6px;
  align-items: center;
}

.select-with-gear select {
  flex: 1;
}

.select-gear-btn {
  background: #fee2e2; /* rojo pendiente */
  border: none;
  color: #991b1b;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.select-gear-btn:hover {
  background: #fecaca;
}

.field-help-icon {
  margin-left: 6px;
  color: #6b7280;
  cursor: pointer;
  font-size: 14px;
}

.field-help-icon:hover {
  color: var(--color-primary, #2563eb);
}

.field-help-text {
  display: none;
  background: #f3f4f6;
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 8px;
  line-height: 1.4;
  color: #374151;
}

/* ==============================
   TEXTAREA STYLE
================================ */

.services-form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #dcdcdc;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 90px;
  box-sizing: border-box;
  transition:
    border 0.2s ease,
    box-shadow 0.2s ease;
}

.services-form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.services-form-group textarea::placeholder {
  color: #9ca3af;
}

/* ==============================
   SWITCH ROW LAYOUT
================================ */

.form-switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.switch-label {
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-switch-left {
  display: flex;
  align-items: center;
}

/* ==============================
   DOSAGE CARD FIX
============================== */

.operations-service-card {
  align-items: flex-start;
}

.dosage-card-left {
  flex: 1;
  padding-right: 12px;
}

.dosage-card-right {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
}

/* =========================
   DOSAGE RULES SECTION
========================= */

.operations-divider {
  margin: 24px 0;
  border: none;
  border-top: 1px solid #e5e5e5;
}

.dosage-rules-section {
  margin-top: 10px;
}

.dosage-rules-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dosage-rules-info {
  margin-top: 10px;
  font-size: 14px;
  color: #777;
}

.card-warning {
  border-left: 4px solid #ffc107;
  background-color: #fff8e1;
}

/* ==============================
   RULE GRID
================================ */

.rule-grid {
  margin-top: 8px;
}

.rule-label-row,
.rule-input-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.rule-label-row span {
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

.rule-input-row input {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #dcdcdc;
  font-size: 13px;
  text-align: center;
}

.card-warning {
  border-left: 4px solid #ffc107;
  background-color: #fff8e1;
}

/* =========================================
   PRODUCTS - CATEGORY CONTAINER
========================================= */

.products-category-container {
  margin-top: 10px;
}

/* =========================================
   CATEGORY BLOCK
========================================= */

.products-category-block {
  margin-bottom: 18px;
}

/* CATEGORY HEADER */
.products-category-header {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 4px;
  font-weight: 600;
  font-size: 13px;
  color: #1f2937;
  user-select: none;
}

.products-category-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.products-category-toggle-icon {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.products-category-block.collapsed .products-category-toggle-icon {
  transform: rotate(-90deg);
}

/* CATEGORY CONTENT */
.products-category-content {
  margin-top: 6px;
  overflow: hidden;
  transition:
    max-height 0.25s ease,
    opacity 0.25s ease;
}

.products-category-block.collapsed .products-category-content {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

/* =========================================
   PRODUCT CARD
========================================= */

.products-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: 0.15s ease;
  cursor: pointer;
}

.products-card:hover {
  background: #f9fafb;
}

.products-card.card-disabled {
  opacity: 0.5;
}

/* =========================================
   ROW 1 - TITLE + SWITCH
========================================= */

.products-card-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.products-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.products-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.products-product-code {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}
/* =========================================
   ROW 2 - DESCRIPTION
========================================= */

.products-card-description {
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
  line-height: 1.4;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================================
   ROW 3 - FOOTER GRID
========================================= */

.products-card-footer {
  margin-top: 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 8px;
}

.products-card-footer > div {
  display: flex;
  align-items: center;
}

.products-card-footer > div:nth-child(1) {
  justify-self: start;
}

.products-card-footer > div:nth-child(2) {
  justify-self: center;
}

.products-card-footer > div:nth-child(3) {
  justify-self: end;
}

/* BADGES */

.products-badge-category {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 20px;
  display: inline-flex;
  width: auto;
  white-space: nowrap;
}

.products-price-text {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.products-badge-taxable {
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* CATEGORY COLORS */

.products-category-chemicals {
  background: #e0f2fe;
  color: #0369a1;
}

.products-category-parts {
  background: #fef3c7;
  color: #92400e;
}

.products-category-equipment {
  background: #ede9fe;
  color: #6d28d9;
}

.products-category-uncategorized {
  background: #e5e7eb;
  color: #374151;
}

/* =========================================
   SWITCH (IPHONE STYLE)
========================================= */

.products-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.products-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.products-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #d1d5db;
  border-radius: 20px;
  transition: 0.2s;
}

.products-switch-slider:before {
  position: absolute;
  content: '';
  height: 14px;
  width: 14px;
  left: 3px;
  top: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
}

.products-switch input:checked + .products-switch-slider {
  background-color: #10b981;
}

.products-switch input:checked + .products-switch-slider:before {
  transform: translateX(18px);
}

/* BACK BUTTON */
.products-btn-back {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #ffffff;
}

/* =========================================
   PRODUCTS FORM - CARD BLOCK
========================================= */

.products-form-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.products-form-card-header {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #6b7280;
  margin-bottom: 16px;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 8px;
}

/* =========================================
   FIELD LABEL + HELP
========================================= */

.products-field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 13px;
  color: #374151;
}

.products-field-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 11px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #374151;
  cursor: pointer;
}

.products-field-tooltip {
  position: absolute;
  top: 22px;
  left: 0;
  width: 220px;
  background: #111827;
  color: #ffffff;
  font-size: 11px;
  padding: 8px 10px;
  border-radius: 6px;
  display: none;
  z-index: 10;
  line-height: 1.4;
}

.products-field-help.active .products-field-tooltip {
  display: block;
}

/* =========================================
   TEXTAREA STYLE
========================================= */

.products-textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
}

/* =========================================
   INLINE ROW (COST + PRICE)
========================================= */

.products-inline-row {
  display: flex;
  gap: 20px;
}

.products-inline-row .form-group {
  flex: 1;
}

/* =========================================
   READONLY PRICE
========================================= */

.products-readonly-input {
  background: #f9fafb;
  font-weight: 600;
  color: #111827;
}

.products-price-note {
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
}

/* =========================================
   SELECT + GEAR BUTTON
========================================= */

.products-select-with-gear {
  display: flex;
  gap: 6px;
  align-items: center;
}

.products-select-with-gear select {
  flex: 1;
}

.products-gear-btn {
  border: none;
  background: #f3f4f6;
  color: #374151;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.products-gear-btn:hover {
  background: #e5e7eb;
}
