/*
Theme Name: JE TO TAM
Template: hello-elementor
Description: Child theme pro Hello Elementor s vylepšenými WooCommerce formuláři (profil, registrace, firemní údaje).
Author: Mike
Version: 1.0
*/

/* ------------------------------
   Obecné styly formulářů účtu
--------------------------------*/
.woocommerce-EditAccountForm input,
.woocommerce-EditAccountForm button {
  width: 100%;
  max-width: 400px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.woocommerce-Button.button,
.button {
  background-color: #45b5d4;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  text-decoration: none;
}

.woocommerce-Button.button:hover,
.button:hover {
  background-color: #1b9cbc;
  color: #fff;
}

fieldset {
  border: 1px solid #ddd;
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 6px;
}

legend {
  font-weight: 600;
  margin-bottom: 5px;
}

#profile-overview p {
  margin: 5px 0;
}

/* --- Registrace: fix rozbalení firemních polí a tlačítka --- */
.elementor .woocommerce,
.elementor .woocommerce * {
  overflow: visible !important;
}

.elementor .woocommerce form.woocommerce-form-register {
  display: block !important;
  height: auto !important;
  overflow: visible !important;
  padding-bottom: 12px;
}

/* Firemní blok – správné mezery a roztažení */
#company_fields {
  display: block;
  overflow: visible !important;
  margin: 15px 0;
  clear: both;
}

/* IČO a DIČ vedle sebe */
#company_fields .form-row-first {
  width: 48%;
  float: left;
}

#company_fields .form-row-last {
  width: 48%;
  float: right;
}

#company_fields .clear {
  clear: both;
}

/* Mobilní zobrazení */
@media (max-width: 767px) {
  #company_fields .form-row-first,
  #company_fields .form-row-last {
    width: 100%;
    float: none;
  }
}

/* ----------------------------------------------
   Styl profilu – sjednocení s login/registrací
------------------------------------------------*/
#profile-form {
  max-width: 420px;
  margin: 0 auto 40px auto;
  padding: 25px 30px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

#profile-form h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: left;
}

#profile-form input[type="text"],
#profile-form input[type="email"],
#profile-form input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f9f9f9;
  transition: all 0.2s ease-in-out;
  margin-bottom: 15px;
  font-size: 15px;
}

#profile-form input:focus {
  border-color: #45b5d4;
  background: #fff;
  outline: none;
}

#profile-form .woocommerce-Button.button {
  width: 100%;
  background-color: #45b5d4;
  color: #fff;
  padding: 10px 0;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  transition: background 0.3s ease;
}

#profile-form .woocommerce-Button.button:hover {
  background-color: #1b9cbc;
}

/* Změna hesla */
#password-fields input {
  margin-bottom: 15px;
}

/* Přehled profilu */
#profile-overview {
  max-width: 500px;
  margin: 0 auto;
  padding: 20px 30px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

#profile-overview h2 {
  font-size: 22px;
  margin-bottom: 15px;
}

#profile-overview p {
  font-size: 15px;
  margin: 6px 0;
}

#profile-overview button {
  margin-top: 15px;
  margin-right: 10px;
  background-color: #45b5d4;
  color: #fff;
  border-radius: 4px;
  border: none;
  padding: 8px 20px;
  transition: background 0.3s ease;
}

#profile-overview button:hover {
  background-color: #1b9cbc;
}

/* === Fakturační adresa === */
.woocommerce-EditAccountAddressForm {
  max-width: 680px;
  margin: 0 auto;
}

.woocommerce-EditAccountAddressForm h3 {
  font-size: 1.4rem;
  margin-bottom: 1em;
  color: #222;
}

.woocommerce-EditAccountAddressForm label {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
}

.woocommerce-EditAccountAddressForm input.input-text,
.woocommerce-EditAccountAddressForm select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f9f9f9;
  transition: all 0.2s ease;
}

.woocommerce-EditAccountAddressForm input:focus,
.woocommerce-EditAccountAddressForm select:focus {
  border-color: #45b5d4;
  background: #fff;
  outline: none;
}

.woocommerce-EditAccountAddressForm .form-row {
  margin-bottom: 16px;
}

.woocommerce-EditAccountAddressForm fieldset {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px 18px 8px;
  margin-bottom: 20px;
  background-color: #fafafa;
}

.woocommerce-EditAccountAddressForm fieldset legend {
  font-weight: 600;
  color: #333;
  padding: 0 6px;
}

.woocommerce-EditAccountAddressForm .button {
  background-color: #45b5d4;
  color: #fff;
  font-weight: 600;
  padding: 10px 22px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.woocommerce-EditAccountAddressForm .button:hover {
  background-color: #1b9cbc;
}

/* Zarovnání formulářových řádků */
.woocommerce-EditAccountAddressForm .form-row-first {
  float: left;
  width: 48%;
  clear: both;
}

.woocommerce-EditAccountAddressForm .form-row-last {
  float: right;
  width: 48%;
}

.woocommerce-EditAccountAddressForm .clear {
  clear: both;
}

.woocommerce-EditAccountAddressForm .required {
  color: #ff4d4f;
  font-weight: 700;
  margin-left: 2px;
}

.woocommerce-EditAccountAddressForm input:invalid {
  border-color: #d63638;
  background-color: #fff6f6;
}

/* ----------------------------------------------
   Sjednocení mezer a rozložení formulářů
------------------------------------------------*/
input,
select,
textarea {
  box-sizing: border-box;
}

form.woocommerce-EditAccountAddressForm,
form.woocommerce-EditAccountForm,
#profile-form,
form.woocommerce-form-register {
  margin-bottom: 40px;
}

label {
  margin-bottom: 4px;
}

input,
select,
textarea {
  margin-bottom: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
  background: #f9f9f9;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #45b5d4;
  background: #fff;
  outline: none;
}

.elementor-widget-container form {
  overflow: visible !important;
  height: auto !important;
}

/* === Sekce Moje adresy === */
.account-section-desc {
  color: #555;
  margin-bottom: 25px;
}

.account-addresses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.account-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.account-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.account-card-header h4 {
  font-size: 18px;
  font-weight: 600;
  color: #222;
  margin: 0;
}

.account-btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 500;
  border-radius: 8px;
  padding: 6px 14px;
  transition: all 0.2s ease-in-out;
}

.account-btn-blue {
  background-color: #45b5d4;
  color: #fff !important;
}

.account-btn-blue:hover {
  background-color: #1b9cbc;
  color: #fff !important;
}

.account-card-body address {
  color: #333;
  line-height: 1.6;
  font-style: normal;
  margin: 0;
}

.account-section-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
}

/* 💙 Select boxy WooCommerce */
.woocommerce form .woocommerce-address-fields select,
.woocommerce form select.country_to_state {
  background-color: #fff;
  color: #000 !important;
  border: 1px solid #c8c8c8;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23000000' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 6px;
}

.woocommerce form .woocommerce-address-fields select option {
  color: #000 !important;
  background: #fff;
}

.woocommerce form .woocommerce-address-fields select option[disabled] {
  color: #999 !important;
}

.woocommerce form .woocommerce-address-fields select:focus {
  border-color: #0073e6;
  box-shadow: 0 0 0 2px rgba(0, 115, 230, 0.2);
  outline: none;
}

/* Tlačítko "Stejná jako fakturační" */
.button--copy-billing {
  background-color: #45b5d4;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.25s ease;
}

.button--copy-billing:hover {
  background-color: #1b9cbc !important;
  color: #fff;
}

.form-row-wide:has(.button--copy-billing) {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  clear: both;
  margin-bottom: 20px;
}

/* ================================================
   💎 Zarovnání obsahu adres (Fakturační / Doručovací)
   – sjednocené levé okraje a grid layout
=================================================*/

.account-addresses-grid {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

/* Každá karta má stejnou výšku a strukturu */
.account-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Tělo adresy – dvousloupcový grid */
.account-card-body {
  display: grid;
  grid-template-columns: 150px 1fr; /* levý sloupec labely, pravý hodnoty */
  column-gap: 10px;
  row-gap: 6px;
  font-size: 15px;
  line-height: 1.5;
}

/* Odstraní odsazení u jednotlivých <p> */
.account-card-body p {
  display: contents; /* zajistí rovné sloupce */
  margin: 0;
}

/* Levý sloupec (label) */
.account-card-body strong {
  font-weight: 600;
  color: #111;
}

/* Pravý sloupec (hodnota) */
.account-card-body span,
.account-card-body a {
  color: #333;
  font-weight: 400;
}

/* Zajistí stejnou výšku obou boxů */
.account-card {
  min-height: 100%;
}

/* Mobilní zobrazení – přepne na 1 sloupec */
@media (max-width: 767px) {
  .account-card-body {
    grid-template-columns: 1fr;
  }
}

.custom-checkout-wrapper fieldset {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 25px;
  background: #fafafa;
}

.custom-checkout-wrapper legend {
  font-weight: 600;
  font-size: 1.1em;
  color: #333;
  margin-bottom: 10px;
}

.custom-checkout-wrapper .two-cols {
  display: flex;
  gap: 20px;
}

.custom-checkout-wrapper p {
  flex: 1;
  margin-bottom: 12px;
}

.custom-checkout-wrapper input,
.custom-checkout-wrapper select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.custom-checkout-wrapper .required {
  color: #d00;
}

/* Skrytí původních WooCommerce formulářů */
.woocommerce-billing-fields,
.woocommerce-shipping-fields,
#customer_details {
  display: none !important;
}

/* Layout pokladny – formulář vlevo, shrnutí vpravo */
.custom-checkout-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr; /* přesnější poměr */
  gap: 40px;
  align-items: flex-start;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Zarovná shrnutí a platby vpravo */
.custom-checkout-summary {
  position: sticky;
  top: 20px;
}

@media (max-width: 768px) {
  .custom-checkout-layout {
    grid-template-columns: 1fr;
  }
  .custom-checkout-summary {
    position: static;
  }
}

.custom-checkout-wrapper fieldset {
  padding: 15px;
}

.custom-checkout-wrapper input[type="checkbox"] {
  width: auto;
  margin-right: 6px;
  transform: scale(1.1);
}

/* 💎 FIX pro Elementor wrapper na pokladně */
.woocommerce-checkout .elementor-widget-container > .custom-checkout-layout {
  display: grid !important;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: flex-start;
  width: 100%;
}

.woocommerce-checkout .elementor-widget-container > .custom-checkout-layout .custom-checkout-wrapper {
  grid-column: 1;
}

.woocommerce-checkout .elementor-widget-container > .custom-checkout-layout .custom-checkout-summary {
  grid-column: 2;
  position: sticky;
  top: 20px;
}

/* 📱 Mobilní přepnutí na jeden sloupec */
@media (max-width: 900px) {
  .woocommerce-checkout .elementor-widget-container > .custom-checkout-layout {
    grid-template-columns: 1fr !important;
  }
  .woocommerce-checkout .elementor-widget-container > .custom-checkout-layout .custom-checkout-summary {
    position: static;
  }
}

/* ============================================
   🌀 AJAX overlay (při načítání pokladny)
   ============================================ */
.blockUI.blockOverlay {
  background: rgba(255, 255, 255, 0.75) !important;
  backdrop-filter: blur(3px);
  position: absolute !important;
  inset: 0;
  z-index: 9999 !important;
}

.blockUI.blockOverlay::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  margin: -21px;
  border: 4px solid #45b5d4;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 💳 Checkout spacing fix */
.custom-checkout-wrapper p {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.custom-checkout-wrapper label {
  font-weight: 500;
  color: #222;
  font-size: 15px;
}

.custom-checkout-wrapper input,
.custom-checkout-wrapper select {
  background-color: #fff;
  border: 1px solid #ccc;
  transition: all 0.2s ease-in-out;
}

.custom-checkout-wrapper input:focus,
.custom-checkout-wrapper select:focus {
  border-color: #45b5d4;
  outline: none;
  background-color: #fff;
}

.custom-checkout-wrapper .two-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

@media (max-width: 1200px) {
  .custom-checkout-layout {
    gap: 30px;
  }
}

@media (max-width: 900px) {
  .custom-checkout-summary {
    margin-top: 30px;
  }
}

@media (max-width: 480px) {
  .custom-checkout-wrapper input,
  .custom-checkout-wrapper select {
    font-size: 14px;
    padding: 7px 8px;
  }

  .custom-checkout-wrapper legend {
    font-size: 1em;
  }
}

