/* WebOrders.Web/wwwroot/css/account.css
   Shared styles for /Profile, /Orders, /Favorites pages.
   Re-uses primitives from site.css (wo-field, wo-btn-*, wo-empty, wo-flash).  */

/* ── Page container ─────────────────────────────────────────────────── */
.wo-account-page {
    max-width: 880px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.wo-account-page-narrow {
    max-width: 620px;
}

/* ── Card (re-usable section) ───────────────────────────────────────── */
.wo-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.5rem 1.5rem 1.5rem;
    margin-bottom: 1.25rem;
}

.wo-card-section-title {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
}

.wo-card-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.wo-card-section-header .wo-card-section-title { margin: 0; }

/* ── Helpers ────────────────────────────────────────────────────────── */
.wo-muted        { color: #6b7280; }
.wo-strong       { font-weight: 700; }
.wo-field-hint   { color: #6b7280; font-size: 0.8rem; }

/* Small ghost-link button used in action rows (Edit, Set default, Delete). */
.wo-link-btn {
    background: transparent;
    border: 0;
    padding: 0.3rem 0.6rem;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--wo-primary);
    cursor: pointer;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s;
}

.wo-link-btn:hover { background: color-mix(in srgb, var(--wo-primary) 10%, #fff); }

.wo-link-btn-danger        { color: #b91c1c; }
.wo-link-btn-danger:hover  { background: #fef2f2; }

.wo-btn-sm {
    padding: 0.45rem 0.95rem;
    font-size: 0.85rem;
}

.wo-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    padding: 0.35rem 0.55rem 0.35rem 0.3rem;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.wo-back-link:hover { background: #f3f4f6; color: #111827; }

/* ── Form action row (cancel + submit) ──────────────────────────────── */
.wo-form-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    align-items: center;
    margin-top: 0.5rem;
}

@media (max-width: 480px) {
    .wo-form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .wo-form-actions > * { width: 100%; text-align: center; }
}

/* ── Address form custom grids ──────────────────────────────────────── */
.wo-field-row-3-9   { grid-template-columns: 3fr 9fr; }
.wo-field-row-6-3-3 { grid-template-columns: 6fr 3fr 3fr; }

@media (max-width: 520px) {
    .wo-field-row-3-9,
    .wo-field-row-6-3-3 { grid-template-columns: 1fr; }
}

/* ── Address list ───────────────────────────────────────────────────── */
.wo-address-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wo-address-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
}

.wo-address-card.is-default {
    border-color: var(--wo-primary);
    background: color-mix(in srgb, var(--wo-primary) 4%, #fff);
}

.wo-address-body { flex: 1; min-width: 0; }

.wo-address-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
}

.wo-address-name { color: #111827; }

.wo-address-badge {
    display: inline-block;
    background: var(--wo-primary);
    color: var(--wo-primary-text);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}

.wo-address-line { font-size: 0.92rem; }

.wo-address-actions {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    align-items: flex-end;
    flex: 0 0 auto;
}

@media (max-width: 520px) {
    .wo-address-card { flex-direction: column; }
    .wo-address-actions { flex-direction: row; flex-wrap: wrap; align-self: flex-start; }
}

/* ── Orders list ────────────────────────────────────────────────────── */
.wo-order-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.wo-order-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wo-order-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.wo-order-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 1rem 1.2rem;
}

.wo-order-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.4rem;
}

.wo-order-id {
    font-weight: 700;
    color: #111827;
    font-size: 1rem;
}

.wo-order-date {
    color: #6b7280;
    font-size: 0.85rem;
}

.wo-order-body {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.wo-order-summary {
    color: #6b7280;
    font-size: 0.9rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wo-order-total {
    font-weight: 700;
    color: var(--wo-primary);
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
}

.wo-order-reorder {
    padding: 0 1.2rem 1rem;
}

/* ── Order Details ──────────────────────────────────────────────────── */
.wo-order-details-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.wo-order-details-head .wo-page-title { margin-bottom: 0.25rem; }
.wo-order-details-head p { margin: 0; }

.wo-order-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.wo-order-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    padding: 0.4rem 0.5rem 0.6rem;
    border-bottom: 1px solid #e5e7eb;
}

.wo-order-table td {
    padding: 0.75rem 0.5rem;
    vertical-align: top;
    border-bottom: 1px solid #f3f4f6;
}

.wo-order-table tr:last-child td { border-bottom: 0; }

.wo-order-table .wo-num { text-align: right; font-variant-numeric: tabular-nums; }

.wo-order-item-name {
    font-weight: 600;
    color: #111827;
}

.wo-order-item-mod {
    color: #6b7280;
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

/* ── Totals block (dl-based) ────────────────────────────────────────── */
.wo-totals {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem 1.5rem;
    margin: 0;
}

.wo-totals dt { color: #6b7280; }
.wo-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.wo-totals .wo-discount { color: #047857; font-weight: 600; }

.wo-totals .wo-totals-total {
    border-top: 1px solid #e5e7eb;
    padding-top: 0.6rem;
    margin-top: 0.4rem;
    font-weight: 700;
    color: #111827;
    font-size: 1.1rem;
}

/* ── Favorites grid ─────────────────────────────────────────────────── */
.wo-fav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.wo-fav-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.1rem 1.2rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wo-fav-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.wo-fav-body { flex: 1; }

.wo-fav-name {
    font-weight: 700;
    color: #111827;
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}

.wo-fav-subname {
    color: #6b7280;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.wo-fav-mods {
    color: #6b7280;
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.wo-fav-notes {
    color: #6b7280;
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 0.2rem;
}

.wo-fav-meta {
    color: #9ca3af;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.5rem;
}

.wo-fav-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.wo-reorder-form {
    display: inline-block;
    margin: 0;
}

.wo-reorder-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
