/* Vizuální volba země v 1. kroku objednávky (xinzuo.at). */
.xz-country-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 560px;
  margin-top: 8px;
}

.xz-country-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 16px 44px 16px 18px;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  background: #fff;
  color: #171717;
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(17, 17, 17, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease,
    transform 160ms ease, background-color 160ms ease;
}

.xz-country-option:hover {
  border-color: #9f8750;
  box-shadow: 0 5px 16px rgba(17, 17, 17, 0.1);
  transform: translateY(-1px);
}

.xz-country-option:focus-visible {
  outline: 3px solid rgba(183, 145, 57, 0.28);
  outline-offset: 2px;
}

.xz-country-option[aria-checked="true"] {
  border-color: #171717;
  background: #fbf9f4;
  box-shadow: 0 0 0 1px #171717, 0 6px 18px rgba(17, 17, 17, 0.09);
}

.xz-country-flag {
  flex: 0 0 auto;
  width: 48px;
  height: 32px;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(17, 17, 17, 0.14);
}

.xz-country-flag--de {
  background: linear-gradient(
    to bottom,
    #171717 0 33.333%,
    #dd0000 33.333% 66.666%,
    #ffce00 66.666% 100%
  );
}

.xz-country-flag--at {
  background: linear-gradient(
    to bottom,
    #ed2939 0 33.333%,
    #fff 33.333% 66.666%,
    #ed2939 66.666% 100%
  );
}

.xz-country-flag--cz {
  position: relative;
  background: linear-gradient(to bottom, #fff 0 50%, #d7141a 50% 100%);
}

.xz-country-flag--cz::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 52%;
  height: 100%;
  background: #11457e;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  content: "";
}

.xz-country-flag--sk {
  position: relative;
  background: linear-gradient(
    to bottom,
    #fff 0 33.333%,
    #0b4ea2 33.333% 66.666%,
    #ee1c25 66.666% 100%
  );
}

.xz-country-flag--sk::before {
  position: absolute;
  top: 7px;
  left: 12px;
  width: 12px;
  height: 16px;
  border: 1px solid #fff;
  border-radius: 4px 4px 7px 7px;
  background: #ee1c25;
  content: "";
}

.xz-country-flag--sk::after {
  position: absolute;
  top: 8px;
  left: 14px;
  width: 10px;
  height: 12px;
  background:
    linear-gradient(#fff, #fff) center / 2px 11px no-repeat,
    linear-gradient(#fff, #fff) center 3px / 8px 2px no-repeat,
    linear-gradient(#fff, #fff) center 7px / 7px 2px no-repeat;
  content: "";
}

.xz-country-name {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
}

.xz-country-check {
  position: absolute;
  top: 50%;
  right: 16px;
  display: grid;
  width: 22px;
  height: 22px;
  border: 1px solid #c9c9c9;
  border-radius: 50%;
  color: transparent;
  place-items: center;
  transform: translateY(-50%);
}

.xz-country-option[aria-checked="true"] .xz-country-check {
  border-color: #171717;
  background: #171717;
  color: #fff;
}

.xz-country-check::before {
  content: "";
  width: 7px;
  height: 4px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: translateY(-1px) rotate(-45deg);
}

/* Select zůstává ve formuláři, ale ovládá se přístupnými tlačítky výše. */
#deliveryCountryId.xz-country-original {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Druhý krok objednávky: vybraná země a cesta zpět k její změně. */
.xz-country-step2-summary {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0 14px;
  width: 100% !important;
  max-width: 600px !important;
  padding: 18px !important;
  border: 1px solid #ded7c8;
  border-radius: 10px;
  background: #fbf9f4;
  box-shadow: 0 3px 12px rgba(17, 17, 17, 0.05);
}

/* Shoptet tuto třídu přidá po zapnutí odlišné doručovací adresy. */
.xz-country-step2-summary.js-location--hidden {
  display: none !important;
}

.xz-country-summary-flag {
  width: 42px;
  height: 28px;
  aspect-ratio: 3 / 2;
}

.xz-country-step2-name {
  color: #171717;
  font-size: 17px;
  font-weight: 700;
}

.xz-country-change-note {
  grid-column: 1 / -1;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 16px 0 0 !important;
  padding: 14px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #333;
  font-style: normal !important;
  line-height: 1.4;
}

.xz-country-change-icon {
  display: grid;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eee7d7;
  color: #171717;
  font-size: 21px;
  font-weight: 700;
  place-items: center;
  text-decoration: none !important;
  transition: background-color 160ms ease, color 160ms ease,
    transform 160ms ease;
}

.xz-country-change-icon:hover {
  background: #171717;
  color: #fff;
  transform: translateX(-2px);
}

.xz-country-change-icon:focus-visible {
  outline: 3px solid rgba(183, 145, 57, 0.3);
  outline-offset: 2px;
}

.xz-country-change-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.xz-country-change-title {
  color: #171717;
  font-size: 14px;
  font-weight: 700;
}

.xz-country-change-description {
  color: #656565;
  font-size: 13px;
}

.xz-country-change-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid #171717;
  border-radius: 7px;
  background: #171717;
  color: #fff !important;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  transition: background-color 160ms ease, border-color 160ms ease,
    transform 160ms ease;
}

.xz-country-change-link:hover {
  border-color: #9f8750;
  background: #9f8750;
  color: #fff !important;
  transform: translateY(-1px);
}

.xz-country-change-link:focus-visible {
  outline: 3px solid rgba(183, 145, 57, 0.3);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .xz-country-picker {
    gap: 8px;
  }

  .xz-country-option {
    flex-direction: column;
    justify-content: center;
    gap: 9px;
    min-height: 112px;
    padding: 14px 32px 12px 12px;
    text-align: center;
  }

  .xz-country-check {
    top: 12px;
    right: 10px;
    transform: none;
  }

  .xz-country-name {
    font-size: 15px;
  }

  .xz-country-step2-summary {
    padding: 14px !important;
  }

  .xz-country-change-note {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 12px;
  }

  .xz-country-change-link {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .xz-country-option {
    transition: none;
  }

  .xz-country-change-link {
    transition: none;
  }

  .xz-country-change-icon {
    transition: none;
  }
}
