/* ============================================================
   CONTACTS — contacts.css
   Styles for /contacts/ page
   ============================================================ */

.contacts-page {
  padding: var(--sp-8) 0 var(--sp-8);
}

/* ── Page header ─────────────────────────────────────────── */

.contacts-page__header {
  margin-bottom: var(--sp-10);
}

.contacts-page__title {
  font-size: clamp(var(--fs-2xl), 4vw, var(--fs-3xl));
  font-weight: var(--fw-bold);
  font-family: var(--font-display);
  color: var(--clr-text-primary);
  line-height: var(--lh-tight);
  margin-bottom: var(--sp-2);
}

.contacts-page__subtitle {
  font-size: var(--fs-md);
  color: var(--clr-text-secondary);
}

/* ── Cards grid (unified 2×3) ────────────────────────────── */

.contacts-cards-grid {
  display: grid;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

@media (min-width: 640px) {
  .contacts-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* #contacts-grid is just a logical group; its children (phone, email, address)
   participate directly in the parent .contacts-cards-grid layout. */
.contacts-grid {
  display: contents;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-6);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-2xl);
  transition: border-color var(--t-normal), box-shadow var(--t-normal), transform var(--t-normal);
}

.contact-card:hover {
  border-color: var(--clr-border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.contact-card__top {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.contact-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-lg);
  background: var(--clr-accent-glow);
  border: 1px solid var(--clr-border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  flex-shrink: 0;
}

.contact-card__label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clr-text-muted);
}

.contact-card__value {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--clr-text-primary);
  line-height: var(--lh-snug);
  word-break: break-word;
}

.contact-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-5);
  height: 44px;
  border-radius: var(--r-lg);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  font-family: var(--font-primary);
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background var(--t-normal), color var(--t-normal), border-color var(--t-normal),
              box-shadow var(--t-normal), transform var(--t-fast);
  white-space: nowrap;
  align-self: flex-start;
  background: var(--gradient-accent);
  color: var(--clr-white);
  box-shadow: 0 4px 16px var(--clr-accent-glow);
}

.contact-card__btn:hover {
  box-shadow: 0 6px 24px rgba(193, 18, 31, 0.4);
  transform: translateY(-1px);
}

.contact-card__btn:active {
  transform: scale(0.97);
}

/* ── Hours card ──────────────────────────────────────────── */

.hours-card {
  padding: var(--sp-6);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-2xl);
}

.hours-card__heading {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.hours-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-lg);
  background: var(--clr-blue-glow);
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  flex-shrink: 0;
}

.hours-card__title {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--clr-text-primary);
}

.hours-table {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.hours-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--clr-border);
}

.hours-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.hours-row__days {
  font-size: var(--fs-sm);
  color: var(--clr-text-secondary);
}

.hours-row__time {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--clr-text-primary);
}

.hours-status {
  margin-top: var(--sp-4);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--clr-success-text);
}

[data-theme="dark"] .hours-status {
  color: var(--clr-success);
}

.hours-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clr-success);
  animation: pulse-status 2s ease infinite;
}

@keyframes pulse-status {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Delivery block ──────────────────────────────────────── */

.delivery-card {
  padding: var(--sp-6);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-2xl);
}

.delivery-card__heading {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.delivery-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-lg);
  background: var(--clr-success-bg);
  border: 1px solid var(--clr-success-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  flex-shrink: 0;
}

.delivery-card__title {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--clr-text-primary);
}

.delivery-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.delivery-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--clr-border);
}

.delivery-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.delivery-item__emoji {
  font-size: 1.25rem;
  line-height: 1.4;
  flex-shrink: 0;
}

.delivery-item__text {
  font-size: var(--fs-sm);
  color: var(--clr-text-secondary);
  line-height: var(--lh-relaxed);
}

.delivery-item__text strong {
  display: block;
  font-weight: var(--fw-semibold);
  color: var(--clr-text-primary);
  margin-bottom: 2px;
}

.delivery-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--clr-accent);
  text-decoration: none;
  transition: color var(--t-fast);
}

.delivery-card__link:hover {
  color: var(--clr-accent-hover);
  text-decoration: underline;
}

/* ── Trust card ──────────────────────────────────────────── */

.trust-card {
  padding: var(--sp-6);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-2xl);
}

.trust-card__heading {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.trust-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-lg);
  background: var(--clr-accent-glow);
  border: 1px solid var(--clr-border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-accent);
  flex-shrink: 0;
}

.trust-card__title {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--clr-text-primary);
}

.trust-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--clr-border);
  font-size: var(--fs-sm);
  color: var(--clr-text-secondary);
  line-height: var(--lh-snug);
}

.trust-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.trust-item:first-child {
  padding-top: 0;
}

.trust-item__check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--clr-accent-glow);
  border: 1px solid var(--clr-border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-accent);
  flex-shrink: 0;
}

/* ── Map header bar (address + external map links) ───────── */

.map-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.map-header__info {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.map-header__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  font-family: var(--font-display);
  color: var(--clr-text-primary);
  margin: 0 0 var(--sp-1);
}

.map-header__addr {
  font-size: var(--fs-sm);
  color: var(--clr-text-secondary);
  font-style: normal;
}

.map-header__btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.map-header__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4);
  height: 40px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  font-family: var(--font-primary);
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background var(--t-normal), color var(--t-normal),
              border-color var(--t-normal), box-shadow var(--t-normal), transform var(--t-fast);
  white-space: nowrap;
}

.map-header__btn:active { transform: scale(0.97); }

.map-header__btn--primary {
  background: var(--gradient-accent);
  color: var(--clr-white);
  box-shadow: 0 4px 16px var(--clr-accent-glow);
}

.map-header__btn--primary:hover {
  box-shadow: 0 6px 24px rgba(193, 18, 31, 0.4);
  transform: translateY(-1px);
}

.map-header__btn--secondary {
  background: var(--clr-bg-card);
  color: var(--clr-text-primary);
  border-color: var(--clr-border-hover);
}

.map-header__btn--secondary:hover {
  border-color: var(--clr-accent);
  color: var(--clr-accent);
  box-shadow: 0 0 16px var(--clr-accent-glow);
  transform: translateY(-1px);
}

/* ── Map caption ─────────────────────────────────────────── */

.map-caption {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--clr-text-primary);
  margin-bottom: var(--sp-3);
}

/* ── Map section (interactive Yandex Maps / iframe fallback) ─ */

.map-section {
  border-radius: var(--r-2xl);
  overflow: hidden;
  border: 1px solid var(--clr-border);
  background: var(--clr-bg-elevated);
  line-height: 0; /* kill iframe baseline gap */
}

.map-canvas {
  width: 100%;
  height: 440px;
}

.map-section__iframe {
  display: block;
  width: 100%;
  height: 440px;
  border: none;
}

@media (max-width: 600px) {
  .map-canvas,
  .map-section__iframe { height: 360px; }
}

/* Dark theme: Yandex tiles/widget are always rendered light, so fake a dark
   skin by inverting hue. The custom pin and balloon are then counter-inverted
   (same filter applied twice = identity) so their brand colors stay correct. */
[data-theme="dark"] .map-canvas,
[data-theme="dark"] .map-section__iframe {
  filter: invert(100%) hue-rotate(180deg);
}

[data-theme="dark"] .ymap-pin,
[data-theme="dark"] .ymap-balloon {
  filter: invert(100%) hue-rotate(180deg);
}

/* ── Custom branded marker (rendered via templateLayoutFactory) ─ */

.ymap-pin {
  position: absolute;
  /* anchor the teardrop tip to the geo point */
  left: -23px;
  top: -56px;
  width: 46px;
  height: 56px;
  cursor: pointer;
}

.ymap-pin__svg {
  position: relative;
  z-index: 2;
  display: block;
  width: 46px;
  height: 56px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
  transition: transform var(--t-spring);
  transform-origin: 50% 100%;
}

.ymap-pin:hover .ymap-pin__svg {
  transform: scale(1.12);
}

/* Pulsing ring under the pin to draw the eye */
.ymap-pin__pulse {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 2px;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border-radius: 50%;
  background: var(--clr-accent);
  opacity: 0.55;
  transform: scale(1);
  animation: ymap-pulse 2s ease-out infinite;
}

@keyframes ymap-pulse {
  0%   { transform: scale(0.6); opacity: 0.6; }
  70%  { transform: scale(2.6); opacity: 0;   }
  100% { transform: scale(2.6); opacity: 0;   }
}

/* ── Balloon (info card on marker click) ─────────────────── */

.ymap-balloon {
  min-width: 220px;
  max-width: 260px;
  padding: var(--sp-3);
  margin: calc(var(--sp-1) * -1);
  border-radius: var(--r-lg);
  background: var(--clr-bg-card);
  font-family: var(--font-primary);
}

.ymap-balloon__name {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  font-family: var(--font-display);
  color: var(--clr-text-primary);
  margin-bottom: var(--sp-1);
}

.ymap-balloon__addr {
  font-size: var(--fs-sm);
  color: var(--clr-text-secondary);
  line-height: var(--lh-snug);
  margin-bottom: var(--sp-3);
}

.ymap-balloon__phone {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--clr-accent);
  text-decoration: none;
  margin-bottom: var(--sp-3);
}

.ymap-balloon__phone:hover { text-decoration: underline; }

.ymap-balloon__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 40px;
  border-radius: var(--r-md);
  background: var(--gradient-accent);
  color: var(--clr-white);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transition: box-shadow var(--t-normal), transform var(--t-fast);
}

.ymap-balloon__btn:hover {
  box-shadow: 0 6px 20px rgba(193, 18, 31, 0.4);
  transform: translateY(-1px);
}

/* ============================================================
   DARK THEME OVERRIDES
   ============================================================ */

/* Contact cards: top-highlight for depth */
[data-theme="dark"] .contact-card,
[data-theme="dark"] .hours-card,
[data-theme="dark"] .delivery-card,
[data-theme="dark"] .trust-card {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .contact-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* Map section */
[data-theme="dark"] .map-section {
  border-color: rgba(255, 255, 255, 0.08);
}

/* Secondary map button */
[data-theme="dark"] .map-header__btn--secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
}
