/* =========================
   BASE
   ========================= */
* { box-sizing: border-box; }
html, body { margin:0; height:100%; font-family: Arial, sans-serif; background:#F7F9FC; color:#1E2A35; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

:root{
  --brand-blue:#2573FF;
  --brand-blue-dark:#195DDA;
  --red-price:#E6281C;
}

.container {
  width:94%;
  max-width:1250px;
  margin:0 auto;
}

/* =========================
   RESPONSIVE SWITCHES
   ========================= */
.desktop-only { display:block; }
.mobile-only { display:none; }

@media(max-width:768px){
  .desktop-only { display:none !important; }
  .mobile-only { display:flex !important; }
}

/* =========================
   HEADER
   ========================= */
.site-header{
  background:#10263A;
  position:sticky; top:0; z-index:1000;
}

/* Desktop */
.header-desktop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 0;
}
.logo-desktop img{ height:80px; }
.nav-desktop a{
  color:#fff; font-weight:600; font-size:15px; margin:0 14px; opacity:.95;
}
.nav-desktop a:hover{ opacity:1; color:#7FB0FF; }
.header-desktop .right a{
  color:#fff; font-size:15px; margin-left:14px;
}

/* Mobile */
.header-mobile{ display:none; }

@media(max-width:768px){
  .header-mobile{
    height:56px;
    background:#10263A;
    padding:0 16px;
    display:flex;
    align-items:center;
    justify-content:space-between;
  }
  .mobile-logo img{ height:42px; }
  .burger-btn{
    background:none; border:none;
    font-size:28px; color:#fff; cursor:pointer;
  }
  .cart-icon{ font-size:22px; color:#fff; font-weight:700; }
}

/* Mobile Navigation */
.mobile-menu{
  position:absolute; top:56px; left:0; right:0;
  background:#10263A;
  padding:18px 14px 22px;
  transform:translateY(-100%);
  transition:.28s ease;
  z-index:999;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.mobile-menu a{
  color:#fff; font-size:16px;
  padding:10px; border-radius:6px;
}
.mobile-menu a:hover{ background:#13324D; }
.mobile-menu.show{ transform:translateY(0); }

.mobile-overlay{
  display:none; position:fixed; inset:0;
  background:rgba(0,0,0,.45);
  z-index:998;
}
.mobile-overlay.show{ display:block; }

/* =========================
   PAGE TITLE
   ========================= */
.page-title{
  font-size:28px; font-weight:700;
  margin:26px 0 18px;
}

/* =========================
   CATALOG
   ========================= */
.catalog-wrapper{
  display:flex; gap:26px; margin-bottom:40px;
}
.catalog-content{ flex:1; }

/* Sidebar */
.sidebar{
  width:250px;
  background:#fff;
  border-radius:12px;
  padding:14px;
  border:1px solid #E6EAF1;
}
.sidebar a{
  color:var(--brand-blue);
  font-size:14px;
}
.sidebar a:hover{ color:var(--brand-blue-dark); }

@media(max-width:768px){
  .sidebar{ display:none !important; }
  .catalog-wrapper{ flex-direction:column; }
}

/* =========================
   PRODUCT CARD
   ========================= */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 15px;
}

.card{
  background:#fff;
  border-radius:12px;
  position:relative;
  overflow:hidden;
  transition:.22s;
}
.card:hover{
  transform:translateY(-3px);
  box-shadow:0 10px 32px rgba(16,38,58,.14);
}

.card-media{
  position:relative;
  aspect-ratio:4/5;
  overflow:hidden;
}
.card-media img{
  width:100%; height:100%; object-fit:cover;
}

/* CTA unified */
.card-cta {
  position:absolute; left:10px; right:10px; bottom:10px;
  height:44px;
  border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  opacity:0; transform:translateY(10px);
  transition:.18s ease;
}
@media(min-width:769px){
  .card:hover .card-cta{
    opacity:1; transform:translateY(0);
  }
}

/* Badges */
.badge-mini{
  position:absolute; top:10px; left:10px;
  font-size:11px; font-weight:700;
  padding:6px 8px;
  border-radius:999px;
  background:#fff;
  box-shadow:0 4px 12px rgba(0,0,0,.12);
}
.badge-sale{ color:#E6281C; }
.badge-new{ color:var(--brand-blue); }
.badge-hit{ color:#0B9B61; }

/* =========================
   PRODUCT TEXT
   ========================= */
.card h3{
  margin:10px 14px 6px;
  font-size:16px;
  font-weight:600;
  color:#10263A;
  height:44px;
  overflow:hidden;
  text-align:left;
}
.stock{
  margin:0 14px 4px;
  font-size:13px; color:#60718B;
  text-align:left;
}
.price{
  margin:0 14px 14px;
  font-size:18px; font-weight:700;
  text-align:left;
}
.price--red{ color:var(--red-price); }

/* =========================
   BUTTON SYSTEM (GLOBAL)
   ========================= */
.btn,
.card-cta,
.btn-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  border: none;
  transition: .18s ease;
  white-space: nowrap;
}

/* Primary */
.btn-primary,
.card-cta,
.btn-buy {
  background: var(--brand-blue);
  color: #fff !important;
}
.btn-primary:hover,
.card-cta:hover,
.btn-buy:hover {
  background: var(--brand-blue-dark);
}

/* Outline */
.btn-outline {
  background: transparent;
  border: 2px solid var(--brand-blue);
  color: var(--brand-blue) !important;
}
.btn-outline:hover {
  background: var(--brand-blue);
  color: #fff !important;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: .55;
  pointer-events: none;
}

/* =========================
   FOOTER
   ========================= */
.site-footer{
  background:#111A24; color:#E9E9EA;
  padding:44px 0 22px; margin-top:48px;
  font-size:14px;
}
.footer-top{
  display:flex; gap:38px; flex-wrap:wrap;
  justify-content:space-between;
}
.footer-bottom{
  text-align:center; margin-top:28px;
  border-top:1px solid #222B35;
  padding-top:16px; opacity:.8;
}

@media(max-width:700px){
  .footer-top{
    flex-direction:column; text-align:center;
  }
}

/* =========================
   ANIMATIONS
   ========================= */
.cart-count.bump {
  animation: bump .35s ease;
}
@keyframes bump {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* ACCORDION SIDEBAR */
.accordion-item { border-bottom: 1px solid #e1e1e1; }
.accordion-header { width:100%; padding:12px 4px; display:flex; justify-content:space-between; align-items:center; background:none; border:none; cursor:pointer; font-size:15px; color:#222; font-weight:500; }
.accordion-header:hover { color:var(--brand-blue); }
.arrow { width:10px; height:10px; border-right:2px solid #666; border-bottom:2px solid #666; transform:rotate(-45deg); transition:.25s; }
.accordion-item.active .arrow { transform:rotate(45deg); }
.accordion-body { max-height:0; overflow:hidden; transition:max-height .25s ease; }
.accordion-body ul { padding:6px 0 10px 10px; }
.accordion-body li { margin:4px 0; }
.accordion-body li a:hover { color:var(--brand-blue-dark); }


.auth-wrapper {
  max-width: 450px;
  margin: 0 auto 50px;
}

.auth-tabs {
  display: flex;
  margin-bottom: 20px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

.auth-tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: #E6EAF1;
  font-weight: 600;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--brand-blue);
  color: #fff;
}

.auth-box {
  background: #fff;
  padding: 24px;
  border-radius: 14px;
  border: 1px solid #E6EAF1;
  box-shadow: 0 4px 18px rgba(0,0,0,0.04);
  display: none;
}

.auth-box.active {
  display: block;
}

.auth-error {
  background:#ffe3e3;
  border:1px solid #b00;
  padding:10px;
  border-radius:8px;
  font-size:14px;
  margin-bottom:12px;
}

@media(max-width: 600px){
  .auth-wrapper { width:92%; }
}


.info-page {
  background:#fff;
  padding:26px;
  border-radius:14px;
  border:1px solid #E6EAF1;
  box-shadow:0 4px 18px rgba(0,0,0,0.04);
  margin-bottom:40px;
}

.info-page section {
  margin-bottom:20px;
}

.info-page h3 {
  font-size:20px;
  margin-bottom:8px;
  color:#10263A;
  border-left:4px solid var(--brand-blue);
  padding-left:10px;
}

.info-page p, .info-page li {
  font-size:15px;
  color:#2e3a4a;
}


/* ✅ Mobile Catalog Panel */
.catalog-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: -100%;
  height: 80vh;
  background: #fff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 30px rgba(0,0,0,.25);
  z-index: 1002;
  transition: bottom .35s ease-in-out;
  display: flex;
  flex-direction: column;
}
.catalog-panel.show {
  bottom: 0;
}
.catalog-header {
  padding: 14px;
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  border-bottom: 1px solid #eee;
}
.catalog-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}
.cat-item {
  background: #F2F4F7;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}
.cat-item:hover {
  background: #e9edf2;
}
.mobile-overlay.show {
  display: block !important;
}

.catalog-back {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

.catalog-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}


.auth-wrapper {
  max-width: 450px;
  margin: 0 auto 40px;
}

.auth-tabs {
  display: flex;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.auth-tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: #E7EDF4;
  cursor: pointer;
  font-weight: 600;
}

.auth-tab.active {
  background: var(--brand-blue);
  color: #fff;
}

.auth-box {
  background: #fff;
  padding: 24px;
  border-radius: 14px;
  border:1px solid #E6EAF1;
  box-shadow:0 4px 18px rgba(0,0,0,.06);
  display:none;
}

.auth-box.active {
  display:block;
}

.auth-error {
  background: #ffe0e0;
  border-left: 4px solid #d30000;
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
}


.catalog-btn {
  width: 100%;
  background: var(--brand-blue);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  padding: 14px;
  border: none;
  border-radius: 14px;
  margin: 14px 0 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.catalog-btn:hover {
  background: var(--brand-blue-dark);
}

@media(min-width:769px){
  .catalog-btn { display:none !important; }
}


@media (max-width: 768px) {
  .card-media {
    margin-bottom: 0;
  }
  .add-btn {
    margin-top: 8px;
  }
  .card h3 {
    margin-top: 8px;
  }
}


/* MOBILE ADD TO CART BUTTON — NORMAL SIZE */
@media (max-width: 768px) {
  .add-btn {
    display: flex !important;
    width: calc(100% - 20px);
    margin: 10px auto 16px;
    height: 52px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    background: var(--brand-blue) !important;
    color: #fff !important;
    align-items: center;
    justify-content: center;
  }

  .card-cta.desktop-only {
    display: none !important;
  }
}


.mobile-menu {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  background: #10263A;
  padding: 18px 14px;
  transform: translateY(-100%);
  transition: .28s ease;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mobile-menu a {
  color: #fff;
  font-size: 16px;
  padding: 10px;
  border-radius: 6px;
}

.mobile-menu a:hover {
  background: #13324D;
}

.mobile-menu.show {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .card img {
    width: 100%;
    height: auto;
    border-radius: 8px;
  }

  .card h3 {
    font-size: 14px;
  }

  .price {
    font-size: 14px;
  }
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  align-items: start;
}

.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  padding: 15px;
  text-align: center;
  transition: transform .2s;
}

.card:hover {
  transform: translateY(-4px);
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
}
@media (max-width: 600px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==== Выпадающее меню под стиль шапки ==== */
.user-dropdown {
  position: absolute;
  right: 0;
  top: 130%;
  display: none;
  flex-direction: column;
  background: #10263A; /* темно-синий как шапка */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,.25);
  min-width: 180px;
  z-index: 9999;
  border: 1px solid #0A4FA8; /* легкий контур синего */
}

.user-dropdown a {
  color: #fff;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.user-dropdown a:hover {
  background: #195DDA; /* яркий синий при наведении */
  color: #fff;
}

.user-menu.active .user-dropdown {
  display: flex;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}