/* ───────── базовые штрихи ───────── */
body{
    --bs-body-font-family:"Segoe UI","Roboto","Helvetica Neue",Arial,sans-serif;
    padding-top:56px;                      /* высота фикс-шапки */
}

table form{margin:0;}
.btn-outline-secondary.btn-sm{padding:.1rem .4rem;font-size:.75rem;}

/* логотип LIDER */
.logo-text{
    font-weight:800;
    font-size:1.6rem;
    letter-spacing:.05em;
    color:#fff;
    text-decoration:none;
}
.logo-text::first-letter{color:#ffc107;}

/* ссылка-профиль */
.profile-link{cursor:pointer;}
.profile-link:hover{text-decoration:underline;}

/* поиск в шапке растягивается */
.navbar-search{min-width:0;}
.navbar-search .form-control{width:100%;}

/* бейдж корзины */
.cart-badge{
    position:absolute;
    top:-.4rem;left:1.4rem;
    transform:translate(-50%,-50%);
}

/* ───────── карточки товаров ───────── */
.card{font-size:.9rem;}
.card-body{padding:.75rem;}
.card-img-top{max-height:140px;width:100%;object-fit:contain;cursor:pointer;}

/* qty-input */
.qty-input{width:72px;font-size:.9rem;}
.qty-group{gap:.25rem;}
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}
.qty-input{-moz-appearance:textfield;}

/* «Нет на складе» */
.card.sold-out{
    filter:grayscale(.9);
    opacity:.42;
    position:relative;
    pointer-events:none;
}
.card.sold-out::after{
    content:"НЕТ НА СКЛАДЕ";
    position:absolute;inset:0;
    background:rgba(0,0,0,.68);
    color:#fff;font-weight:700;font-size:1.2rem;
    display:flex;align-items:center;justify-content:center;
    letter-spacing:.05em;text-shadow:0 0 4px #000;
}

/* ошибки Django-форм */
.errorlist{
    color:#dc3545;
    list-style:none;
    margin:0 0 .5rem;
    padding-left:0;
}

/* модальное изображение */
#imgModal img{
    max-height:100vh;
    object-fit:contain;
}

/* ───────── мобильная адаптация (≤575) ───────── */
@media (max-width:575.98px){
    .logo-text{font-size:1.4rem;}
    .container{padding-inline:.75rem;}
    h1,.h1{font-size:1.5rem;}
    .card-img-top{max-height:120px;}
    .qty-group{flex-wrap:nowrap;}
    .qty-input{width:64px;margin-bottom:0!important;}
    .add-btn{flex:1 1 auto;font-size:.875rem;padding-inline:.75rem;}
    .table-responsive-sm{overflow-x:auto;}   /* общий горизонтальный скролл в таблицах */
}

/* портрет-планшет */
@media (min-width:576px) and (max-width:767.98px){
    .card-body{padding:1rem .75rem;}
}

/* планшет-ноут */
@media (min-width:768px) and (max-width:991.98px){
    .container{padding-inline:1rem;}
}

/* ≥1200px */
@media (min-width:1200px){
    .card-body{padding:1.25rem;}
}

/* ───────── прочее ───────── */
/* фото в модалке: фиксируем макс-размер и «руку»-курсор */
.modal-photo{
    max-width:100%;
    max-height:90vh;
    cursor:pointer;      /* намекает, что на фото можно нажать */
}
