/**
 * entriso Plugin UI Design System — Components (components.css)
 * Reusable atomic and composite components for ets-delivery-time.
 */

/* ------------------------------------------------------------
   4.1 Buttons (C-BTN-01 ... C-BTN-05)
   ------------------------------------------------------------ */
.entriso-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-md, 8px);
  font-family: var(--font-sans);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color var(--t-fast) var(--ease-standard),
              border-color var(--t-fast) var(--ease-standard),
              color var(--t-fast) var(--ease-standard),
              box-shadow var(--t-fast) var(--ease-standard);
  user-select: none;
  white-space: nowrap;
}

.entriso-btn:focus-visible {
  outline: 3px solid rgba(105, 92, 237, 0.25);
  outline-offset: 2px;
}

.entriso-btn-primary {
  background-color: var(--color-primary, #695ced);
  color: #ffffff;
  font-size: 12.5px;
  padding: 9px 18px;
  box-shadow: var(--shadow-2xs);
}
.entriso-btn-primary:hover {
  background-color: var(--color-primary-hover, #5a4dd0);
}
.entriso-btn-primary:active {
  background-color: var(--color-primary-active, #4c1d95);
}

.entriso-btn-secondary {
  background-color: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e4e9);
  color: var(--color-text-body, #334155);
  font-size: 12px;
  padding: 9px 16px;
  box-shadow: var(--shadow-2xs);
}
.entriso-btn-secondary:hover {
  background-color: var(--color-canvas, #f4f5f8);
  border-color: var(--color-border-strong, #cbd5e1);
  color: var(--color-brand-dark, #282249);
}

.entriso-btn-sm {
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 6px;
}

.entriso-btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--color-border, #e2e4e9);
  background-color: var(--color-surface, #ffffff);
  color: var(--color-muted, #64748b);
}
.entriso-btn-icon:hover {
  color: var(--color-brand-dark, #282249);
  background-color: var(--color-canvas, #f4f5f8);
}

/* ------------------------------------------------------------
   4.2 Badges & Status Chips (C-STA-01, C-BDG-01..05)
   ------------------------------------------------------------ */
.entriso-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background-color: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e4e9);
  border-radius: var(--radius-full, 9999px);
  box-shadow: var(--shadow-2xs);
}

.entriso-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full, 9999px);
  line-height: 1.2;
}

.entriso-badge-success {
  background-color: var(--color-success-bg, #f0fdf4);
  color: var(--color-success, #166534);
  border: 1px solid var(--color-success-border, #bbf7d0);
}

.entriso-badge-warning {
  background-color: var(--color-warning-bg, #fff8f0);
  color: var(--color-warning, #c2410c);
  border: 1px solid var(--color-warning-border, #fed7aa);
}

.entriso-badge-primary {
  background-color: var(--color-primary-soft, #f0ecff);
  color: var(--color-primary, #695ced);
  border: 1px solid var(--color-primary-border, #c4b5fd);
}

.entriso-badge-mono {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  background-color: var(--color-canvas, #f4f5f8);
  color: #475569;
  padding: 2px 6px;
  border-radius: var(--radius-xs, 4px);
  border: 1px solid var(--color-border, #e2e4e9);
}

/* ------------------------------------------------------------
   4.3 Cards & Sticky Bar (A-SET, S-EN-05, S-EN-06)
   ------------------------------------------------------------ */
.section-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e4e9);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  scroll-margin-top: 140px;
}

.section-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-divider, #f1f5f9);
  background: var(--color-surface-sunken, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--color-brand-dark, #282249);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-body {
  padding: 24px;
}

/* Sticky Action Bar S-EN-05 */
.sticky-action-bar {
  position: sticky;
  top: 89px;
  z-index: 150;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border, #e2e4e9);
  padding: 12px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-2xs);
}

/* Anchor Link Sidebar S-EN-06 */
.anchor-sidebar {
  position: sticky;
  top: 160px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.anchor-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-md, 8px);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted, #64748b);
  transition: all var(--t-fast) var(--ease-standard);
  text-decoration: none;
}

.anchor-link:hover {
  color: var(--color-brand-dark, #282249);
  background: rgba(226, 228, 233, 0.5);
}

.anchor-link.active {
  color: var(--color-primary, #695ced);
  background: var(--color-primary-soft, #f0ecff);
  font-weight: 700;
}

/* ------------------------------------------------------------
   4.4 Form Controls (C-FRM-01 ... C-FRM-10)
   ------------------------------------------------------------ */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text, #1e1b4b);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--color-danger, #e11d48);
  margin-left: 2px;
}

.form-input, .form-select {
  width: 100%;
  border: 1px solid var(--color-border, #e2e4e9);
  border-radius: var(--radius-md, 8px);
  padding: 9px 12px;
  font-size: 12.5px;
  color: var(--color-text-body, #334155);
  background: var(--color-surface, #ffffff);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  font-family: var(--font-sans);
}

.form-input:focus, .form-select:focus {
  border-color: var(--color-primary, #695ced);
  box-shadow: 0 0 0 3px rgba(105, 92, 237, 0.15);
}

.form-helper {
  font-size: 11px;
  color: var(--color-muted, #64748b);
  margin-top: 5px;
  line-height: 1.4;
}

/* Accessible Toggle Switch C-FRM-05 */
.entriso-toggle-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle-track {
  width: 38px;
  height: 22px;
  border-radius: var(--radius-full, 9999px);
  background: #cbd5e1;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-standard);
  flex-shrink: 0;
}

.toggle-track.active {
  background-color: var(--color-primary, #695ced);
}

.toggle-thumb {
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: #ffffff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s var(--ease-standard);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.toggle-track.active .toggle-thumb {
  transform: translateX(16px);
}

/* Weekday Pills C-SEL-04 */
.entriso-weekday-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.weekday-pill {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full, 9999px);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--color-border, #e2e4e9);
  background: var(--color-surface, #ffffff);
  color: var(--color-muted, #64748b);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-standard);
  user-select: none;
}

.weekday-pill:hover {
  border-color: var(--color-primary-border, #c4b5fd);
  color: var(--color-brand-dark, #282249);
}

.weekday-pill.active {
  background: var(--color-primary-soft, #f0ecff);
  border-color: var(--color-primary, #695ced);
  color: var(--color-primary, #695ced);
  box-shadow: var(--shadow-2xs);
}

/* Segmented Control C-SEL-06 */
.entriso-segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--color-canvas, #f4f5f8);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--color-border, #e2e4e9);
  gap: 2px;
}

.segmented-item {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-muted, #64748b);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-standard);
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
}

.segmented-item:hover {
  color: var(--color-brand-dark, #282249);
}

.segmented-item.active {
  background: var(--color-surface, #ffffff);
  color: var(--color-primary, #695ced);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Selector Tile C-SEL-01 */
.entriso-selector-tile {
  border: 1px solid var(--color-border, #e2e4e9);
  border-radius: var(--radius-lg, 12px);
  padding: 16px;
  background: var(--color-surface, #ffffff);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-standard);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.entriso-selector-tile:hover {
  border-color: var(--color-primary-border, #c4b5fd);
  background: var(--color-primary-soft-2, #f4f0ff);
}

.entriso-selector-tile.active {
  border-color: var(--color-primary, #695ced);
  background: var(--color-primary-soft, #f0ecff);
  box-shadow: 0 0 0 1px var(--color-primary, #695ced);
}

/* ------------------------------------------------------------
   4.5 Holiday Range Picker & Visual Calendar Component
   ------------------------------------------------------------ */
.holiday-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 12px;
  background: var(--color-surface-sunken, #f8fafc);
  border: 1px solid var(--color-border, #e2e4e9);
  border-radius: var(--radius-lg, 12px);
  text-align: center;
}

.calendar-day-header {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-muted, #64748b);
  padding: 4px 0;
  text-transform: uppercase;
}

.calendar-day-cell {
  padding: 8px 4px;
  font-size: 11px;
  border-radius: 6px;
  color: var(--color-text-body, #334155);
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
}

.calendar-day-cell:hover:not(.disabled) {
  background: var(--color-primary-soft, #f0ecff);
  color: var(--color-primary, #695ced);
}

.calendar-day-cell.holiday-range {
  background: #fed7aa;
  color: #9a3412;
  font-weight: 700;
}

.calendar-day-cell.holiday-start {
  background: #ea580c;
  color: #ffffff;
  font-weight: 700;
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.calendar-day-cell.holiday-end {
  background: #ea580c;
  color: #ffffff;
  font-weight: 700;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.calendar-day-cell.resume-date {
  background: var(--color-success-bg, #f0fdf4);
  border: 1px dashed var(--color-success, #166534);
  color: var(--color-success, #166534);
  font-weight: 700;
}

/* ------------------------------------------------------------
   4.6 Live Forecast Simulator & Storefront Widget (A-FE-WIDGET)
   ------------------------------------------------------------ */
.ets-simulator-card {
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  border: 1px solid var(--color-primary-border, #c4b5fd);
  border-radius: var(--radius-lg, 12px);
  padding: 20px;
  box-shadow: var(--shadow-hover);
}

.ets-dt-widget {
  background: var(--color-surface-sunken, #f8fafc);
  border: 1px solid var(--color-border, #e2e4e9);
  border-radius: var(--radius-lg, 12px);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ets-dt-widget-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-brand-dark, #282249);
}

.ets-dt-countdown {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: #d97706;
  font-weight: 600;
}

.ets-dt-holiday-notice {
  background: #fff7ed;
  border: 1px solid #ffedd5;
  border-left: 3px solid #f97316;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  color: #9a3412;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* ------------------------------------------------------------
   4.7 Native WooCommerce Product Data Panel (Exact WC Metabox UI)
   ------------------------------------------------------------ */
.wc-metabox-postbox {
  background: #ffffff;
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.04);
  margin-bottom: 24px;
}

.wc-metabox-postbox .postbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid #c3c4c7;
  background: #f6f7f7;
  font-size: 13px;
  color: #1d2327;
}

.wc-metabox-postbox .hndle-title {
  font-weight: 600;
  font-size: 14px;
  color: #1d2327;
  margin: 0;
}

.wc-type-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #50575e;
}

.wc-type-box select {
  font-size: 13px;
  padding: 2px 8px;
  height: 28px;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  background: #fff;
  color: #2c3338;
}

.wc-tabs-wrapper {
  display: flex;
  min-height: 420px;
  background: #ffffff;
}

/* Left Vertical Tabs */
.wc-tabs {
  width: 200px;
  min-width: 180px;
  background: #fafafa;
  border-right: 1px solid #dcdcde;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.wc-tabs li {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #eee;
  display: block;
}

.wc-tabs li.hidden,
.wc-tabs li[style*="display: none"] {
  display: none !important;
}

.wc-tabs li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: #50575e;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  transition: all 0.15s ease-in-out;
}

.wc-tabs li a:hover {
  background: #f0f0f1;
  color: #135e96;
}

.wc-tabs li.active a,
.wc-tabs li.active {
  background: #ffffff;
  color: #1d2327;
  font-weight: 600;
  border-left: 3px solid var(--color-primary, #695ced);
  margin-right: -1px;
}

.wc-tabs li.ets-dt-tab a {
  color: var(--color-primary, #695ced);
  font-weight: 600;
}

.wc-tabs li.ets-dt-tab.active a {
  color: var(--color-primary, #695ced);
  font-weight: 700;
}

/* Right Options Panel */
.woocommerce_options_panel {
  flex: 1;
  padding: 16px 20px;
  background: #ffffff;
  min-height: 380px;
}

.woocommerce_options_panel .options_group {
  border-bottom: 1px solid #eee;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.woocommerce_options_panel .options_group:last-child {
  border-bottom: none;
}

.woocommerce_options_panel p.form-field {
  padding: 6px 0;
  margin: 0 0 10px 0;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  line-height: 28px;
}

.woocommerce_options_panel p.form-field label {
  width: 170px;
  float: left;
  font-size: 13px;
  font-weight: 600;
  color: #2c3338;
  padding-right: 12px;
  margin: 0;
  line-height: 28px;
}

.woocommerce_options_panel p.form-field .wc-control-wrap {
  flex: 1;
  min-width: 280px;
  max-width: 480px;
}

.woocommerce_options_panel p.form-field select.short,
.woocommerce_options_panel p.form-field input[type="text"].short,
.woocommerce_options_panel p.form-field input[type="number"].short {
  width: 220px;
  max-width: 100%;
  height: 30px;
  line-height: 28px;
  padding: 0 8px;
  font-size: 13px;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  color: #2c3338;
  background: #fff;
  outline: none;
}

.woocommerce_options_panel p.form-field select.short:focus,
.woocommerce_options_panel p.form-field input:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
}

.woocommerce_options_panel p.form-field span.description {
  display: block;
  font-size: 12px;
  color: #646970;
  margin-top: 4px;
  line-height: 1.4;
}

.woocommerce_help_tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #64748b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
  cursor: help;
  vertical-align: middle;
}

.woocommerce_help_tip:hover {
  background: var(--color-primary, #695ced);
}

/* Toast Container */
#entriso-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast, 500);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.entriso-toast {
  pointer-events: auto;
  background: #1e1b4b;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md, 8px);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-modal);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(20px);
  opacity: 0;
  transition: all var(--t-fast) var(--ease-out);
}

.entriso-toast.show {
  transform: translateY(0);
  opacity: 1;
}
