* { box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; margin: 0; background: #f1f5f9; color: #0f172a; }
.legal-bar { background: #0f172a; color: #cbd5e1; text-align: center; padding: 8px 14px; font-size: 11px; letter-spacing: 0.04em; }
.navbar { background: #ffffff; border-bottom: 1px solid #e2e8f0; padding: 14px 20px; position: relative; z-index: 10; }
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #0f172a; font-weight: 800; font-size: 20px; }
.logo-icon { width: 36px; height: 36px; background: linear-gradient(135deg, #0ea5e9, #10b981); color: #fff; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.nav-badge { font-size: 12px; color: #047857; background: #d1fae5; padding: 6px 14px; border-radius: 20px; font-weight: 600; }

/* Шапка и диагональная карточка фармацевта */
.hero { background: linear-gradient(135deg, #e0f2fe 0%, #f0fdf4 50%, #ffffff 100%); border-bottom: 1px solid #e2e8f0; padding: 44px 20px; }
.hero-inner { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.hero-inner .visual-card.pharmacist-banner {
    width: 100%;
    max-width: 1160px;
    position: relative;
    overflow: hidden;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 48px;
    text-align: left;
    padding: 36px 48px;
    border-radius: 24px;
    border: 1px solid #bae6fd;
    background: linear-gradient(112deg, #0284c7 0%, #0d9488 38%, #7dd3fc 48%, #e0f2fe 56%, #ffffff 100%);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.ph-left-side { display: flex; align-items: center; gap: 20px; flex: 0 0 43%; color: #ffffff; }
.ph-photo-wrap { position: relative; flex-shrink: 0; animation: gentleFloat 4s ease-in-out infinite; }
.ph-photo { width: 155px; height: 155px; border-radius: 50%; object-fit: cover; object-position: top center; border: 4px solid rgba(255, 255, 255, 0.95); box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25); display: block; }
.ph-status-dot { position: absolute; bottom: 10px; right: 10px; width: 20px; height: 20px; background: #22c55e; border: 3px solid #ffffff; border-radius: 50%; animation: statusPulse 2s infinite; }
.ph-online-badge { display: inline-block; background: rgba(255, 255, 255, 0.22); color: #ffffff; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.ph-help-title { font-size: 20px; font-weight: 800; line-height: 1.25; }
.ph-help-sub { font-size: 14px; opacity: 0.95; margin-top: 6px; line-height: 1.4; }
.ph-right-side { flex: 1; padding-left: 24px; color: #0f172a; }
.delivery-pill { display: inline-flex; align-items: center; gap: 8px; background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; padding: 8px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.ph-main-title { margin: 0; font-size: 30px; font-weight: 900; line-height: 1.15; color: #0f172a; }
.ph-main-title span { color: #0284c7; }
.ph-sub { font-size: 15px; color: #334155; margin: 12px 0 0; line-height: 1.5; }

/* Поиск по центру */
.hero-center-box { max-width: 780px; width: 100%; text-align: center; margin: 0 auto; }
.search-wrapper { max-width: 680px; margin: 0 auto; background: #fff; padding: 6px; border-radius: 16px; box-shadow: 0 10px 25px rgba(15,23,42,0.1); border: 2px solid #bae6fd; display: flex; gap: 8px; }
.search-wrapper input { flex: 1; border: none; padding: 14px; font-size: 16px; outline: none; }
.search-wrapper button { background: #0284c7; color: #fff; border: none; padding: 0 26px; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; }
.quick-tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; font-size: 13px; color: #475569; }
.tag-btn { background: #fff; border: 1px solid #cbd5e1; color: #334155; padding: 6px 13px; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; }
.tag-btn:hover { border-color: #0284c7; color: #0284c7; background: #e0f2fe; }

/* Контейнер, полоса доставки и сетка карточек */
.container { max-width: 1200px; margin: 36px auto; padding: 0 20px; }
.delivery-strip { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 18px 22px; margin-bottom: 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.delivery-item { display: flex; align-items: flex-start; gap: 12px; }
.delivery-icon { font-size: 22px; background: #e0f2fe; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.delivery-item h4 { margin: 0 0 4px; font-size: 15px; }
.delivery-item p { margin: 0; font-size: 13px; color: #475569; }
.section-title { font-size: 22px; font-weight: 800; margin: 0 0 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 4px 12px rgba(15,23,42,0.04); }
.card-img-box { height: 175px; background: #f8fafc; display: flex; align-items: center; justify-content: center; padding: 16px; position: relative; border-bottom: 1px solid #f1f5f9; }
.card-img-box img { max-width: 100%; max-height: 145px; object-fit: contain; display: block; }
.card-badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; pointer-events: none; }
.badge-otc { background: #eff6ff; color: #1d4ed8; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 6px; }
.badge-hit { background: #fef3c7; color: #b45309; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 6px; }
.card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.card h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; line-height: 1.35; }
.card p { margin: 0 0 16px; font-size: 14px; line-height: 1.5; color: #475569; }
.card-footer { border-top: 1px solid #f1f5f9; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price-val { font-size: 18px; font-weight: 800; }
.btn-check { display: inline-block; background: #10b981; color: #fff; text-decoration: none; padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.btn-check:hover { background: #059669; }

/* Выделенная карточка товара по центру при переходе по объявлению (?id=...) */
.focus-wrap { max-width: 440px; margin: 0 auto 44px; text-align: center; }
.focus-label { display: inline-block; background: #d1fae5; color: #065f46; font-size: 13px; font-weight: 700; padding: 6px 16px; border-radius: 20px; margin-bottom: 14px; }
.focus-card { text-align: left; border: 2px solid #10b981 !important; box-shadow: 0 18px 36px rgba(16, 185, 129, 0.16) !important; }
.focus-card .card-img-box { height: 210px; }
.focus-card .card-img-box img { max-height: 180px; }

.alert-rx { background: #fef2f2; color: #991b1b; padding: 16px; border-radius: 12px; border: 1px solid #fecaca; }
#search-results-block { display: none; margin-bottom: 40px; padding-bottom: 28px; border-bottom: 2px dashed #cbd5e1; }
footer { background: #0f172a; color: #94a3b8; padding: 32px 20px; margin-top: 60px; font-size: 13px; line-height: 1.6; }

@keyframes gentleFloat { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-5px); } }
@keyframes statusPulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@media (max-width: 920px) {
    .hero-inner .visual-card.pharmacist-banner { flex-direction: column !important; text-align: center; padding: 24px 20px; gap: 24px; background: linear-gradient(180deg, #0284c7 0%, #0d9488 38%, #e0f2fe 52%, #ffffff 100%); }
    .ph-left-side { flex-direction: column; flex: none; width: 100%; }
    .ph-right-side { padding-left: 0; }
    .ph-photo { width: 130px; height: 130px; }
    .ph-main-title { font-size: 24px; }
}
.search-single-center {
    display: flex !important;
    justify-content: center !important;
}
.search-single-center .card {
    width: 100%;
    max-width: 440px;
}
.search-multi-center {
    justify-content: center;
}
/* Яркие анимированные акции над поиском */
.top-promo-row {
    width: 100%;
    max-width: 1160px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.top-promo-pill {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 24px;
    border-radius: 18px;
    text-decoration: none;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(2, 132, 199, 0.22);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.tp-green {
    background: linear-gradient(120deg, #059669, #10b981, #0d9488);
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
}
.tp-blue {
    background: linear-gradient(120deg, #0284c7, #0ea5e9, #2563eb);
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite reverse;
}
.top-promo-pill::after, .promo-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 65%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transform: skewX(-22deg);
    animation: shineSweep 5.5s infinite;
    pointer-events: none;
}
.top-promo-pill:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 16px 32px rgba(2, 132, 199, 0.34);
}
.tp-badge {
    background: #ffffff;
    color: #0f172a;
    padding: 5px 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    animation: badgePop 2.8s ease-in-out infinite;
}
.tp-green .tp-badge { color: #047857; }
.tp-blue .tp-badge { color: #0369a1; }
.tp-text { font-size: 15px; line-height: 1.35; flex: 1; color: #ffffff; }
.tp-arrow { font-size: 20px; font-weight: 900; color: #ffffff; transition: transform 0.25s ease; }
.top-promo-pill:hover .tp-arrow { transform: translateX(6px); }

/* Яркие нижние карточки акций с движением */
.promo-section { margin-top: 52px; padding-top: 36px; border-top: 1px solid #cbd5e1; }
.promo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.promo-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 26px;
    border-radius: 22px;
    text-decoration: none;
    color: #ffffff;
    background-size: 200% 200%;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}
.promo-card:hover { transform: translateY(-7px) scale(1.015); box-shadow: 0 22px 44px rgba(2, 132, 199, 0.28); }
.promo-blue { background: linear-gradient(135deg, #0284c7, #06b6d4, #0d9488); animation: gradientShift 7s ease infinite; }
.promo-green { background: linear-gradient(135deg, #059669, #10b981, #34d399); animation: gradientShift 8s ease infinite; }
.promo-amber { background: linear-gradient(135deg, #ea580c, #f59e0b, #eab308); animation: gradientShift 7.5s ease infinite; }
.promo-purple { background: linear-gradient(135deg, #4f46e5, #0284c7, #06b6d4); animation: gradientShift 8.5s ease infinite; }
.promo-tag {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 14px;
}
.promo-card h3 { margin: 0 0 10px; font-size: 20px; font-weight: 800; line-height: 1.3; color: #ffffff; }
.promo-card p { margin: 0 0 22px; font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, 0.95); }
.promo-btn {
    display: inline-block;
    align-self: flex-start;
    background: #ffffff;
    color: #0f172a;
    padding: 11px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.14);
    transition: transform 0.25s ease, background 0.25s ease;
}
.promo-card:hover .promo-btn { transform: translateX(4px); background: #f8fafc; }

@keyframes shineSweep { 0% { left: -120%; } 35%, 100% { left: 160%; } }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes badgePop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@media (max-width: 820px) { .top-promo-row { grid-template-columns: 1fr; } }
