/* =========================================================
   hotwheelz — дополнительные стили витрины
   Расширяют оригинальный styles.css (Apple-style)
   ========================================================= */

/* ===== Card: избранное ===== */
.card__fav-form { position: absolute; top: 12px; right: 12px; z-index: 3; margin: 0; }
.card__fav {
    width: 38px; height: 38px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--ink-2);
    transition: all .2s var(--ease);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.card__fav:hover { color: var(--red); transform: scale(1.08); }
.card__fav.is-active { color: var(--red); background: #fff; }
.card__fav.is-active svg path { fill: var(--red); stroke: var(--red); }
.card__fav svg { width: 18px; height: 18px; }

/* ===== Catalog: расширенные фильтры ===== */
.catalog-extra {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 28px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
form.catalog-extra { min-width: 0; max-width: 100%; }
.catalog-extra__row {
    display: grid;
    grid-template-columns: repeat(4, 1fr) auto;
    gap: 16px;
    align-items: end;
    min-width: 0;
}
.catalog-extra__field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.catalog-extra__field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.catalog-extra__field select,
.catalog-extra__field input {
    padding: 10px 14px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    background: var(--white);
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.catalog-extra__field select:focus,
.catalog-extra__field input:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 4px var(--red-soft);
}
.catalog-extra__price { display: flex; gap: 8px; min-width: 0; }
.catalog-extra__price input { flex: 1; min-width: 0; }
.catalog-extra__field--actions { display: flex; flex-direction: row; gap: 8px; align-items: end; }

/* ===== Catalog: тулбар (счётчик + сортировка) ===== */
.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line-2);
}
.catalog-toolbar__count {
    font-size: 14px;
    color: var(--ink-2);
}
.catalog-toolbar__count strong { color: var(--ink); font-weight: 700; }
.catalog-toolbar__sort select {
    padding: 8px 14px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    background: var(--white);
    cursor: pointer;
}

/* ===== Catalog: пусто ===== */
.catalog-empty {
    text-align: center;
    padding: 80px 20px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}
.catalog-empty__icon {
    font-size: 64px;
    color: var(--ink-3);
    margin-bottom: 16px;
}
.catalog-empty h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}
.catalog-empty p {
    color: var(--ink-3);
    margin-bottom: 24px;
}

/* ===== Catalog: пагинация ===== */
.catalog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 48px;
    flex-wrap: wrap;
}
.catalog-pagination__btn {
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-2);
    transition: all .2s;
}
.catalog-pagination__btn:hover {
    border-color: var(--ink);
    color: var(--ink);
}
.catalog-pagination__btn.is-active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}
.catalog-pagination__dots {
    color: var(--ink-3);
    padding: 0 4px;
}

/* ===== Breadcrumbs ===== */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ink-3);
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.breadcrumbs a {
    color: var(--ink-2);
    transition: color .2s;
}
.breadcrumbs a:hover { color: var(--red); }
.breadcrumbs__current { color: var(--ink); font-weight: 500; }

/* ===== Product detail ===== */
.product-detail {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 56px;
    align-items: start;
}
.product-detail__media {
    position: relative;
    background: linear-gradient(160deg, var(--metal-1), var(--bg-soft));
    border-radius: var(--radius-lg);
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    overflow: hidden;
}
.product-detail__wheel {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 30px 40px rgba(20,22,26,.18));
    animation: spin 32s linear infinite;
}
.product-detail__wheel:hover { animation-play-state: paused; }
.product-detail__info { display: flex; flex-direction: column; gap: 16px; }
.product-detail__brand {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.product-detail__title {
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0;
}
.product-detail__sku {
    font-size: 13px;
    color: var(--ink-3);
}
.product-detail__price {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin: 8px 0;
}
.product-detail__price-now {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
}
.product-detail__stock {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    width: fit-content;
}
.product-detail__stock.is-ok { background: #e8f5e9; color: #2e7d32; }
.product-detail__stock.is-low { background: #fff3e0; color: #e65100; }
.product-detail__stock.is-out { background: var(--red-soft); color: var(--red-dark); }

.product-detail__buy {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 8px 0 16px;
}
.product-detail__add {
    flex: 1;
    justify-content: center;
}

.qty-control {
    display: inline-flex;
    align-items: center;
    background: var(--bg);
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 4px;
}
.qty-control button {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    transition: background .2s;
}
.qty-control button:hover { background: var(--white); }
.qty-control input {
    width: 50px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    font-family: inherit;
    -moz-appearance: textfield;
}
.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.qty-control--sm button { width: 30px; height: 30px; font-size: 16px; }
.qty-control--sm input { width: 40px; font-size: 14px; }

.product-detail__specs {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-top: 8px;
}
.product-detail__specs h3,
.product-detail__desc h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
}
.specs-table {
    width: 100%;
    border-collapse: collapse;
}
.specs-table tr { border-bottom: 1px solid var(--line-2); }
.specs-table tr:last-child { border-bottom: none; }
.specs-table td {
    padding: 10px 0;
    font-size: 14px;
}
.specs-table td:first-child {
    color: var(--ink-3);
    width: 40%;
}
.specs-table td:last-child {
    color: var(--ink);
    font-weight: 500;
}
.product-detail__desc {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-top: 8px;
}
.product-detail__desc p {
    color: var(--ink-2);
    line-height: 1.6;
    font-size: 15px;
}

/* ===== Cart page ===== */
.cart-alert {
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
}
.cart-alert--success { background: #e8f5e9; color: #2e7d32; }
.cart-alert--info { background: var(--bg); color: var(--ink-2); }
.cart-alert--error { background: var(--red-soft); color: var(--red-dark); }

.cart-empty {
    text-align: center;
    padding: 80px 20px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}
.cart-empty__icon {
    font-size: 64px;
    margin-bottom: 16px;
}
.cart-empty h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}
.cart-empty p {
    color: var(--ink-3);
    margin-bottom: 24px;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 32px;
    align-items: start;
}
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto auto 32px;
    gap: 20px;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 20px;
    transition: border-color .2s, box-shadow .2s;
}
.cart-item:hover { border-color: var(--ink-3); }
.cart-item__media {
    width: 100px;
    height: 100px;
    background: linear-gradient(160deg, var(--metal-1), var(--bg-soft));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}
.cart-item__media .wheel-img { width: 100%; height: 100%; object-fit: contain; }
.cart-item__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cart-item__brand {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cart-item__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}
.cart-item__title:hover { color: var(--red); }
.cart-item__sku { font-size: 12px; color: var(--ink-3); }
.cart-item__price {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
}
.cart-item__subtotal {
    font-size: 17px;
    font-weight: 800;
    color: var(--ink);
    white-space: nowrap;
    letter-spacing: -0.02em;
}
.cart-item__remove {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--ink-3);
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-item__remove:hover { background: var(--red-soft); color: var(--red); }
.cart-item__remove svg { width: 18px; height: 18px; }

.cart-summary {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    position: sticky;
    top: 100px;
}
.cart-summary h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}
.cart-summary__row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: var(--ink-2);
}
.cart-summary__row--muted { color: var(--ink-3); font-size: 13px; }
.cart-summary__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 16px 0;
    margin: 8px 0 16px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.cart-summary__total span:first-child {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}
.cart-summary__total span:last-child {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
}
.cart-summary__btn {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
}
.cart-summary__clear {
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    background: none;
    border: none;
    color: var(--ink-3);
    cursor: pointer;
    font-size: 13px;
    transition: color .2s;
}
.cart-summary__clear:hover { color: var(--red); }

/* ===== Checkout ===== */
.checkout-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 32px;
    align-items: start;
}
.checkout-form {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px;
}
.checkout-form__title {
    font-size: 18px;
    font-weight: 700;
    margin: 24px 0 16px;
}
.checkout-form__title:first-child { margin-top: 0; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.form-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
}
.form-field input,
.form-field select,
.form-field textarea {
    padding: 12px 16px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: var(--ink);
    background: var(--white);
    transition: border-color .2s, box-shadow .2s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 4px var(--red-soft);
}
.form-field textarea { min-height: 80px; resize: vertical; }

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    transition: all .2s;
}
.payment-option:hover { border-color: var(--ink-3); }
.payment-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--red);
}
.payment-option span { font-size: 15px; color: var(--ink); }

.checkout-summary {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    position: sticky;
    top: 100px;
}
.checkout-summary h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}
.checkout-summary__item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    font-size: 14px;
    color: var(--ink-2);
    gap: 12px;
}
.checkout-summary__item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.checkout-summary__row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: var(--ink-2);
}
.checkout-summary__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 16px 0;
    margin: 8px 0 16px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.checkout-summary__total span:first-child {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}
.checkout-summary__total span:last-child {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
}
.checkout-submit {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
}
.checkout-policy {
    font-size: 12px;
    color: var(--ink-3);
    margin-top: 12px;
    text-align: center;
    line-height: 1.4;
}

/* ===== Thanks page ===== */
.thanks-page__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: #e8f5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2e7d32;
}
.thanks-page__icon svg { width: 40px; height: 40px; }
.thanks-page__title {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 12px 0 16px;
}
.thanks-page__text {
    font-size: 18px;
    color: var(--ink-2);
    margin-bottom: 8px;
}
.thanks-page__sub {
    font-size: 15px;
    color: var(--ink-3);
    margin-bottom: 32px;
}
.thanks-page__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Contacts page ===== */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 48px;
}
.contacts-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.contacts-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}
.contacts-card__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--red-soft);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--red);
}
.contacts-card__icon svg { width: 28px; height: 28px; }
.contacts-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}
.contacts-card p {
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
    line-height: 1.3;
}
.contacts-card__hint {
    font-size: 12px;
    color: var(--ink-3);
}
.contacts-info {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 32px;
    max-width: 600px;
}
.contacts-info h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}
.contacts-info p {
    color: var(--ink-2);
    line-height: 1.8;
    font-size: 15px;
}

/* ===== Responsive ===== */
@media (max-width: 1080px) {
    .catalog-extra__row { grid-template-columns: repeat(2, 1fr); }
    .catalog-extra__field--actions { grid-column: 1 / -1; }
    .product-detail { grid-template-columns: 1fr; gap: 32px; }
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
    .checkout-layout { grid-template-columns: 1fr; }
    .checkout-summary { position: static; }
    .contacts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .catalog-extra { padding: 16px; }
    .catalog-extra__row { grid-template-columns: 1fr; gap: 12px; }
    .catalog-extra__field--actions { flex-direction: column; align-items: stretch; }
    .catalog-extra__field--actions .btn { width: 100%; }
    .catalog-extra__price { flex-direction: column; gap: 8px; }
    .catalog-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
    .catalog-toolbar__sort select { width: 100%; }
    .cart-item {
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto auto;
        gap: 12px;
    }
    .cart-item__media { width: 80px; height: 80px; }
    .cart-item__price { grid-column: 2; }
    .cart-item__subtotal { grid-column: 2; }
    .cart-item__remove { grid-column: 2; justify-self: end; }
    .form-row { grid-template-columns: 1fr; }
    .contacts-grid { grid-template-columns: 1fr; }
    .product-detail__media { padding: 24px; }
}
