/* ==========================================
   Universal Button System
   ==========================================
   Usage:
     <a class="btn btn--dark" href="#">Текст</a>
     <a class="btn btn--dark btn--sm" href="#">Маленькая</a>
     <a class="btn btn--light" href="#">Текст</a>
     <a class="btn btn--ghost" href="#">
         Показать ещё
         <span class="btn__icon"><!-- svg/img --></span>
     </a>

   Variants: btn--dark | btn--light | btn--ghost
   Sizes:    default (60px / 18px) | btn--sm (44px / 16px)
   ========================================== */

/* ── Base ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 60px;
    padding: 0 32px;
    border-radius: 4px;
    font-family: var(--font-neo);
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    box-sizing: border-box;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* ── Small size ── */
.btn--sm {
    height: 44px;
    font-size: 16px;
    line-height: 21px;
}

/* ── Icon slot ── */
.btn__icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn__icon img,
.btn__icon svg {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
}

/* Ghost uses a larger arrow icon */
.btn--ghost .btn__icon {
    width: 20px;
    height: 20px;
}

/* ==========================================
   Dark (Primary)
   bg: primary → hover: accent
   text: white → hover: black
   ========================================== */
.btn--dark {
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
}

.btn--dark:hover,
.btn--dark:focus-visible {
    background-color: var(--color-accent);
    color: var(--color-black);
}

/* Icon on dark hover becomes black */
.btn--dark:hover .btn__icon img,
.btn--dark:focus-visible .btn__icon img {
    filter: brightness(0);
}

/* ==========================================
   Light
   bg: white + grey border → hover: bg-light
   text: black
   ========================================== */
.btn--light {
    background-color: var(--color-white);
    color: var(--color-black);
    border: 1px solid var(--color-border);
}

.btn--light:hover,
.btn--light:focus-visible {
    background-color: var(--color-accent);
    color: var(--color-black);
    border-color: transparent;
}

/* ==========================================
   Ghost
   bg: transparent, green border+text → hover: filled green
   ========================================== */
.btn--ghost {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    gap: 12px;
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* Icon on ghost default is green; on hover becomes white */
.btn--ghost:hover .btn__icon img,
.btn--ghost:focus-visible .btn__icon img {
    filter: brightness(0) invert(1);
}

/* ── Loading state ── */
.btn.is-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-top: -9px;
    margin-left: -9px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    animation: btn-spin 0.65s linear infinite;
}

.btn--light.is-loading::after,
.btn--ghost.is-loading::after {
    border-color: rgba(0, 0, 0, 0.2);
    border-top-color: var(--color-black);
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}
