/*
 * Vendofy — zakładka „Moje konto" WooCommerce.
 *
 * Stylizuje natywny wydruk shortcode'a [woocommerce_my_account]: nawigację,
 * kokpit, zamówienia, pobrania, adresy i szczegóły konta. Nie zmienia HTML-a
 * WooCommerce — celuje wyłącznie w jego własne klasy.
 *
 * ── DLACZEGO TYLE !important ────────────────────────────────────────────────
 * WooCommerce trzyma swoje reguły na selektorach w rodzaju `.woocommerce
 * a.button` (0,2,1), a motyw ładuje arkusz PO wtyczce. Bez wymuszenia nasze
 * style przegrywają akurat tam, gdzie widać to najbardziej: przyciski, pola
 * formularzy, komunikaty i kolumny adresów. Wymuszamy więc te właściwości,
 * o które faktycznie trwa spór — reszta zostaje zwykła.
 *
 * ── JAK TO NADPISAĆ ─────────────────────────────────────────────────────────
 * Kolory, promienie i odstępy czyta się ze zmiennych --vendo-acc-* na :root.
 * Nadpisanie ZMIENNEJ działa mimo !important, bo podstawienie następuje
 * dopiero w miejscu użycia:
 *
 *     :root { --vendo-acc-primary: #0f766e; --vendo-acc-radius: 0.25rem; }
 *
 * Dopiero zmiana czegoś poza zmiennymi (np. układu) wymaga własnego
 * !important. Przyszły edytor styli będzie podmieniał te same zmienne.
 *
 * ── JEDNOSTKI ───────────────────────────────────────────────────────────────
 * Wszystkie wymiary w rem / em / % / clamp(). Całość skaluje się z ustawieniem
 * rozmiaru pisma w przeglądarce, a kluczowe wymiary (szerokość menu, odstępy,
 * typografia) płynnie reagują na szerokość okna — bez skokowych breakpointów.
 *
 * Copyright (c) 2024-obecnie Igor Roman. Wszelkie prawa zastrzeżone.
 */

:root {
    /* Paleta wtyczki */
    --vendo-acc-primary:      #7c3aed;
    --vendo-acc-primary-dark: #6d28d9;
    --vendo-acc-primary-soft: #f5f3ff;
    --vendo-acc-primary-line: #ede9fe;

    /* Tekst i tła */
    --vendo-acc-text:    #1f2937;
    --vendo-acc-muted:   #6b7280;
    --vendo-acc-border:  #e5e7eb;
    --vendo-acc-bg:      #ffffff;
    --vendo-acc-bg-soft: #f9fafb;

    /* Stany */
    --vendo-acc-ok:    #16a34a;
    --vendo-acc-warn:  #d97706;
    --vendo-acc-error: #dc2626;

    /* Kształt i rytm */
    --vendo-acc-radius:    0.75rem;
    --vendo-acc-radius-sm: 0.5rem;
    --vendo-acc-hairline:  0.0625rem;

    --vendo-acc-gap:       clamp(1rem, 2.2vw, 1.75rem);
    --vendo-acc-pad:       clamp(1.25rem, 2.6vw, 2rem);
    --vendo-acc-nav-width: clamp(11.5rem, 19vw, 16.5rem);
    --vendo-acc-max:       80rem;

    /* Typografia */
    --vendo-acc-font:    clamp(0.9rem, 0.86rem + 0.2vw, 0.975rem);
    --vendo-acc-font-sm: 0.8125rem;
    --vendo-acc-font-xs: 0.75rem;
    --vendo-acc-lead:    clamp(1rem, 0.95rem + 0.4vw, 1.15rem);
    --vendo-acc-h2:      clamp(1.15rem, 1.05rem + 0.5vw, 1.35rem);
    --vendo-acc-h3:      clamp(1rem, 0.95rem + 0.3vw, 1.1rem);

    --vendo-acc-shadow:    0 0.0625rem 0.1875rem rgba(16, 24, 40, 0.06);
    --vendo-acc-shadow-lg: 0 0.25rem 1rem rgba(124, 58, 237, 0.16);
}

/* ===========================================================================
   1. UKŁAD DWUKOLUMNOWY

   Siatkę wolno założyć WYŁĄCZNIE na bezpośrednim rodzicu nawigacji. Motywy
   i buildery opakowują stronę konta w kolejne elementy z klasą .woocommerce —
   złapanie ich wszystkich wpycha treść do pierwszej kolumny.

   Rodzica wskazujemy trzema drogami: klasą .vendo-account (PHP, awaryjnie JS),
   selektorem :has(> …) oraz — gdy zawiodą obie — floatami z sekcji 1c.
   =========================================================================== */

.vendo-account,
.woocommerce:has(> .woocommerce-MyAccount-navigation) {
    display: grid !important;
    grid-template-columns: var(--vendo-acc-nav-width) minmax(0, 1fr) !important;
    gap: var(--vendo-acc-gap) !important;
    align-items: start !important;
    justify-items: stretch !important;

    float: none !important;
    width: auto !important;
    max-width: var(--vendo-acc-max) !important;
    margin: clamp(1.25rem, 3vw, 2.5rem) auto !important;
    padding: 0 clamp(0.75rem, 2vw, 1.25rem) !important;

    color: var(--vendo-acc-text);
    font-size: var(--vendo-acc-font) !important;
    line-height: 1.6;
    text-align: left !important;
}

.vendo-account > .woocommerce-MyAccount-navigation,
.woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-MyAccount-navigation {
    grid-column: 1 !important;
    grid-row: 2 !important;
    float: none !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
}

.vendo-account > .woocommerce-MyAccount-content,
.woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-MyAccount-content {
    grid-column: 2 !important;
    grid-row: 2 !important;
    float: none !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
}

.vendo-account > .woocommerce-notices-wrapper,
.woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-notices-wrapper {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    margin: 0 !important;
}
.vendo-account > .woocommerce-notices-wrapper:empty,
.woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-notices-wrapper:empty {
    display: none !important;
}

/* --- 1c. Wariant zapasowy: floaty, bez założeń co do rodzica --- */
.woocommerce-MyAccount-navigation {
    float: left;
    width: var(--vendo-acc-nav-width);
    margin: 0 var(--vendo-acc-gap) var(--vendo-acc-gap) 0;
}
.woocommerce-MyAccount-content {
    display: flow-root;   /* własny kontekst formatowania — nie podpływa pod menu */
}

/* ===========================================================================
   2. NAWIGACJA
   =========================================================================== */

.woocommerce-MyAccount-navigation {
    position: sticky;
    top: 1.5rem;
    padding: 0.5rem !important;
    background: var(--vendo-acc-bg) !important;
    border: var(--vendo-acc-hairline) solid var(--vendo-acc-border) !important;
    border-radius: var(--vendo-acc-radius) !important;
    box-shadow: var(--vendo-acc-shadow);
}

.woocommerce-MyAccount-navigation ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.woocommerce-MyAccount-navigation li {
    list-style: none !important;
    margin: 0 0 0.125rem !important;
    padding: 0 !important;
    border: 0;
    background: none;
}

.woocommerce-MyAccount-navigation li::before,
.woocommerce-MyAccount-navigation li::marker {
    content: none !important;
}

.woocommerce-MyAccount-navigation li a {
    display: flex !important;
    align-items: center;
    gap: 0.6875rem;
    padding: 0.6875rem 0.875rem !important;
    border: 0 !important;
    border-radius: var(--vendo-acc-radius-sm) !important;
    background: none;
    color: #374151 !important;
    font-size: var(--vendo-acc-font) !important;
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.woocommerce-MyAccount-navigation li a:hover,
.woocommerce-MyAccount-navigation li a:focus {
    background: var(--vendo-acc-primary-soft) !important;
    color: var(--vendo-acc-primary-dark) !important;
}

.woocommerce-MyAccount-navigation li.is-active > a {
    background: var(--vendo-acc-primary) !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: var(--vendo-acc-shadow-lg);
}

.woocommerce-MyAccount-navigation-link--customer-logout {
    margin-top: 0.5rem !important;
    padding-top: 0.5rem !important;
    border-top: var(--vendo-acc-hairline) solid var(--vendo-acc-border);
}
.woocommerce-MyAccount-navigation-link--customer-logout a { color: var(--vendo-acc-muted) !important; }
.woocommerce-MyAccount-navigation-link--customer-logout a:hover {
    background: #fef2f2 !important;
    color: var(--vendo-acc-error) !important;
}

/* --- Ikony pozycji menu (maska + currentColor) --- */
.woocommerce-MyAccount-navigation li a::before {
    content: "" !important;
    width: 1.125rem;
    height: 1.125rem;
    flex: none;
    background-color: currentColor;
    -webkit-mask: center / contain no-repeat var(--vendo-acc-icon);
    mask: center / contain no-repeat var(--vendo-acc-icon);
    opacity: 0.9;
    font-family: inherit;   /* neutralizuje ikonę z fontu motywu */
    position: static;
}
.woocommerce-MyAccount-navigation li:not([class*="navigation-link--"]) a::before {
    display: none !important;
}

.woocommerce-MyAccount-navigation-link--dashboard {
    --vendo-acc-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1'/%3E%3C/svg%3E");
}
.woocommerce-MyAccount-navigation-link--orders {
    --vendo-acc-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 2h6a1 1 0 0 1 1 1v1h2a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h2V3a1 1 0 0 1 1-1z'/%3E%3Cpath d='M8 10h8M8 14h8M8 18h5'/%3E%3C/svg%3E");
}
.woocommerce-MyAccount-navigation-link--downloads {
    --vendo-acc-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E");
}
.woocommerce-MyAccount-navigation-link--edit-address {
    --vendo-acc-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}
.woocommerce-MyAccount-navigation-link--edit-account {
    --vendo-acc-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}
.woocommerce-MyAccount-navigation-link--customer-logout {
    --vendo-acc-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E");
}
.woocommerce-MyAccount-navigation-link--cennik-hurtowy {
    --vendo-acc-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.6 13.4 12 22l-9-9V3h10l7.6 7.6a2 2 0 0 1 0 2.8z'/%3E%3Ccircle cx='7.5' cy='7.5' r='1.5'/%3E%3C/svg%3E");
}
.woocommerce-MyAccount-navigation-link--szybkie-zamowienie {
    --vendo-acc-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='13 2 3 14 12 14 11 22 21 10 12 10 13 2'/%3E%3C/svg%3E");
}
.woocommerce-MyAccount-navigation-link--xml {
    --vendo-acc-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cpolyline points='10 12 8 14 10 16'/%3E%3Cpolyline points='14 12 16 14 14 16'/%3E%3C/svg%3E");
}
.woocommerce-MyAccount-navigation-link--saldo {
    --vendo-acc-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12V7H5a2 2 0 0 1 0-4h14v4'/%3E%3Cpath d='M3 5v14a2 2 0 0 0 2 2h16v-5'/%3E%3Cpath d='M18 12a2 2 0 0 0 0 4h4v-4z'/%3E%3C/svg%3E");
}
.woocommerce-MyAccount-navigation-link--kody-i-linki {
    --vendo-acc-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7'/%3E%3C/svg%3E");
}

/* ===========================================================================
   3. TREŚĆ — karta i typografia
   =========================================================================== */

.woocommerce-MyAccount-content {
    min-width: 0;
    padding: var(--vendo-acc-pad) !important;
    background: var(--vendo-acc-bg) !important;
    border: var(--vendo-acc-hairline) solid var(--vendo-acc-border) !important;
    border-radius: var(--vendo-acc-radius) !important;
    box-shadow: var(--vendo-acc-shadow);
    overflow-wrap: break-word;
}

.woocommerce-MyAccount-content > *:first-child { margin-top: 0 !important; }
.woocommerce-MyAccount-content > *:last-child  { margin-bottom: 0 !important; }

.woocommerce-MyAccount-content p { margin: 0 0 1rem; }

.woocommerce-MyAccount-content > p:first-of-type {
    font-size: var(--vendo-acc-lead) !important;
    line-height: 1.5;
    color: var(--vendo-acc-text);
}
.woocommerce-MyAccount-content > p:first-of-type strong {
    color: var(--vendo-acc-primary-dark);
    font-weight: 700;
}

.woocommerce-MyAccount-content h2,
.woocommerce-MyAccount-content h3 {
    margin: 1.75rem 0 0.875rem;
    color: var(--vendo-acc-text);
    font-weight: 700;
    line-height: 1.3;
}
.woocommerce-MyAccount-content h2 { font-size: var(--vendo-acc-h2) !important; }
.woocommerce-MyAccount-content h3 { font-size: var(--vendo-acc-h3) !important; }

.woocommerce-MyAccount-content a:not(.button):not(.vendo-b2b-btn):not(.woocommerce-button):not(.edit) {
    color: var(--vendo-acc-primary);
    text-decoration: underline;
    text-underline-offset: 0.125rem;
}
.woocommerce-MyAccount-content a:not(.button):not(.vendo-b2b-btn):not(.woocommerce-button):not(.edit):hover {
    color: var(--vendo-acc-primary-dark);
}

.woocommerce-MyAccount-content mark {
    background: var(--vendo-acc-primary-soft);
    color: var(--vendo-acc-primary-dark);
    padding: 0.0625rem 0.3125rem;
    border-radius: 0.25rem;
}

/* ===========================================================================
   4. KOMUNIKATY WooCommerce

   Woo rysuje przy nich ikonę z własnego fontu przez ::before ustawione
   absolutnie (top: 1em; left: 1.5em) i rezerwuje na nią padding 3.5em.
   Przy naszym układzie ta ikona lądowała na tekście — gasimy ją i zdejmujemy
   zarezerwowane miejsce.
   =========================================================================== */

.woocommerce-MyAccount-content .woocommerce-message,
.woocommerce-MyAccount-content .woocommerce-info,
.woocommerce-MyAccount-content .woocommerce-error,
.woocommerce-MyAccount-content .woocommerce-noreviews,
.vendo-account > .woocommerce-notices-wrapper .woocommerce-message,
.vendo-account > .woocommerce-notices-wrapper .woocommerce-info,
.vendo-account > .woocommerce-notices-wrapper .woocommerce-error {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;

    position: relative !important;
    margin: 0 0 1.25rem !important;
    padding: 0.875rem 1.125rem !important;

    background: var(--vendo-acc-primary-soft) !important;
    border: var(--vendo-acc-hairline) solid var(--vendo-acc-primary-line) !important;
    border-left: 0.25rem solid var(--vendo-acc-primary) !important;
    border-radius: var(--vendo-acc-radius-sm) !important;

    color: var(--vendo-acc-text) !important;
    font-size: var(--vendo-acc-font) !important;
    line-height: 1.5;
    list-style: none !important;
    width: auto !important;
}

/* Ikona z fontu WooCommerce — precz. */
.woocommerce-MyAccount-content .woocommerce-message::before,
.woocommerce-MyAccount-content .woocommerce-info::before,
.woocommerce-MyAccount-content .woocommerce-error::before,
.woocommerce-MyAccount-content .woocommerce-noreviews::before,
.vendo-account .woocommerce-message::before,
.vendo-account .woocommerce-info::before,
.vendo-account .woocommerce-error::before {
    content: none !important;
    display: none !important;
}

.woocommerce-MyAccount-content .woocommerce-message,
.vendo-account .woocommerce-message {
    border-color: #bbf7d0 !important;
    border-left-color: var(--vendo-acc-ok) !important;
    background: #f0fdf4 !important;
}
.woocommerce-MyAccount-content .woocommerce-error,
.vendo-account .woocommerce-error {
    border-color: #fecaca !important;
    border-left-color: var(--vendo-acc-error) !important;
    background: #fef2f2 !important;
}
.woocommerce-MyAccount-content .woocommerce-error li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Woo pcha przycisk w komunikacie na float: right — u nas idzie na koniec
   linii przez flexa. */
.woocommerce-MyAccount-content .woocommerce-message .button,
.woocommerce-MyAccount-content .woocommerce-info .button,
.woocommerce-MyAccount-content .woocommerce-error .button,
.vendo-account .woocommerce-message .button,
.vendo-account .woocommerce-info .button,
.vendo-account .woocommerce-error .button {
    float: none !important;
    margin: 0 0 0 auto !important;
}

/* ===========================================================================
   5. PRZYCISKI

   Selektory muszą przebić `.woocommerce a.button` (0,2,1) — stąd zarówno
   element w selektorze, jak i !important na właściwościach.
   =========================================================================== */

.woocommerce-MyAccount-content a.button,
.woocommerce-MyAccount-content button.button,
.woocommerce-MyAccount-content input.button,
.woocommerce-MyAccount-content button[type="submit"],
.woocommerce-MyAccount-content input[type="submit"],
.woocommerce-MyAccount-content .woocommerce-Button,
.woocommerce-MyAccount-content .woocommerce-button,
.vendo-account .woocommerce-notices-wrapper a.button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: auto !important;

    padding: 0.6875rem 1.25rem !important;
    background: var(--vendo-acc-primary) !important;
    border: var(--vendo-acc-hairline) solid var(--vendo-acc-primary) !important;
    border-radius: var(--vendo-acc-radius-sm) !important;

    color: #fff !important;
    font-family: inherit;
    font-size: var(--vendo-acc-font) !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    text-decoration: none !important;
    text-transform: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.woocommerce-MyAccount-content a.button:hover,
.woocommerce-MyAccount-content button.button:hover,
.woocommerce-MyAccount-content input.button:hover,
.woocommerce-MyAccount-content button[type="submit"]:hover,
.woocommerce-MyAccount-content input[type="submit"]:hover,
.woocommerce-MyAccount-content .woocommerce-Button:hover,
.woocommerce-MyAccount-content .woocommerce-button:hover,
.vendo-account .woocommerce-notices-wrapper a.button:hover {
    background: var(--vendo-acc-primary-dark) !important;
    border-color: var(--vendo-acc-primary-dark) !important;
    color: #fff !important;
}

/* Drugorzędne działania — obrys zamiast wypełnienia. */
.woocommerce-MyAccount-content .woocommerce-orders-table a.button,
.woocommerce-MyAccount-content .woocommerce-MyAccount-downloads a.button,
.woocommerce-MyAccount-content .woocommerce-Address a.edit,
.woocommerce-MyAccount-content .woocommerce-Address-title a.edit,
.woocommerce-MyAccount-content .woocommerce-message a.button,
.woocommerce-MyAccount-content .woocommerce-info a.button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.4375rem 0.875rem !important;
    background: transparent !important;
    border: var(--vendo-acc-hairline) solid var(--vendo-acc-primary) !important;
    border-radius: var(--vendo-acc-radius-sm) !important;
    color: var(--vendo-acc-primary) !important;
    font-size: var(--vendo-acc-font-sm) !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    text-decoration: none !important;
    white-space: nowrap;
}
.woocommerce-MyAccount-content .woocommerce-orders-table a.button:hover,
.woocommerce-MyAccount-content .woocommerce-MyAccount-downloads a.button:hover,
.woocommerce-MyAccount-content .woocommerce-Address a.edit:hover,
.woocommerce-MyAccount-content .woocommerce-Address-title a.edit:hover,
.woocommerce-MyAccount-content .woocommerce-message a.button:hover,
.woocommerce-MyAccount-content .woocommerce-info a.button:hover {
    background: var(--vendo-acc-primary) !important;
    color: #fff !important;
}

/* ===========================================================================
   6. TABELE
   =========================================================================== */

.woocommerce-MyAccount-content table.shop_table,
.woocommerce-MyAccount-content table.woocommerce-orders-table,
.woocommerce-MyAccount-content table.woocommerce-table {
    width: 100% !important;
    margin: 0 0 1.5rem !important;
    border: var(--vendo-acc-hairline) solid var(--vendo-acc-border) !important;
    border-radius: var(--vendo-acc-radius-sm) !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: hidden;
    font-size: var(--vendo-acc-font) !important;
}

.woocommerce-MyAccount-content table.shop_table th,
.woocommerce-MyAccount-content table.woocommerce-table th {
    padding: 0.8125rem 1rem !important;
    background: var(--vendo-acc-primary-soft) !important;
    border: 0 !important;
    border-bottom: var(--vendo-acc-hairline) solid var(--vendo-acc-primary-line) !important;
    color: var(--vendo-acc-primary-dark) !important;
    font-size: var(--vendo-acc-font-xs) !important;
    font-weight: 700 !important;
    text-align: left !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.woocommerce-MyAccount-content table.shop_table td,
.woocommerce-MyAccount-content table.woocommerce-table td {
    padding: 0.9375rem 1rem !important;
    border: 0 !important;
    border-bottom: var(--vendo-acc-hairline) solid #f3f4f6 !important;
    vertical-align: middle;
}

.woocommerce-MyAccount-content table.shop_table tbody tr:last-child td,
.woocommerce-MyAccount-content table.woocommerce-table tbody tr:last-child td {
    border-bottom: 0 !important;
}
.woocommerce-MyAccount-content table.shop_table tbody tr:hover td { background: var(--vendo-acc-bg-soft); }

.woocommerce-MyAccount-content table.shop_table tfoot th,
.woocommerce-MyAccount-content table.shop_table tfoot td {
    background: var(--vendo-acc-bg-soft) !important;
    font-weight: 700 !important;
}

.woocommerce-orders-table__cell-order-number a { font-weight: 700; text-decoration: none !important; }
.woocommerce-orders-table__cell-order-status { color: var(--vendo-acc-muted); font-weight: 600; }
.woocommerce-MyAccount-content .woocommerce-Price-amount { font-weight: 600; white-space: nowrap; }

/* ===========================================================================
   7. FORMULARZE

   Motywy najczęściej stylują `.woocommerce form .form-row input.input-text`
   (0,3,1) — bez wymuszenia pola zostają kanciaste i czarne.
   =========================================================================== */

.woocommerce-MyAccount-content form { margin: 0; }

.woocommerce-MyAccount-content .form-row,
.woocommerce-MyAccount-content .woocommerce-form-row {
    display: flex !important;
    flex-direction: column;
    gap: 0.375rem;
    margin: 0 0 1.125rem !important;
    padding: 0 !important;
}

.woocommerce-MyAccount-content label {
    display: block;
    margin: 0;
    color: var(--vendo-acc-text) !important;
    font-size: var(--vendo-acc-font-sm) !important;
    font-weight: 600 !important;
    line-height: 1.4;
}

.woocommerce-MyAccount-content .required {
    color: var(--vendo-acc-error) !important;
    border: 0 !important;
    text-decoration: none !important;
}

.woocommerce-MyAccount-content input[type="text"],
.woocommerce-MyAccount-content input[type="email"],
.woocommerce-MyAccount-content input[type="tel"],
.woocommerce-MyAccount-content input[type="url"],
.woocommerce-MyAccount-content input[type="password"],
.woocommerce-MyAccount-content input[type="number"],
.woocommerce-MyAccount-content input[type="search"],
.woocommerce-MyAccount-content input.input-text,
.woocommerce-MyAccount-content textarea,
.woocommerce-MyAccount-content select,
.woocommerce-MyAccount-content .select2-container .select2-selection--single {
    box-sizing: border-box !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;

    padding: 0.6875rem 0.875rem !important;
    background: var(--vendo-acc-bg) !important;
    border: var(--vendo-acc-hairline) solid var(--vendo-acc-border) !important;
    border-radius: var(--vendo-acc-radius-sm) !important;

    color: var(--vendo-acc-text) !important;
    font-family: inherit !important;
    font-size: var(--vendo-acc-font) !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.woocommerce-MyAccount-content input[type="text"]:focus,
.woocommerce-MyAccount-content input[type="email"]:focus,
.woocommerce-MyAccount-content input[type="tel"]:focus,
.woocommerce-MyAccount-content input[type="password"]:focus,
.woocommerce-MyAccount-content input.input-text:focus,
.woocommerce-MyAccount-content textarea:focus,
.woocommerce-MyAccount-content select:focus {
    outline: none !important;
    border-color: var(--vendo-acc-primary) !important;
    box-shadow: 0 0 0 0.1875rem rgba(124, 58, 237, 0.14) !important;
}

/* Pole hasła z przyciskiem „pokaż" — Woo owija je w .password-input. */
.woocommerce-MyAccount-content .password-input,
.woocommerce-MyAccount-content .woocommerce-password-hint { display: block; width: 100%; }
.woocommerce-MyAccount-content .show-password-input { top: 0.75rem !important; right: 0.875rem !important; }

.woocommerce-MyAccount-content .woocommerce-form__label-for-checkbox {
    flex-direction: row !important;
    align-items: center;
    gap: 0.5625rem;
    font-weight: 500 !important;
}
.woocommerce-MyAccount-content input[type="checkbox"],
.woocommerce-MyAccount-content input[type="radio"] {
    width: auto !important;
    margin: 0;
    accent-color: var(--vendo-acc-primary);
}

.woocommerce-MyAccount-content fieldset {
    margin: 1.625rem 0 1.25rem !important;
    padding: 1.375rem 1.5rem !important;
    background: var(--vendo-acc-bg-soft) !important;
    border: var(--vendo-acc-hairline) solid var(--vendo-acc-border) !important;
    border-radius: var(--vendo-acc-radius-sm) !important;
}
.woocommerce-MyAccount-content fieldset legend {
    padding: 0 0.5rem !important;
    color: var(--vendo-acc-primary-dark) !important;
    font-size: var(--vendo-acc-font) !important;
    font-weight: 700 !important;
}

.woocommerce-MyAccount-content em,
.woocommerce-MyAccount-content .woocommerce-form__label span em,
.woocommerce-MyAccount-content span.description {
    display: block;
    margin-top: 0.25rem;
    color: var(--vendo-acc-muted) !important;
    font-size: var(--vendo-acc-font-sm) !important;
    font-style: normal;
    font-weight: 400;
}

/* Pary pól obok siebie (imię/nazwisko, ulica/numer). */
@media (min-width: 45rem) {
    .woocommerce-MyAccount-content .form-row-first,
    .woocommerce-MyAccount-content .form-row-last,
    .woocommerce-MyAccount-content .woocommerce-form-row--first,
    .woocommerce-MyAccount-content .woocommerce-form-row--last {
        float: left !important;
        width: 48% !important;
    }
    .woocommerce-MyAccount-content .form-row-first,
    .woocommerce-MyAccount-content .woocommerce-form-row--first { margin-right: 4% !important; }
}

.woocommerce-MyAccount-content .clear { clear: both !important; display: block !important; }

/* ===========================================================================
   8. ADRESY

   Woo układa je floatami przez .col2-set > .col-1 / .col-2 (0,3,0).
   Zamieniamy na siatkę i zdejmujemy floaty oraz procentowe szerokości.
   =========================================================================== */

.woocommerce-MyAccount-content .woocommerce-Addresses,
.woocommerce-MyAccount-content .col2-set,
.woocommerce-MyAccount-content .u-columns.addresses {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)) !important;
    gap: 1.25rem !important;
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}
/* Woo domyka floaty clearfixem — w siatce zostawiłby pusty ślad. */
.woocommerce-MyAccount-content .col2-set::before,
.woocommerce-MyAccount-content .col2-set::after,
.woocommerce-MyAccount-content .woocommerce-Addresses::before,
.woocommerce-MyAccount-content .woocommerce-Addresses::after {
    content: none !important;
    display: none !important;
}

.woocommerce-MyAccount-content .woocommerce-Address,
.woocommerce-MyAccount-content .col2-set .col-1,
.woocommerce-MyAccount-content .col2-set .col-2 {
    float: none !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 1.375rem 1.5rem !important;
    background: var(--vendo-acc-bg-soft) !important;
    border: var(--vendo-acc-hairline) solid var(--vendo-acc-border) !important;
    border-radius: var(--vendo-acc-radius-sm) !important;
}

.woocommerce-MyAccount-content .woocommerce-Address-title {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.woocommerce-MyAccount-content .woocommerce-Address-title h2,
.woocommerce-MyAccount-content .woocommerce-Address-title h3 {
    margin: 0 !important;
    font-size: var(--vendo-acc-h3) !important;
}
.woocommerce-MyAccount-content .woocommerce-Address address {
    margin: 0;
    color: var(--vendo-acc-muted);
    font-style: normal;
    line-height: 1.7;
}

/* ===========================================================================
   9. SZCZEGÓŁY ZAMÓWIENIA I STRONICOWANIE
   =========================================================================== */

.woocommerce-order-details,
.woocommerce-customer-details { margin-top: 1.75rem; }

.woocommerce-MyAccount-content .woocommerce-customer-details address {
    padding: 1.125rem 1.25rem !important;
    background: var(--vendo-acc-bg-soft) !important;
    border: var(--vendo-acc-hairline) solid var(--vendo-acc-border) !important;
    border-radius: var(--vendo-acc-radius-sm) !important;
    font-style: normal;
    line-height: 1.7;
}

.woocommerce-MyAccount-content .woocommerce-pagination,
.woocommerce-MyAccount-content .woocommerce-Pagination {
    display: flex;
    gap: 0.5rem;
    margin: 1.25rem 0 0 !important;
}

/* ===========================================================================
   10. MODUŁ B2B W KARCIE KONTA
   =========================================================================== */

.woocommerce-MyAccount-content .vendo-b2b-panel,
.woocommerce-MyAccount-content .vendo-b2b-dash { margin: 0; }
.woocommerce-MyAccount-content .vendo-b2b-h3:first-child { margin-top: 0; }
.woocommerce-MyAccount-content .vendo-b2b-table th,
.woocommerce-MyAccount-content .vendo-b2b-table td { padding: 0.75rem !important; }

/* ===========================================================================
   11. RESPONSYWNOŚĆ
   =========================================================================== */

@media (max-width: 56.25rem) {
    .vendo-account,
    .woocommerce:has(> .woocommerce-MyAccount-navigation) {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 1.125rem !important;
    }

    .vendo-account > .woocommerce-MyAccount-navigation,
    .woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-MyAccount-navigation,
    .vendo-account > .woocommerce-MyAccount-content,
    .woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-MyAccount-content {
        grid-column: 1 !important;
    }
    .vendo-account > .woocommerce-MyAccount-navigation,
    .woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-MyAccount-navigation {
        grid-row: 2 !important;
    }
    .vendo-account > .woocommerce-MyAccount-content,
    .woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-MyAccount-content {
        grid-row: 3 !important;
    }

    .woocommerce-MyAccount-navigation {
        position: static;
        float: none;
        width: auto;
        margin: 0 0 1.125rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .woocommerce-MyAccount-navigation ul {
        display: flex !important;
        gap: 0.25rem;
        width: max-content;
        min-width: 100%;
    }
    .woocommerce-MyAccount-navigation li { margin: 0 !important; }
    .woocommerce-MyAccount-navigation li a { white-space: nowrap; }

    .woocommerce-MyAccount-navigation-link--customer-logout {
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: 0;
        border-left: var(--vendo-acc-hairline) solid var(--vendo-acc-border);
        padding-left: 0.25rem !important;
    }
}

@media (max-width: 37.5rem) {
    /* Tabela zamówień jako lista kart — etykiety z atrybutu data-title. */
    .woocommerce-MyAccount-content table.shop_table thead { display: none !important; }
    .woocommerce-MyAccount-content table.shop_table,
    .woocommerce-MyAccount-content table.shop_table tbody,
    .woocommerce-MyAccount-content table.shop_table tr,
    .woocommerce-MyAccount-content table.shop_table td { display: block !important; width: 100% !important; }

    .woocommerce-MyAccount-content table.shop_table tr {
        margin-bottom: 0.875rem;
        border: var(--vendo-acc-hairline) solid var(--vendo-acc-border) !important;
        border-radius: var(--vendo-acc-radius-sm);
        overflow: hidden;
    }
    .woocommerce-MyAccount-content table.shop_table td {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 0.875rem;
        padding: 0.6875rem 0.875rem !important;
        text-align: right;
    }
    .woocommerce-MyAccount-content table.shop_table td::before {
        content: attr(data-title);
        color: var(--vendo-acc-muted);
        font-size: var(--vendo-acc-font-xs) !important;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        text-align: left;
    }

    .woocommerce-MyAccount-content .form-row-first,
    .woocommerce-MyAccount-content .form-row-last,
    .woocommerce-MyAccount-content .woocommerce-form-row--first,
    .woocommerce-MyAccount-content .woocommerce-form-row--last {
        float: none !important;
        width: 100% !important;
        margin-right: 0 !important;
    }

    .woocommerce-MyAccount-content .woocommerce-message,
    .woocommerce-MyAccount-content .woocommerce-info,
    .woocommerce-MyAccount-content .woocommerce-error {
        flex-direction: column;
        align-items: flex-start;
    }
    .woocommerce-MyAccount-content .woocommerce-message .button,
    .woocommerce-MyAccount-content .woocommerce-info .button,
    .woocommerce-MyAccount-content .woocommerce-error .button {
        margin: 0 !important;
    }
}
