
* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    background: #f6f7fb;
    font-family: 'Inter', Arial, sans-serif;
    color: #111;
    font-weight: 400;
    line-height: 1.6;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 20px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-sizing: border-box;
}
header h1 {
    font-size: 1.7em;
    color: #2a7;
    margin: 0;
    font-weight: 600;
}
.header-left { 
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 250px;
}

.category-toggle {
    font-size: 1.8em;
    background: none;
    border: none;
    color: #2a7;
    cursor: pointer;
    transition: color 0.2s;
}
.category-toggle:hover { color: #1f5; }

.search-bar {
  display: flex;
  align-items: center;
  border: 2px solid #2a7;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  height: 40px;
  transition: box-shadow 0.2s ease;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 12px;
  font-size: 15px;
  background: transparent;
  min-width: 140px;
}




.search-bar input::placeholder {
    color: #888;
}

.search-bar button {
  background: #2a7;
  color: white;
  border: none;
  padding: 0 18px;
  height: 100%;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}

.search-bar button:hover {
    background: #1f5;
}



nav { display: flex; gap: 15px; }
nav a {
    text-decoration: none;
    color: #2a7;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    transition: 0.2s;
}
nav a:hover, nav a.active {
    background-color: #2a7;
    color: #fff;
}

main {
  margin-top: 10px; 
  padding-top: 0;
}
.page-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #222;
  margin: 10px 0 25px 0;
  text-align: left;
  padding-left: 20px;
}


.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    padding: 20px 25px 40px;
}
.product {
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    cursor: pointer;
}
.product:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.product img {
    max-width: 100%;
    height: 160px;
    object-fit: contain;
    border-radius: 8px;
}
.product h2 {
    font-size: 1.05em;
    margin: 10px 0 5px;
    color: #222;
    font-weight: 500;
}
.price {
    font-weight: 600;
    color: #2a7;
    margin: 8px 0;
}
button.add-to-cart {
    background: #2a7;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}
button.add-to-cart:hover {
    background: #1f5;
}

.category-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #fff;
    box-shadow: 3px 0 12px rgba(0,0,0,0.08);
    transition: left 0.3s ease;
    z-index: 1200;
    padding: 25px 20px;
    overflow-y: auto;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.category-sidebar.open {
    left: 0;
}

.category-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


.category-nav h3 {
    font-size: 1.05em;
    color: #2a7;
    font-weight: 600;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-left: 4px solid #2a7;
    padding-left: 10px;
}


.category-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-nav li {
    margin-bottom: 8px;
}

.category-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #333;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 400;
    transition: all 0.2s ease;
    background: transparent;
}

.category-nav a:hover {
    background: #e8f5e9;
    color: #2a7;
    transform: translateX(4px);
}


.category-nav a.active {
    background-color: #2a7;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(42,170,119,0.3);
}


.menu-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 18px 0;
}

.category-nav h4 {
    font-size: 1em;
    color: #2a7;
    font-weight: 500;
    margin: 10px 0 8px;
    border-bottom: 2px solid #e8f5e9;
    padding-bottom: 4px;
}


.category-sidebar.open {
    animation: slideIn 0.3s ease forwards;
}
@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.category-nav a.active:hover {
    background-color: #1f5;
    color: #fff;
    transform: none;
}


footer {
    padding: 18px;
    background: #fff;
    text-align: center;
    color: #555;
    font-size: 0.9em;
    border-top: 1px solid #eee;
}


.about {
    max-width: 900px;
    margin: 0 auto 40px;
    background: #fff;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

.about h2, .about h3 {
    color: #2a7;
    margin-top: 20px;
    font-weight: 600;
}
.about ul {
    list-style: "⚡ ";
    padding-left: 25px;
}
.reviews blockquote {
    background: #f9f9f9;
    border-left: 4px solid #2a7;
    padding: 12px 15px;
    border-radius: 8px;
    font-style: italic;
    margin: 12px 0;
}
.reviews footer {
    font-size: 0.9em;
    text-align: right;
    color: #777;
}

.cart {
    width: 90%;
    max-width: 800px;
    margin: 90px auto;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}
.cart th, .cart td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}
.cart th {
    text-align: left;
    color: #2a7;
    font-weight: 500;
}
.total {
    font-size: 1.1em;
    font-weight: 600;
    color: #111;
    margin-top: 15px;
}
.actions button {
    background: #2a7;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    margin-right: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.actions button:hover { background: #1f5; }

@media (max-width: 700px) {
    header { flex-direction: column; align-items: flex-start; height: auto; padding: 10px 20px; }
    .search-bar input { width: 180px; }
    main { padding-top: 90px; }
    .cart { width: 95%; }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.cart-wrapper {
    width: 90%;
    max-width: 850px;
    margin: 20px auto 50px; 
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    padding: 25px 40px;
    transition: box-shadow 0.3s ease;
    animation: fadeInUp 0.4s ease; 
}
.cart-wrapper:hover {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}


.cart {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.cart th {
    text-align: left;
    padding: 14px 10px;
    background: #f8faf9;
    color: #2a7;
    font-weight: 600;
    border-bottom: 2px solid #e8f5e9;
    font-size: 0.95em;
}
.cart td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    font-size: 0.96em;
    color: #333;
}
.cart tr:last-child td {
    border-bottom: none;
}
.cart input[type="number"] {
    width: 70px;
    padding: 6px 8px;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    text-align: center;
    transition: 0.2s;
    outline: none;
}
.cart input[type="number"]:focus {
    border-color: #2a7;
    box-shadow: 0 0 0 3px rgba(42, 167, 100, 0.2);
}

.cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border-top: 1px solid #e5e5e5;
    padding-top: 15px; 
    gap: 15px;
}
.cart-footer .total {
    font-size: 1.15em;
    font-weight: 600;
    color: #222;
}
.cart-footer .total strong {
    color: #2a7;
}


.cart-footer .actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.cart-footer .actions button {
    background: #2a7;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95em;
    box-shadow: 0 3px 8px rgba(42, 167, 100, 0.25);
    transition: all 0.2s ease;
}
.cart-footer .actions button:hover {
    background: #1f5;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(42, 167, 100, 0.3);
}
.cart-footer .actions button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(42, 167, 100, 0.2);
}


@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 700px) {
    .cart-wrapper {
        padding: 20px;
        margin: 20px auto;
    }
    .cart th, .cart td {
        font-size: 0.9em;
    }
    .cart-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .cart-footer .actions {
        width: 100%;
        justify-content: flex-start;
    }
}

.cart {
    padding-top: 0 !important;      
    margin-top: 0 !important;
}

.cart table {
    margin-top: 0 !important;      
}

.cart th {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.total {
    margin-top: 10px !important;   
}

.actions {
    margin-top: 8px !important;    
}


main form {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.cart td img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.cart td img:hover {
    transform: scale(1.05);
}



.cart-wrapper {
    margin-top: 40px;
}

.cart {
    width: 90%;
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    padding: 25px 30px;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    border-collapse: separate;
    border-spacing: 0 10px;
}

.cart th {
    background: #f4faf6;
    color: #2a7;
    font-weight: 600;
    text-align: left;
    padding: 12px 10px;
    border-radius: 8px 8px 0 0;
}
.cart td {
    background: #fff;
    padding: 10px;
    border-radius: 10px;
    vertical-align: middle;
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 14px;
}

.product-thumb {
    width: 70px;
    height: 70px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-thumb img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.product-title {
    font-size: 1em;
    font-weight: 500;
    color: #222;
}

.total {
    font-size: 1.1em;
    color: #111;
}

.cart-footer {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 25px;
}

.actions button {
    background: #2a7;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 500;
    box-shadow: 0 3px 8px rgba(42, 170, 119, 0.3);
    transition: background 0.2s, transform 0.1s;
}
.actions button:hover {
    background: #249961;
    transform: translateY(-2px);
}
.empty-cart {
    text-align: center;
    margin-top: 60px;
    background: #fff;
    border-radius: 16px;
    max-width: 600px;
    padding: 40px 30px 50px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
    animation: fadeIn 0.6s ease;
}

.empty-cart-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: cartBounce 1.2s ease infinite;
}

.empty-cart h2 {
    font-size: 1.6em;
    color: #2a7;
    margin-bottom: 10px;
}

.empty-cart p {
    font-size: 1em;
    color: #555;
    margin-bottom: 25px;
}

.back-to-shop {
    display: inline-block;
    background: #2a7;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(42,170,119,0.3);
    transition: all 0.25s ease;
}

.back-to-shop:hover {
    background: #1f5;
    transform: translateY(-3px);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cartBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.alert-success {
    background: #e6ffed;
    color: #1b7e31;
    border: 1px solid #b6f0c1;
    padding: 12px 20px;
    border-radius: 10px;
    margin: 15px auto;
    width: 90%;
    max-width: 800px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #e8f9f0;
    color: #2a7;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    font-weight: 500;
    z-index: 2000;
    animation: fadeOut 5s ease forwards;
}
@keyframes fadeOut {
    0%, 85% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-10px); }
}
.user-greeting {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #f5f9ff;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  margin-right: 12px;
}

.user-emoji {
  font-size: 1.2rem;
}

.user-text {
  font-weight: 500;
  color: #333;
}

.admin-btn {
  background: #1976d2;
  color: #fff !important;
  padding: 6px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
  transition: all 0.25s ease;
}

.admin-btn:hover {
  background: #0d47a1;
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(13, 71, 161, 0.35);
}

.logout-btn {
  background: #e53935;
  color: #fff !important;
  padding: 6px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.25s ease;
}

.logout-btn:hover {
  background: #c62828;
  transform: translateY(-2px);
}


.user-panel {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}


.wave {
  animation: wave 1.8s infinite;
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(15deg); }
}

.nav-btn {
  white-space: nowrap; 
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}


.nav-btn.green {
  background: #2a7;
  color: #fff;
}
.nav-btn.green:hover {
  background: #1f5;
}

.nav-btn.blue {
  background: #e6f3ff;
  color: #1976d2;
}
.nav-btn.blue:hover {
  background: #1976d2;
  color: #fff;
}

.nav-btn.gray {
  background: #f3f4f6;
  color: #333;
}
.nav-btn.gray:hover {
  background: #dfe2e5;
}

.nav-btn.logout {
  background: #e53935;
  color: #fff;
}
.nav-btn.logout:hover {
  background: #c62828;
}

.nav-btn.admin {
  background: #1976d2;
  color: #fff;
}
.nav-btn.admin:hover {
  background: #0d47a1;
}


.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.user-greeting {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0f9f4;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  color: #2a7;
  font-weight: 500;
}


.admin-btn {
  background: #1e88e5;
  color: #fff !important;
  padding: 6px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(30, 136, 229, 0.3);
  transition: all 0.25s ease;
  display: inline-block;
}

.admin-btn:hover {
  background: #1565c0;
  transform: translateY(-2px);
}


.logout-btn {
  background: #e53935;
  color: #fff !important;
  padding: 6px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.25s ease;
  display: inline-block;
}

.logout-btn:hover {
  background: #c62828;
  transform: translateY(-2px);
}

.top-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap; 
  justify-content: flex-end;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 250px;
  text-align: right;
}

.wave {
  animation: wave 1.8s infinite;
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(15deg); }
}

.nav-btn.green {
  background: #2a7;
  color: #fff;
}
.nav-btn.green:hover {
  background: #1f5;
}

.nav-btn.blue {
  background: #e6f3ff;
  color: #1976d2;
}
.nav-btn.blue:hover {
  background: #1976d2;
  color: #fff;
}

.nav-btn.logout {
  background: #e53935;
  color: #fff;
}
.nav-btn.logout:hover {
  background: #c62828;
}

.nav-btn.admin {
  background: #1976d2;
  color: #fff;
}
.nav-btn.admin:hover {
  background: #0d47a1;
}

.nav-btn.gray {
  background: #f3f4f6;
  color: #333;
}
.nav-btn.gray:hover {
  background: #dfe2e5;
}


@media (max-width: 900px) {
  .top-nav {
    justify-content: center;
    gap: 10px;
  }
}

.user-panel:hover {
  background: #e2f3ff;
  transform: translateY(-1px);
}

.wave {
  animation: wave 1.8s infinite;
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(15deg); }
}

.nav-btn.green {
  background: #2a7;
  color: #fff;
}
.nav-btn.green:hover {
  background: #1f5;
  transform: translateY(-2px);
}

.nav-btn.blue {
  background: #e6f3ff;
  color: #1976d2;
}
.nav-btn.blue:hover {
  background: #1976d2;
  color: #fff;
  transform: translateY(-2px);
}

.nav-btn.admin {
  background: #1976d2;
  color: #fff;
}
.nav-btn.admin:hover {
  background: #0d47a1;
  transform: translateY(-2px);
}

.nav-btn.logout {
  background: #e53935;
  color: #fff;
}
.nav-btn.logout:hover {
  background: #c62828;
  transform: translateY(-2px);
}

.nav-btn.gray {
  background: #f3f4f6;
  color: #333;
}
.nav-btn.gray:hover {
  background: #e4e5e7;
}

.nav-btn.cart {
  background: #2a7;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(42, 167, 100, 0.3);
}
.nav-btn.cart:hover {
  background: #1f5;
  transform: translateY(-2px);
}


.nav-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}


@media (max-width: 950px) {
  .top-nav {
    justify-content: center;
    gap: 10px;
  }
}
.header-left h1 {
  font-size: 1.6rem;
  white-space: nowrap;
  margin: 0;
}
@media (max-width: 1150px) {
  header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-left, .top-nav {
    justify-content: center;
    flex: 1 1 100%;
  }
}/* ================================================================
   ВСТАВЬ В САМЫЙ КОНЕЦ style.css
   Больше ничего не нужно менять — только это
   ================================================================ */

@media (max-width: 768px) {

  /* ── 1. ШАПКА: компактная одна строка ────────────────────── */

  header {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    height: 56px !important;
    min-height: 56px !important;
    padding: 0 10px !important;
    gap: 8px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: #fff !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.09) !important;
    overflow: visible !important;
  }

  /* Скрываем строку с кнопками — они мешают */
  header .top-nav {
    display: none !important;
  }

  /* Левый блок: кнопка + логотип + поиск */
  .header-left {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  /* ── 2. КНОПКА ☰ — крупная зелёная ──────────────────────── */

  .category-toggle {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    flex-shrink: 0 !important;
    background: #2a7 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 3px 10px rgba(42,170,119,0.45) !important;
    cursor: pointer !important;
    padding: 0 !important;
    line-height: 1 !important;
    transition: transform 0.15s !important;
  }
  .category-toggle:active {
    transform: scale(0.92) !important;
  }

  /* ── 3. ЛОГОТИП ──────────────────────────────────────────── */

  .header-left h1 {
    font-size: 1.0rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* ── 4. ПОИСК — занимает всё свободное место ─────────────── */

  .search-bar {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 40px !important;
    border-radius: 10px !important;
    border-width: 1.5px !important;
  }
  .search-bar input {
    min-width: 0 !important;
    width: 100% !important;
    font-size: 13px !important;
    padding: 0 8px !important;
  }
  .search-bar button {
    padding: 0 10px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }

  /* ── 5. БОКОВАЯ ПАНЕЛЬ КАТЕГОРИЙ ─────────────────────────── */

  .category-sidebar {
    width: 74% !important;
    max-width: 270px !important;
    padding: 18px 12px 40px !important;
    border-radius: 0 20px 20px 0 !important;
  }
  .category-nav a {
    padding: 10px 11px !important;
    border-radius: 10px !important;
    font-size: 0.93em !important;
    /* убираем сдвиг при hover чтобы не дёргалось */
    transform: none !important;
    transition: background 0.18s, color 0.18s !important;
  }
  .category-nav a:hover {
    transform: none !important;
  }

  /* ── 6. ЗАГОЛОВОК СТРАНИЦЫ ───────────────────────────────── */

  .page-title {
    font-size: 1.15rem !important;
    padding: 12px 12px 4px !important;
    margin: 0 !important;
    /* обрезаем если не влезает */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* ── 7. СЕТКА ТОВАРОВ: ровно 2 колонки ──────────────────── */

  .products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 10px 10px 80px !important;
  }

  .product {
    padding: 10px !important;
    border-radius: 14px !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07) !important;
    transform: none !important;
    transition: transform 0.18s, box-shadow 0.18s !important;
  }
  .product:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 16px rgba(0,0,0,0.1) !important;
  }

  .product img {
    height: 115px !important;
    width: 100% !important;
    object-fit: contain !important;
    border-radius: 10px !important;
    background: #f8f9fa !important;
    padding: 4px !important;
    box-sizing: border-box !important;
  }

  .product h2 {
    font-size: 0.82em !important;
    font-weight: 500 !important;
    margin: 7px 0 3px !important;
    line-height: 1.35 !important;
    flex: 1 !important;
    /* обрезаем название в 2 строки */
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .product .price {
    font-size: 0.93em !important;
    font-weight: 700 !important;
    margin: 4px 0 8px !important;
  }

  button.add-to-cart {
    width: 100% !important;
    padding: 9px 0 !important;
    font-size: 0.78em !important;
    font-weight: 600 !important;
    border-radius: 9px !important;
    min-height: 36px !important;
  }

  /* ── 8. МОДАЛЬНОЕ ОКНО: выезжает снизу ──────────────────── */

  .product-modal {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 88vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 22px 22px 0 0 !important;
    padding: 6px 16px 30px !important;
    box-shadow: 0 -6px 28px rgba(0,0,0,0.14) !important;
    z-index: 2000 !important;
    box-sizing: border-box !important;
  }

  /* Ручка сверху */
  .product-modal::before {
    content: '' !important;
    display: block !important;
    width: 36px !important;
    height: 4px !important;
    background: #ddd !important;
    border-radius: 2px !important;
    margin: 10px auto 14px !important;
  }

  .modal-header {
    position: relative !important;
    padding-right: 36px !important;
    margin-bottom: 12px !important;
  }
  .modal-header h3 {
    font-size: 1em !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
  }

  .close-btn {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 30px !important;
    height: 30px !important;
    background: #f0f0f0 !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 17px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    line-height: 1 !important;
    padding: 0 !important;
  }

  /* Фото + текст — вертикально */
  .modal-content {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: stretch !important;
  }
  .modal-content img {
    width: 100% !important;
    height: 185px !important;
    object-fit: contain !important;
    border-radius: 12px !important;
    background: #f8f9fa !important;
    padding: 8px !important;
    box-sizing: border-box !important;
  }
  .modal-details {
    width: 100% !important;
  }
  .modal-details .price {
    font-size: 1.4em !important;
    font-weight: 700 !important;
    margin: 6px 0 10px !important;
  }
  .modal-details ul {
    padding: 0 !important;
    list-style: none !important;
    margin: 0 0 10px !important;
  }
  .modal-details li {
    font-size: 0.87em !important;
    padding: 5px 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
  }
  .modal-benefits {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 7px !important;
    margin-top: 10px !important;
  }
  .modal-benefits span {
    font-size: 0.76em !important;
    padding: 8px 4px !important;
    text-align: center !important;
    border-radius: 9px !important;
  }
  .modal-details button {
    width: 100% !important;
    padding: 13px !important;
    font-size: 1em !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    margin-top: 12px !important;
    box-shadow: 0 4px 14px rgba(42,170,119,0.35) !important;
  }

  /* ── 9. КОРЗИНА ──────────────────────────────────────────── */

  .cart-wrapper {
    width: 100% !important;
    padding: 14px 10px !important;
    margin: 10px 0 20px !important;
    border-radius: 14px !important;
  }

  /* Горизонтальный скролл таблицы */
  .cart-wrapper table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
  }
  .cart th,
  .cart td {
    font-size: 0.81em !important;
    padding: 7px 5px !important;
  }
  .product-thumb {
    width: 42px !important;
    height: 42px !important;
  }
  .product-title {
    white-space: normal !important;
    max-width: 100px !important;
    font-size: 0.81em !important;
  }
  .cart input[type="number"] {
    width: 50px !important;
    padding: 5px !important;
  }
  .cart-footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .cart-footer .actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .cart-footer .actions button {
    width: 100% !important;
    min-height: 46px !important;
    border-radius: 10px !important;
  }

  /* ── 10. ЧАТ — не перекрывает контент ───────────────────── */

  #chatWidget {
    width: calc(100vw - 20px) !important;
    right: 10px !important;
    left: 10px !important;
    bottom: 16px !important;
    border-radius: 16px !important;
    max-height: 60vh !important;
  }
  #chatToggle {
    bottom: 16px !important;
    right: 16px !important;
    width: 50px !important;
    height: 50px !important;
    font-size: 20px !important;
    z-index: 998 !important;
  }

  /* ── 11. О НАС ───────────────────────────────────────────── */

  .about {
    margin: 0 10px 24px !important;
    padding: 16px 14px !important;
    border-radius: 12px !important;
  }

  /* ── 12. РАЗНОЕ ──────────────────────────────────────────── */

  body {
    overflow-x: hidden !important;
  }
  .overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  footer {
    padding: 14px !important;
    font-size: 0.84em !important;
  }
  .alert-success {
    top: 64px !important;
    right: 10px !important;
    left: 10px !important;
    width: auto !important;
    font-size: 0.87em !important;
    border-radius: 10px !important;
  }
  .empty-cart {
    margin: 20px 12px !important;
    padding: 28px 16px 36px !important;
  }

  /* ── 13. ФИКС inline-стилей на странице товара ───────────── */

  div[style*="display:flex"],
  div[style*="display: flex"] {
    flex-wrap: wrap !important;
  }
  div[style*="width:40%"], div[style*="width: 40%"],
  div[style*="width:45%"], div[style*="width: 45%"],
  div[style*="width:50%"], div[style*="width: 50%"],
  div[style*="width:55%"], div[style*="width: 55%"],
  div[style*="width:60%"], div[style*="width: 60%"],
  div[style*="width:35%"], div[style*="width: 35%"] {
    width: 100% !important;
    min-width: unset !important;
  }

  /* ── 14. MAIN — отступ чтобы контент не лип к шапке ─────── */

  main {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
}

/* ── МАЛЕНЬКИЕ ТЕЛЕФОНЫ до 420px ─────────────────────────── */
@media (max-width: 420px) {
  .products {
    gap: 8px !important;
    padding: 8px 8px 80px !important;
  }
  .product img { height: 100px !important; }
  .product h2  { font-size: 0.75em !important; }
  .product .price { font-size: 0.85em !important; }
  button.add-to-cart { font-size: 0.73em !important; padding: 8px 0 !important; }
  header { padding: 0 8px !important; gap: 6px !important; height: 52px !important; }
  .header-left h1 { font-size: 0.9rem !important; }
  .category-toggle {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    font-size: 17px !important;
  }
}