/* ============================================================
   Qsarco Storefront — My Account UniFi dark dashboard
   ============================================================ */

@layer components {

  /* Cache la navigation WC standard, on utilise notre sidebar */
  body.woocommerce-account .woocommerce-MyAccount-navigation { display: none !important; }
  body.woocommerce-account .woocommerce-MyAccount-content,
  body.woocommerce-account .woocommerce { width: 100% !important; max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
  body.woocommerce-account #primary,
  body.woocommerce-account .content-area,
  body.woocommerce-account .site-content,
  body.woocommerce-account .entry-content,
  body.woocommerce-account .site-main { padding: 0 !important; max-width: 100% !important; }

  /* Force dark mode sur la page account (correspond à l'image UniFi) */
  body.woocommerce-account,
  body.woocommerce-account .qsf-uniaccount {
    background: #0e1118;
    color: #e7e9ec;
    font-family: var(--qsf-font-sans);
    min-height: 100vh;
  }

  /* ============= Layout ============= */
  .qsf-uniaccount {
    display: grid;
    grid-template-columns: 56px 1fr;
    min-height: 100vh;
    background: #0e1118;
    color: #e7e9ec;
  }

  /* ============= Sidebar icônes ============= */
  .qsf-uniaccount-sidebar {
    background: #0a0d13;
    border-right: 1px solid #1a1f29;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    height: 100vh;
  }
  .qsf-uniaccount-nav-item {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
  }
  .qsf-uniaccount-nav-item:hover {
    background: #1a1f29;
    color: #e7e9ec;
  }
  .qsf-uniaccount-nav-item.is-active {
    background: rgba(0,111,255,0.15);
    color: #4d9aff;
  }
  .qsf-uniaccount-nav-item svg { width: 18px; height: 18px; }

  /* ============= Main ============= */
  .qsf-uniaccount-main {
    padding: 0;
    overflow-y: auto;
    max-height: 100vh;
  }

  .qsf-uniaccount-header {
    padding: 18px 28px;
    border-bottom: 1px solid #1a1f29;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: #0e1118;
    z-index: 10;
  }
  .qsf-uniaccount-title {
    font-size: 18px;
    font-weight: 600;
    color: #e7e9ec;
    margin: 0;
    letter-spacing: -0.01em;
  }
  .qsf-uniaccount-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: #1a1f29;
    border: none;
    color: #6aacff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
  }
  .qsf-uniaccount-action-btn:hover { background: #232a36; }

  .qsf-uniaccount-body {
    padding: 0;
  }

  /* ============= Section card ============= */
  .qsf-uniaccount-section {
    background: #161a23;
    border-bottom: 1px solid #1a1f29;
    margin: 0;
    border-radius: 0;
    padding: 18px 28px;
  }
  .qsf-uniaccount-section + .qsf-uniaccount-section {
    margin-top: 0;
  }
  .qsf-uniaccount-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0;
  }
  .qsf-uniaccount-section[data-qsf-collapse="open"] .qsf-uniaccount-section-body {
    display: block;
    margin-top: 16px;
  }
  .qsf-uniaccount-section[data-qsf-collapse="closed"] .qsf-uniaccount-section-body {
    display: none;
  }
  .qsf-uniaccount-section[data-qsf-collapse="closed"] .qsf-uniaccount-collapse-toggle svg {
    transform: rotate(180deg);
  }
  .qsf-uniaccount-section-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .qsf-uniaccount-section-icon {
    color: #9ca3af;
    flex-shrink: 0;
  }
  .qsf-uniaccount-section-head h2 {
    font-size: 14px;
    font-weight: 600;
    color: #e7e9ec;
    margin: 0;
  }
  .qsf-uniaccount-section-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .qsf-uniaccount-collapse-toggle {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
  }
  .qsf-uniaccount-collapse-toggle:hover {
    background: #1a1f29;
    color: #e7e9ec;
  }
  .qsf-uniaccount-collapse-toggle svg {
    transition: transform 0.2s var(--qsf-ease-out);
  }
  .qsf-uniaccount-section-sub {
    font-size: 13px;
    color: #cbd5e1;
    margin: 0 0 12px;
  }

  /* ============= Boutons ============= */
  .qsf-uniaccount-btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #4d9aff;
    color: #0e1118;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.08s;
  }
  .qsf-uniaccount-btn-primary:hover { background: #6aacff; }
  .qsf-uniaccount-btn-primary:active { transform: scale(0.97); }

  .qsf-uniaccount-btn-link {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
    padding: 8px 12px;
    transition: color 0.15s;
  }
  .qsf-uniaccount-btn-link:hover { color: #e7e9ec; }

  .qsf-uniaccount-link {
    color: #4d9aff;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.15s;
  }
  .qsf-uniaccount-link:hover { color: #6aacff; text-decoration: underline; text-underline-offset: 2px; }

  /* ============= Table commandes ============= */
  .qsf-uniaccount-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .qsf-uniaccount-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }
  .qsf-uniaccount-table thead th {
    text-align: left;
    padding: 0 0 12px;
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    background: transparent;
    border-bottom: 1px solid #1a1f29;
  }
  .qsf-uniaccount-table thead th.qsf-text-right { text-align: right; }
  .qsf-uniaccount-table tbody td {
    padding: 12px 0;
    color: #e7e9ec;
    border-bottom: 1px solid #1a1f29;
    vertical-align: middle;
  }
  .qsf-uniaccount-table tbody tr:last-child td { border-bottom: none; }
  .qsf-uniaccount-table .qsf-text-right { text-align: right; }
  .qsf-uniaccount-table .qsf-mono { font-variant-numeric: tabular-nums; }

  .qsf-uniaccount-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4d9aff;
    font-size: 13px;
  }
  .qsf-uniaccount-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4d9aff;
    display: inline-block;
  }

  .qsf-uniaccount-empty {
    font-size: 13px;
    color: #9ca3af;
    padding: 16px 0;
  }

  /* ============= Form modes paiement ============= */
  .qsf-uniaccount-form-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 16px;
  }
  .qsf-uniaccount-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
  }
  .qsf-field-1of3 { grid-column: span 2; }
  .qsf-field-1of2 { grid-column: span 3; }
  .qsf-field-1of6 { grid-column: span 1; }
  .qsf-field-2of3 { grid-column: span 4; }
  @media (max-width: 720px) {
    .qsf-uniaccount-form-row { grid-template-columns: 1fr 1fr; }
    .qsf-field-1of3, .qsf-field-1of2, .qsf-field-1of6 { grid-column: span 2; }
  }
  .qsf-uniaccount-field label {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
  }
  .qsf-uniaccount-input {
    background: transparent;
    border: 1px solid #232a36;
    border-radius: 6px;
    padding: 9px 12px;
    color: #e7e9ec;
    font-family: inherit;
    font-size: 13px;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
  }
  .qsf-uniaccount-input:focus {
    outline: none;
    border-color: #4d9aff;
    box-shadow: 0 0 0 3px rgba(77,154,255,0.18);
  }
  .qsf-uniaccount-input::placeholder { color: #4b5563; }
  .qsf-uniaccount-input option { background: #161a23; color: #e7e9ec; }

  .qsf-uniaccount-form-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
  }

  /* ============= Unlock (sécurité) ============= */
  .qsf-uniaccount-unlock {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 8px 0 12px;
  }
  .qsf-uniaccount-input-wrap {
    position: relative;
    flex: 0 0 auto;
    width: 280px;
    max-width: 100%;
  }
  .qsf-uniaccount-input-wrap input {
    width: 100%;
    padding-right: 36px;
  }
  .qsf-uniaccount-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s;
  }
  .qsf-uniaccount-eye:hover { color: #e7e9ec; }
  .qsf-uniaccount-forgot {
    display: inline-block;
    margin-top: 4px;
  }

  /* ============= Préférences ============= */
  .qsf-uniaccount-preferences {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #1a1f29;
    filter: blur(4px);
    pointer-events: none;
    opacity: 0.7;
    transition: filter 0.25s, opacity 0.25s;
  }
  .qsf-uniaccount-section.is-unlocked .qsf-uniaccount-preferences {
    filter: none;
    pointer-events: auto;
    opacity: 1;
  }
  .qsf-uniaccount-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: #e7e9ec;
    margin: 0 0 4px;
  }
  .qsf-uniaccount-pref-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #1a1f29;
  }
  .qsf-uniaccount-pref-row:last-child { border-bottom: none; }
  .qsf-uniaccount-pref-row > label {
    font-size: 13px;
    color: #cbd5e1;
  }
  .qsf-uniaccount-pref-stack { align-items: flex-start; }
  .qsf-uniaccount-radio-group {
    display: flex;
    gap: 24px;
    align-items: center;
  }
  .qsf-uniaccount-radio-group label,
  .qsf-uniaccount-checkbox-grid label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #e7e9ec;
    cursor: pointer;
  }
  .qsf-uniaccount-radio-group input[type="radio"],
  .qsf-uniaccount-checkbox-grid input[type="checkbox"] {
    accent-color: #4d9aff;
    width: 14px;
    height: 14px;
  }
  .qsf-uniaccount-checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
  }
  .qsf-input-narrow { max-width: 280px; }

  /* Mobile */
  @media (max-width: 720px) {
    .qsf-uniaccount { grid-template-columns: 56px 1fr; }
    .qsf-uniaccount-section { padding: 16px 16px; }
    .qsf-uniaccount-pref-row { grid-template-columns: 1fr; }
  }
}
