/* ==========================================================================
   ACCOUNT PAGE
   ========================================================================== */

/* Breadcrumb override */
.crumbs { display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 0 8px; font-size: 13px; color: var(--muted) !important; }
.crumbs__list { display: flex !important; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; font-size: 13px; }
.crumbs__list li { display: flex; align-items: center; gap: 8px; }
.crumbs__list li:not(:last-child)::after { content: "/"; color: var(--line); }
.crumbs__list a { color: var(--ink-2); text-decoration: none; }
.crumbs__list a:hover { color: var(--blue); text-decoration: underline; }
.crumbs__list [aria-current] { color: var(--ink); font-weight: 500; }

.account-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }

/* Sidebar */
.account-sidebar { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow-y: auto; }
.account-user { padding: 20px; background: #fbfbfc; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 16px; }
.account-avatar { width: 56px; height: 56px; display: grid; place-items: center; background: #eef3fb; border-radius: 50%; color: var(--blue); margin: 0 auto 12px; }
.account-avatar svg { width: 28px; height: 28px; }
.account-name { text-align: center; }
.account-name strong { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.account-name span { font-size: 13px; color: var(--muted); }

.account-nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.account-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfbfc; color: var(--ink-2); text-decoration: none; font-size: 13.5px; font-weight: 500; transition: all .15s; }
.account-nav a:hover { border-color: var(--ink); background: #fff; color: var(--ink); }
.account-nav li.is-active a { border-color: var(--blue); background: #eef3fb; color: var(--blue); }
.account-nav a svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.account-nav li.is-active a svg { color: var(--blue); }
.account-logout a { color: #c0392b; border-color: #ffecec; background: #fff8f8; width: 100%; margin-top: 6px; justify-content: center; }
.account-logout a:hover { background: #fff0f0; border-color: #c0392b; color: #c0392b; }
.account-logout a svg { color: #c0392b; width: 20px; height: 20px; flex: none; }

/* Main content */
.account-main { min-width: 0; }
.account-section { display: none; }
.account-section.is-active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.section-head h2, .section-head h3 { margin: 0; font-family: var(--fd); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--blue); text-decoration: none; }
.link-arrow:hover { text-decoration: underline; }
.link-arrow svg { width: 16px; height: 16px; }

/* Dashboard cards */
.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.dashboard-card { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.dashboard-card:hover { border-color: var(--ink); box-shadow: 0 12px 28px rgba(15,23,42,.08); transform: translateY(-2px); }
.dashboard-card__icon { width: 48px; height: 48px; display: grid; place-items: center; background: #eef3fb; border-radius: 10px; color: var(--blue); }
.dashboard-card__icon svg { width: 24px; height: 24px; }
.dashboard-card__content h3 { margin: 0 0 2px; font-family: var(--fd); font-size: 15px; font-weight: 600; color: var(--ink); }
.dashboard-card__content p { margin: 0; font-size: 12.5px; color: var(--muted); }
.dashboard-card__arrow { width: 24px; height: 24px; color: var(--muted); }
.dashboard-card:hover .dashboard-card__arrow { color: var(--ink); }

/* Recent orders table */
.recent-orders { margin-top: 16px; }
.orders-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.orders-table th, .orders-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.orders-table th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; background: #fbfbfc; }
.orders-table tbody tr:hover { background: #fbfbfc; }
.orders-table td a { font-weight: 600; color: var(--ink); text-decoration: none; }
.orders-table td a:hover { color: var(--blue); text-decoration: underline; }
.orders-table td .status-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.status-delivered { background: #dcfce7; color: var(--green); }
.status-shipped { background: #eef3fb; color: var(--blue); }
.status-processing { background: #fef3c7; color: #b45309; }
.status-pending { background: #f3f4f6; color: var(--muted); }
.status-cancelled { background: #fee2e2; color: #c0392b; }
.btn--sm { height: 34px; padding: 0 12px; font-size: 12.5px; }

/* Account page — mobile sidebar toggle */
.sidebar-toggle { display: none; }
@media (max-width: 980px) {
  .sidebar-toggle { display: inline-flex; margin-bottom: 16px; }
}

/* Wishlist product cards (compact, inside account page) */
.wishlist-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.wishlist-grid .prod { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.wishlist-grid .prod:hover { border-color: var(--faint); box-shadow: 0 8px 24px rgba(15,23,42,.08); }
.wishlist-grid .prod__media { display: grid; place-items: center; background: #f6f7fa; aspect-ratio: 1; padding: 14px; }
.wishlist-grid .prod__media img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.wishlist-grid .prod__body { display: grid; gap: 3px; padding: 12px; }
.wishlist-grid .prod__cats { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.wishlist-grid .prod__name { font-family: var(--fd); font-size: 13px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); text-decoration: none; line-height: 1.3; }
.wishlist-grid .prod__name:hover { color: var(--blue); }
.wishlist-grid .prod__price-line { display: flex; align-items: baseline; gap: 8px; }
.wishlist-grid .prod__price { font-family: var(--fd); font-size: 14px; font-weight: 700; color: var(--ink); }
.wishlist-grid .prod__koko { display: flex; align-items: center; flex-wrap: nowrap !important; white-space: nowrap !important; gap: 6px; font-size: 11px; letter-spacing: -0.015em; color: var(--muted); }
.wishlist-grid .prod__koko .koko-line__txt { display: inline-flex; align-items: center; flex-wrap: nowrap !important; white-space: nowrap !important; }
.wishlist-grid .prod__koko .koko-logo { height: 12px; width: auto; vertical-align: middle; flex-shrink: 0; }
.wishlist-grid .koko-tag { font-size: 9px; font-weight: 700; letter-spacing: .04em; color: var(--blue); background: #eef3fb; padding: 1px 5px; border-radius: 4px; }
.wishlist-grid .prod__buy { margin-top: 8px; }
.wishlist-grid .prod__buy .btn { height: 34px; padding: 0 12px; font-size: 12px; font-weight: 600; width: 100%; }

/* Addresses */
.addresses-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.address-card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; display: grid; gap: 12px; }
.address-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.address-card__header strong { font-size: 15px; font-weight: 600; color: var(--ink); }
.address-card__badge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef3fb; color: var(--blue); }
.address-card p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.address-card__actions { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.address-card__actions .btn { flex: 1; justify-content: center; }

/* Settings */
.settings-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 0; margin-bottom: 24px; }
.settings-nav a { padding: 10px 18px; border: 1px solid transparent; border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; font-size: 13.5px; font-weight: 500; color: var(--muted); text-decoration: none; transition: all .15s; margin-bottom: -1px; }
.settings-nav a:hover { color: var(--ink); background: #f8f9fc; }
.settings-nav a.is-active { color: var(--blue); border-color: var(--line); border-bottom-color: #fff; background: #fff; font-weight: 600; }

.settings-form { display: grid; gap: 16px; }
.settings-form .form-group { display: grid; gap: 5px; }
.settings-form label { font-size: 13px; font-weight: 500; color: var(--ink); }
.settings-form input[type="text"],
.settings-form input[type="email"],
.settings-form input[type="password"] { height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; font-family: inherit; color: var(--ink); width: 100%; box-sizing: border-box; transition: border-color .15s, box-shadow .15s; }
.settings-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27,50,160,.1); }
.settings-form input::placeholder { color: var(--muted); }
.settings-form .btn { margin-top: 8px; }

/* The Settings tab's 2-col field rows. Scoped to .settings-form so it does NOT
   leak onto WooCommerce's own <p class="form-row"> address/account fields
   (which must stack full-width). The live account page has no .settings-form,
   so this is inert here — kept scoped for the prototype's settings tab. */
.settings-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.settings-toggles { display: grid; gap: 10px; }
.toggle-item { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; transition: border-color .15s; }
.toggle-item:hover { border-color: var(--faint); }
.toggle-item input { accent-color: var(--blue); width: 18px; height: 18px; flex-shrink: 0; }
.toggle-item span { font-size: 13.5px; color: var(--ink); }

/* Status badges for table */
.status-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }

/* Responsive */
@media (max-width: 1180px) {
  .account-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 20px; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .wishlist-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
  .account-layout { grid-template-columns: 1fr; }
  .account-sidebar { position: fixed; inset: 0 0 0 auto; width: 300px; max-width: 85vw; max-height: 100vh; border-radius: 0; border-left: 1px solid var(--line); z-index: 100; background: #fff; transform: translateX(100%); transition: transform .25s ease; padding-bottom: 80px; }
  .account-sidebar[data-open] { transform: translateX(0); }
  .account-main { padding-top: 0; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .wishlist-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-form .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .wishlist-grid { grid-template-columns: 1fr; }
  .addresses-list { grid-template-columns: 1fr; }
  .orders-table { font-size: 13px; }
  .orders-table th, .orders-table td { padding: 10px 12px; }
  .settings-nav { gap: 4px; }
  .settings-nav a { padding: 8px 12px; font-size: 13px; }
}

/* Address modal */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal__overlay { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.modal__sheet { position: relative; background: #fff; border-radius: 16px; max-width: 540px; width: calc(100% - 32px); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 24px 48px rgba(0,0,0,.15); animation: fadeIn .2s ease; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal__head h2 { margin: 0; font-family: var(--fd); font-size: 18px; font-weight: 600; }
.modal__close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-size: 20px; display: grid; place-items: center; color: var(--muted); }
.modal__close:hover { background: #f8f9fc; }
.modal[hidden] { display: none; }

/* ==========================================================================
   AUTH / LOGIN & REGISTRATION
   ========================================================================== */
.auth-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 32px; max-width: 900px; margin: 32px auto; }
.auth-card { padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 4px 20px rgba(15,23,42,.04); }
.auth-card h2 { font-family: var(--fd); font-size: 24px; font-weight: 700; margin: 0 0 6px; color: var(--ink); }
.auth-card .auth-sub { font-size: 13.5px; color: var(--muted); margin: 0 0 24px; line-height: 1.5; }
.auth-form { display: grid; gap: 16px; }
.auth-form .form-group { display: grid; gap: 6px; }
.auth-form label { font-size: 13px; font-weight: 600; color: var(--ink); }
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] { height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; width: 100%; box-sizing: border-box; transition: border-color .15s, box-shadow .15s; }
.auth-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27,50,160,.1); }
.auth-form .form-row-remember { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 4px; }
.auth-form .form-row-remember label { font-weight: 400; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-2); }
.auth-form .lost-password { color: var(--blue); text-decoration: none; font-size: 13px; font-weight: 500; }
.auth-form .lost-password:hover { text-decoration: underline; }
.auth-form .btn-submit { height: 44px; font-size: 14px; font-weight: 600; justify-content: center; width: 100%; margin-top: 8px; }

/* WooCommerce Notices inside Account */
.woocommerce-error, .woocommerce-message, .woocommerce-info { list-style: none; padding: 14px 18px; border-radius: 10px; margin: 0 0 24px; font-size: 13.5px; line-height: 1.5; }
.woocommerce-error { background: #fee2e2; border: 1px solid #fca5a5; color: #b91c1c; }
.woocommerce-message { background: #dcfce7; border: 1px solid #86efac; color: #15803d; }
.woocommerce-info { background: #eef3fb; border: 1px solid #bfdbfe; color: var(--blue); }
.woocommerce-error li, .woocommerce-message li, .woocommerce-info li { list-style: none; margin: 0; }
.woocommerce-error li:not(:last-child) { margin-bottom: 6px; }

/* WooCommerce Table Mapping */
.woocommerce-orders-table, .woocommerce-MyAccount-orders { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.woocommerce-orders-table th, .woocommerce-orders-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.woocommerce-orders-table th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; background: #fbfbfc; }
.woocommerce-orders-table tbody tr:hover { background: #fbfbfc; }
.woocommerce-orders-table td a { font-weight: 600; color: var(--ink); text-decoration: none; }
.woocommerce-orders-table td a:hover { color: var(--blue); text-decoration: underline; }


/* ==========================================================================
   WOOCOMMERCE ADDRESS FORMS (edit-address endpoint)
   The themed account shell wraps raw Woo address forms. Woo wraps each field
   in <p class="form-row">; the global .form-row 2-col grid above (intended for
   the Settings tab) collides with that, so stack each address field
   full-width (label above input) and theme the controls to match.
   ========================================================================== */
/* Element-based .form-row stacking (robust: Woo emits <p class="form-row">
   regardless of wrapper class) + wrapper-based fallbacks. display:block makes
   each field full-width with label above input. */
.account-main p.form-row,
.account-main .woocommerce-Addresses .form-row,
.account-main .woocommerce-Address .form-row,
.account-main form.edit-address .form-row { display: block; margin: 0 0 16px; text-align: left; }
/* Label sits above the control, full width, themed */
.account-main p.form-row label,
.account-main .woocommerce-Address label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin: 0 0 6px; }
/* Controls: inputs / selects / textareas full-width, themed */
.account-main p.form-row input,
.account-main p.form-row select,
.account-main p.form-row textarea,
.account-main .woocommerce-Address input,
.account-main .woocommerce-Address select,
.account-main .woocommerce-Address textarea {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink); font-size: 14px;
  font-family: inherit; box-sizing: border-box; transition: border-color .15s, box-shadow .15s;
}
.account-main p.form-row textarea,
.account-main .woocommerce-Address textarea { height: auto; min-height: 84px; padding: 10px 14px; }
.account-main p.form-row input:focus,
.account-main p.form-row select:focus,
.account-main p.form-row textarea:focus,
.account-main .woocommerce-Address input:focus,
.account-main .woocommerce-Address textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27,50,160,.1); }
/* Save button inside a form-row (Woo .button / .woocommerce-Button) */
.account-main p.form-row .button,
.account-main p.form-row .woocommerce-Button,
.account-main p.form-row button,
.account-main .woocommerce-Address .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 24px; border: 0; border-radius: var(--r-ctl);
  background: var(--cobalt); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
.account-main p.form-row .button:hover,
.account-main .woocommerce-Address .button:hover { background: var(--blue); }
.account-main .woocommerce-Address label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.account-main .woocommerce-Address .required { color: #c0392b; font-weight: 700; }
.account-main .woocommerce-Address input[type="text"],
.account-main .woocommerce-Address input[type="email"],
.account-main .woocommerce-Address input[type="tel"],
.account-main .woocommerce-Address input.input-text,
.account-main .woocommerce-Address textarea {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink); font-size: 14px;
  font-family: inherit; box-sizing: border-box; transition: border-color .15s, box-shadow .15s;
}
.account-main .woocommerce-Address textarea { height: auto; min-height: 84px; padding: 10px 14px; }
.account-main .woocommerce-Address input:focus,
.account-main .woocommerce-Address textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27,50,160,.1); }
.account-main .woocommerce-Address select {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); font-size: 14px; font-family: inherit; box-sizing: border-box;
}
.account-main .woocommerce-Address .form-row input { display: block; }
/* Section heading: Billing address / Shipping address */
.account-main .woocommerce-Address h3 { font-family: var(--fd); font-size: 19px; font-weight: 700; margin: 0 0 16px; color: var(--ink); letter-spacing: -.01em; }
.account-main .woocommerce-Address h3 .edit { font-family: inherit; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: none; }
/* Save button (Woo .button) */
.account-main .woocommerce-Address .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border: 0; border-radius: var(--r-ctl);
  background: var(--cobalt); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
.account-main .woocommerce-Address .button:hover { background: var(--blue); }
/* "Edit shipping/billing address" link */
.account-main .woocommerce-EditAddressButton,
.account-main .edit-address-button { margin-top: 4px; }
.account-main .woocommerce-EditAddressButton a,
.account-main .edit-address-button a {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  color: var(--blue); text-decoration: none;
}
.account-main .woocommerce-EditAddressButton a:hover { text-decoration: underline; }
/* Shipping + billing side by side on wide screens */
@media (min-width: 900px) {
  .account-main .woocommerce-Addresses { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
  .account-main .woocommerce-Addresses .woocommerce-column { min-width: 0; }
}
