/* =====================================================================
   ATA B2B - Yeniden kullanilabilir UI bilesenleri
   (butonlar, kartlar, formlar, kategori agaci, urun karti, rozetler)
   ===================================================================== */

/* --- Butonlar --- */
.ata-b2b .ata-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: var(--ata-radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--ata-tr-fast), color var(--ata-tr-fast),
                border-color var(--ata-tr-fast), box-shadow var(--ata-tr-fast),
                transform var(--ata-tr-fast);
    user-select: none;
}
.ata-b2b .ata-btn:active { transform: translateY(1px); }
.ata-b2b .ata-btn--primary {
    background: var(--ata-red);
    color: #fff;
    box-shadow: var(--ata-shadow-red);
}
.ata-b2b .ata-btn--primary:hover {
    background: var(--ata-red-700);
    color: #fff;
}
.ata-b2b .ata-btn--ghost {
    background: transparent;
    color: var(--ata-red);
    border-color: var(--ata-red);
}
.ata-b2b .ata-btn--ghost:hover {
    background: var(--ata-red);
    color: #fff;
}
.ata-b2b .ata-btn--soft {
    background: var(--ata-paper);
    color: var(--ata-ink);
    border-color: var(--ata-line);
}
.ata-b2b .ata-btn--soft:hover {
    background: var(--ata-red-50);
    border-color: var(--ata-red-100);
    color: var(--ata-red-700);
}
.ata-b2b .ata-btn--white {
    background: #fff;
    color: var(--ata-red);
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.ata-b2b .ata-btn--white:hover { color: var(--ata-red-700); }
.ata-b2b .ata-btn--lg { padding: 14px 26px; font-size: 14.5px; }
.ata-b2b .ata-btn--sm { padding: 8px 14px; font-size: 12.5px; }
.ata-b2b .ata-btn--block { display: flex; width: 100%; }

/* --- Form alanlari --- */
.ata-b2b .ata-input,
.ata-b2b .ata-select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--ata-line);
    border-radius: var(--ata-radius-sm);
    background: #fff;
    font-size: 13.5px;
    color: var(--ata-ink);
    line-height: 1.4;
    transition: border-color var(--ata-tr-fast), box-shadow var(--ata-tr-fast);
}
.ata-b2b .ata-input:focus,
.ata-b2b .ata-select:focus {
    outline: none;
    border-color: var(--ata-red);
    box-shadow: 0 0 0 4px var(--ata-red-50);
}
.ata-b2b .ata-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ata-ink-2);
    margin-bottom: 6px;
    letter-spacing: .02em;
}

/* --- Card --- */
.ata-b2b .ata-card {
    background: #fff;
    border: 1px solid var(--ata-line-2);
    border-radius: var(--ata-radius-md);
    box-shadow: var(--ata-shadow-1);
    padding: 22px;
}
.ata-b2b .ata-card--lg { padding: 28px; }
.ata-b2b .ata-card--ghost {
    background: transparent;
    border: 1px dashed var(--ata-line);
    box-shadow: none;
}

/* --- Badge --- */
.ata-b2b .ata-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--ata-red-50);
    color: var(--ata-red-700);
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .03em;
}
.ata-b2b .ata-badge--gold {
    background: rgba(212,160,23,.14);
    color: #8a6c0f;
}
.ata-b2b .ata-badge--paper {
    background: var(--ata-paper);
    color: var(--ata-ink-2);
    border: 1px solid var(--ata-line);
}

/* --- Kategori agaci (sidebar) --- */
.ata-b2b .ata-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ata-b2b .ata-tree__group {
    border-bottom: 1px solid var(--ata-line-2);
}
.ata-b2b .ata-tree__group:last-child { border-bottom: 0; }

.ata-b2b .ata-tree__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 14px;
    color: var(--ata-ink);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: background var(--ata-tr-fast), color var(--ata-tr-fast);
}
.ata-b2b .ata-tree__head:hover { background: var(--ata-red-50); color: var(--ata-red-700); }
.ata-b2b .ata-tree__head i.fa-folder,
.ata-b2b .ata-tree__head i.fa-folder-open { color: var(--ata-red); margin-right: 6px; }
.ata-b2b .ata-tree__toggle {
    width: 22px; height: 22px;
    flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ata-paper);
    border-radius: 50%;
    color: var(--ata-ink-2);
    font-size: 10px;
    transition: transform var(--ata-tr);
}
.ata-b2b .ata-tree__group.is-open .ata-tree__toggle { transform: rotate(90deg); }
.ata-b2b .ata-tree__group.is-open > .ata-tree__head { color: var(--ata-red-700); }
.ata-b2b .ata-tree__group.is-active > .ata-tree__head {
    background: var(--ata-red-50);
    color: var(--ata-red-700);
}
.ata-b2b .ata-tree__group.is-active > .ata-tree__head a { color: var(--ata-red-700) !important; }
.ata-b2b .ata-tree__group.is-active > .ata-tree__head i.fa-folder,
.ata-b2b .ata-tree__group.is-active > .ata-tree__head i.fa-folder-open { color: var(--ata-red); }
.ata-b2b .ata-tree__group.is-active > .ata-tree__head .ata-tree__toggle {
    background: #fff; color: var(--ata-red-700);
}

.ata-b2b .ata-tree__children {
    list-style: none;
    margin: 0;
    padding: 0 0 8px 14px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
}
.ata-b2b .ata-tree__group.is-open > .ata-tree__children { max-height: 600px; }

.ata-b2b .ata-tree__children li a {
    display: block;
    padding: 7px 14px 7px 26px;
    font-size: 13px;
    color: var(--ata-ink-2);
    border-radius: var(--ata-radius-xs);
    position: relative;
}
.ata-b2b .ata-tree__children li a::before {
    content: "";
    position: absolute;
    left: 12px; top: 50%;
    width: 6px; height: 6px;
    background: var(--ata-line);
    border-radius: 50%;
    transform: translateY(-50%);
    transition: background var(--ata-tr-fast);
}
.ata-b2b .ata-tree__children li a:hover {
    color: var(--ata-red);
    background: var(--ata-red-50);
}
.ata-b2b .ata-tree__children li a:hover::before { background: var(--ata-red); }
.ata-b2b .ata-tree__children li.is-active a {
    color: var(--ata-red-700);
    font-weight: 600;
    background: var(--ata-red-50);
}
.ata-b2b .ata-tree__children li.is-active a::before { background: var(--ata-red); }

.ata-b2b .ata-tree__all {
    display: block;
    padding: 11px 14px;
    border-bottom: 1px solid var(--ata-line-2);
    font-weight: 600;
    color: var(--ata-ink);
    font-size: 13.5px;
}
.ata-b2b .ata-tree__all.is-active { color: var(--ata-red); }
.ata-b2b .ata-tree__all i { color: var(--ata-red); margin-right: 6px; }
.ata-b2b .ata-publisher-side__item {
    border-bottom: 1px solid var(--ata-line-2);
}
.ata-b2b .ata-publisher-side__item:last-child { border-bottom: 0; }
.ata-b2b .ata-publisher-side__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ata-ink);
}
.ata-b2b .ata-publisher-side__head span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}
.ata-b2b .ata-publisher-side__head i { color: var(--ata-red); }
.ata-b2b .ata-publisher-side__head em {
    min-width: 24px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--ata-red-50);
    color: var(--ata-red-700);
    font-size: 11px;
    text-align: center;
    font-style: normal;
}
.ata-b2b .ata-publisher-side__head:hover,
.ata-b2b .ata-publisher-side__head.is-active {
    background: var(--ata-red-50);
    color: var(--ata-red-700);
}
.ata-b2b .ata-publisher-side .ata-tree {
    padding: 0 8px 10px;
}
.ata-b2b .ata-publisher-side .ata-tree__group {
    border-bottom: 0;
}
.ata-b2b .ata-publisher-side .ata-tree__head {
    border-radius: var(--ata-radius-xs);
    padding: 9px 10px;
}
.ata-b2b .ata-publisher-side .ata-tree__children {
    padding-left: 10px;
}

/* --- Urun karti --- */
.ata-b2b .ata-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 22px;
}
.ata-b2b .ata-product {
    background: #fff;
    border: 1px solid var(--ata-line-2);
    border-radius: var(--ata-radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--ata-tr), box-shadow var(--ata-tr), border-color var(--ata-tr-fast);
    position: relative;
}
.ata-b2b .ata-product:hover {
    transform: translateY(-4px);
    box-shadow: var(--ata-shadow-2);
    border-color: var(--ata-red-100);
}
.ata-b2b .ata-product__media {
    background: linear-gradient(135deg, #fffaf1 0%, #f7efe4 100%);
    aspect-ratio: 1 / 1.05;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    position: relative;
}
.ata-b2b .ata-product__media img {
    max-height: 86%;
    max-width: 86%;
    object-fit: contain;
    transition: transform .5s ease;
}
.ata-b2b .ata-product:hover .ata-product__media img { transform: scale(1.05); }
.ata-b2b .ata-product__badge {
    position: absolute;
    top: 12px; left: 12px;
    padding: 4px 9px;
    background: var(--ata-red);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--ata-radius-xs);
    letter-spacing: .04em;
}
.ata-b2b .ata-product__body {
    padding: 16px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.ata-b2b .ata-product__title {
    font-family: var(--ata-font-h);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ata-ink);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
}
.ata-b2b .ata-product__title a { color: inherit; }
.ata-b2b .ata-product__title a:hover { color: var(--ata-red); }
.ata-b2b .ata-product__code {
    font-size: 11.5px;
    color: var(--ata-mute);
    letter-spacing: .03em;
    text-transform: uppercase;
}
.ata-b2b .ata-product__map {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 7px 9px;
    border-radius: var(--ata-radius-xs);
    background: var(--ata-paper);
    color: var(--ata-ink-2);
    font-size: 12px;
    line-height: 1.25;
}
.ata-b2b .ata-product__map i { color: var(--ata-red); }
.ata-b2b .ata-product__map span {
    font-weight: 700;
    color: var(--ata-ink);
}
.ata-b2b .ata-product__map em {
    font-style: normal;
    color: var(--ata-mute);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ata-b2b .ata-product__map em::before {
    content: "/";
    color: var(--ata-line);
    margin-right: 6px;
}
.ata-b2b .ata-product__map:hover {
    background: var(--ata-red-50);
    color: var(--ata-red-700);
}
.ata-b2b .ata-product__price {
    font-family: var(--ata-font-price) !important;
    font-size: 18px;
    font-weight: 800;
    font-style: normal;
    line-height: 1;
    letter-spacing: 0;
    color: var(--ata-red);
    margin-top: auto;
    font-variant-numeric: lining-nums tabular-nums;
    font-feature-settings: "lnum" 1, "tnum" 1, "onum" 0;
}
.ata-b2b .ata-product__currency {
    font-family: var(--ata-font-price) !important;
    font-size: 13px;
    font-weight: 700;
    font-style: normal;
    color: var(--ata-mute);
}
.ata-b2b .ata-money {
    font-family: var(--ata-font-price) !important;
    font-style: normal;
    letter-spacing: 0;
    font-variant-numeric: lining-nums tabular-nums;
    font-feature-settings: "lnum" 1, "tnum" 1, "onum" 0;
}
.ata-b2b .ata-product__actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

/* --- Bos durum --- */
.ata-b2b .ata-empty {
    padding: 40px;
    text-align: center;
    background: var(--ata-cream);
    border: 1px dashed var(--ata-line);
    border-radius: var(--ata-radius-md);
    color: var(--ata-ink-2);
}
.ata-b2b .ata-empty i {
    display: block;
    font-size: 38px;
    color: var(--ata-red);
    margin-bottom: 12px;
    opacity: .6;
}

/* --- Bilgi/uyari ribbonu --- */
.ata-b2b .ata-alert {
    padding: 12px 16px;
    border-radius: var(--ata-radius-sm);
    background: var(--ata-cream);
    color: var(--ata-ink-2);
    border-left: 3px solid var(--ata-red);
    font-size: 13px;
}
