.speedy_hidden_checkout_fields  { display:none; }

.speedy_clear {clear:both; }

#woocommerce_speedy_shipping_method_live_description {
	  margin: 2px 0 5px;
  	  color: #666;
  	  font-style: italic;
  	  font-size: 14px;
  	  margin-bottom: 8px;

}
/* new speedy */
.speedy_shipping_to, .speedy_shipping_to_apt, .speedy_shipping_to_office, .speedy_shipping_to_address, .speedy_services, .speedy_shipping_to_address_type2 { display:none; } /* v admin nastroikite skrivam poleto s ime na ofis, koeto se zadava s js ot poleto Sender Office/Store*/

.ui-autocomplete-loading {
  background: url('/wp-includes/images/spinner.gif') no-repeat;
  background-position: right 10px center;
}


/* Center the loader */
#speedyLoader {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 100px;
  height: 100px;
  margin: -75px 0 0 -75px;
  border: 16px solid #f3f3f3;
  border-radius: 50%;
  border-top: 16px solid #dc0032;
  width: 100px;
  height: 100px;
  -webkit-animation: spin 2s linear infinite;
  animation: spin 2s linear infinite;
}

@-webkit-keyframes spin {
  0% { -webkit-transform: rotate(0deg); }
  100% { -webkit-transform: rotate(360deg); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* checkout filed style */
@media (min-width: 768px) {
#speedy_complex_id_field, #speedy_street_id_field {
  width: 60%;
}

#speedy_block_no_field, #speedy_street_no_field, #speedy_entrance_no_field, #speedy_floor_no_field, #speedy_apartment_no_field {
  width: 30%;
}

#speedy_entrance_no_field, #speedy_floor_no_field, #speedy_apartment_no_field {
  float: left;
}

#speedy_entrance_no_field, #speedy_floor_no_field {
  margin-right: 4.7% !important;
}

}

/* shipping to radio inline style */

.optional {
  display:none;
}

#speedy_shipping_to_field {
  overflow: hidden;
}

.speedy_shipping_to label {
  float: left;
  clear: none;
  padding: 2px 1em 0 0;
}

.speedy_shipping_to_input {
  float: left;
  clear: none;
  margin:  10px 5px 0 0;
}

/* speedy edit recipient address */

.speedy-info-container {
  clear: both !important; /* Forces the container below floating billing/shipping blocks */
  margin: 20px 0 !important;
  padding: 0;
  width: 100% !important;
  display: block !important;
}

.speedy-info-header {
  position: relative;
  display: flex;
  flex-wrap: wrap; 
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 15px;
  gap: 10px;
  width: 100%;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.speedy-info-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  min-width: 200px;
}

.speedy-info-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.speedy-info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 5px 0;
  text-align: left;
}

.speedy-info-row strong {
  flex-shrink: 0;
  min-width: 120px;
}

.speedy-info-row span {
  flex: 1;
  word-break: break-word;
}

@media (max-width: 782px) {
  .speedy-info-row {
    flex-direction: column;
    gap: 2px;
  }
  
  .speedy-info-row strong {
    min-width: auto;
    width: 100%;
  }
}

.edit_speedy_address, a.edit_speedy_address::after, #edit_speedy_address_user_checkout, a#edit_speedy_address_user_checkout::after  {
  font-family: Dashicons;
  content: '\f464';
  text-align: center;
  vertical-align: top;
  line-height: 14px;
  font-size: 14px;
  font-weight: 400;
}

a.edit_speedy_address, a#edit_speedy_address_user_checkout {
  width: 14px;
  height: 14px;
  padding: 0;
  margin: 0 0 0 6px;
  overflow: visible;
  color: #999;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
}

a.edit_speedy_address:hover {
    color: #000000;
}

/* Checkout saved-address edit pencil — docked to the top-right of the address block (like
   Econt/Pigeon): a small 14px pencil icon only, no text. */
#speedy_user_checkout_field .speedy_checkout_address { position: relative; }
a#edit_speedy_address_user_checkout {
  width: 14px;
  height: 0;
  padding: 14px 0 0;
  margin: 0 0 0 6px;
  overflow: hidden;
  position: relative;
  display: block;
  float: right;
  color: #999;
}
a#edit_speedy_address_user_checkout:hover { color: #000; }
a#edit_speedy_address_user_checkout::after {
  position: absolute;
  top: 0;
  left: 0;
}

/* Speedy order edit page address fields layout */

/* Hide address wrappers by default */
#speedy_edit_recipient_address .speedy-field-wrapper.speedy_shipping_to_address {
  display: none;
}

/* Locality field full width */
#speedy_edit_recipient_address #speedy_site_id_field {
  width: 100%;
  margin-bottom: 15px;
}

#speedy_edit_recipient_address #speedy_site_id_field .select2-container {
  width: 100% !important;
}

/* Custom field wrapper styles - using overflow for clearfix */
#speedy_edit_recipient_address .speedy-field-wrapper {
  margin-bottom: 15px;
  width: 100%;
  overflow: hidden;
}

/* Street row: 2/3 + 1/3 */
#speedy_edit_recipient_address .speedy-field-wrapper.speedy-field-street-pair .speedy-field-2-3 {
  float: left;
  width: 65%;
  margin-right: 2%;
}

#speedy_edit_recipient_address .speedy-field-wrapper.speedy-field-street-pair .speedy-field-1-3 {
  float: left;
  width: 33%;
}

/* Quarter row: 2/3 + 1/3 */
#speedy_edit_recipient_address .speedy-field-wrapper.speedy-field-quarter-pair .speedy-field-2-3 {
  float: left;
  width: 65%;
  margin-right: 2%;
}

#speedy_edit_recipient_address .speedy-field-wrapper.speedy-field-quarter-pair .speedy-field-1-3 {
  float: left;
  width: 33%;
}

/* Triple row: 1/3 + 1/3 + 1/3 */
#speedy_edit_recipient_address .speedy-field-wrapper.speedy-field-triple .speedy-field-third {
  float: left;
  width: 32%;
  margin-right: 2%;
}

#speedy_edit_recipient_address .speedy-field-wrapper.speedy-field-triple .speedy-field-third:last-child {
  margin-right: 0;
}

/* Full width fields */
#speedy_edit_recipient_address .speedy-field-wrapper.speedy-field-full .speedy-field-full {
  width: 100%;
}

#speedy_edit_recipient_address .speedy-field label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

#speedy_edit_recipient_address .speedy-field input[type="text"],
#speedy_edit_recipient_address .speedy-field select {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background-color: #fff;
  color: #333;
  min-height: 38px;
  margin: 0;
  box-sizing: border-box;
}

#speedy_edit_recipient_address .speedy-field input[type="text"]:focus,
#speedy_edit_recipient_address .speedy-field select:focus {
  outline: none;
  border-color: #0073aa;
  box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Override Select2 styles for custom fields */
#speedy_edit_recipient_address .speedy-field .select2-container {
  width: 100% !important;
}

/* Override WooCommerce admin Select2 width */
.post-type-shop_order #speedy_edit_recipient_address .speedy-field .select2-container,
.post-type-shop_order #speedy_edit_recipient_address .speedy-field-2-3 .select2-container {
  width: 100% !important;
}

#speedy_edit_recipient_address .speedy-field .select2-container .select2-selection--single {
  height: 38px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  padding: 5px 10px !important;
}

#speedy_edit_recipient_address .speedy-field .select2-container .select2-selection__rendered {
  line-height: 26px !important;
  color: #333 !important;
  padding-left: 0 !important;
}

#speedy_edit_recipient_address .speedy-field .select2-container .select2-selection__arrow {
  height: 36px !important;
}

#speedy_services_errors > p {
  color: #FF0000;
} 

/* wrap select2 checkout fields */
.select2-selection--single {
  height: 100% !important;
}
.select2-selection__rendered{
  word-wrap: break-word !important;
  text-overflow: inherit !important;
  white-space: normal !important;
}

.speedy_hide {
  display: none!important;
}

/* Keep the initial checkout paint stable: the office / APS / street / services sections start
   hidden and are revealed by JS (.show(), which sets an inline display that overrides these)
   once a locality is chosen. Without this they render visible in the server HTML and are only
   hidden a moment later by the DOM-ready JS, reflowing the Speedy block on load. The delivery
   type and locality are intentionally NOT listed here, so they paint immediately, together. */
#speedy_custom_checkout_field .speedy_shipping_to_office,
#speedy_custom_checkout_field .speedy_shipping_to_apt,
#speedy_custom_checkout_field .speedy_shipping_to_address,
#speedy_custom_checkout_field .speedy_shipping_to_address_type2,
#speedy_custom_checkout_field .speedy_services {
  display: none;
}

#speedy_user_checkout_field {
    cursor: pointer;
}

@media (max-width: 532px) {
  label[for=speedy_shipping_to_ADDRESS]:first-child {
      display: none !important;
  }
}

.select2-results__option.loading-results,
.select2-results__option.select2-results__option--load-more {
    background-image: url('/wp-admin/images/spinner.gif');
    background-repeat: no-repeat;
    padding-left: 35px;
    background-position: 10px 50%;
}

.speedy_wc_orders_list { 
  appearance: none; 
  background-color: inherit; 
  border: none; 
  border-radius: 6px; 
  box-shadow: none; 
  box-sizing: initial; 
  color: #dc0032; 
  cursor: pointer; 
  display: inline-block; 
  font-weight: inherit; 
  padding: 5px; 
  position: relative; 
  text-align: center; 
  text-decoration: none; 
  user-select: none; 
  -webkit-user-select: none; 
  touch-action: manipulation; 
  vertical-align: middle; 
  white-space: nowrap; 
  margin: 5px;
} 

.speedy_wc_orders_list:hover { 
  background-color: #dc0032;
  color: #fff;
  cursor: pointer; 
  margin: 5px; 
}

.speedy-colorbox-table {
    width: 100%;
    border-collapse: collapse;
}

.speedy-colorbox-table th, .speedy-colorbox-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.speedy-colorbox-table th {
    background-color: #f4f4f4;
    font-weight: bold;
}

#order_parcel_form .client_id { 
  width:100%!important; 
}

#order_parcel_form td #client_id {
    width:100% !important;
    text-wrap: wrap;
}

.speedy-logo {
  height: 38px !important;
}

.post-type-shop_order #speedy_pickup_apt_id_field label,
.post-type-shop_order #speedy_pickup_office_id_field label {
    display: block;
    width: 100%;
    margin-bottom: 5px;
}

.post-type-shop_order #speedy_pickup_apt_id_field .woocommerce-input-wrapper,
.post-type-shop_order #speedy_pickup_office_id_field .woocommerce-input-wrapper {
    display: block;
}

.post-type-shop_order #speedy_pickup_apt_id_field .select2-container,
.post-type-shop_order #speedy_pickup_office_id_field .select2-container {
    width: 100% !important;
}

#woocommerce-order-data .order_data_column .speedy-info-container {
    width: 100% !important;
    float: none !important;
}
/* ===== My Account: saved Speedy delivery-address card (brand red #d4002f) ===== */
.speedy_user_address.speedy-ma-card,
#speedy_edit_user_address.speedy-ma-card {
	position: relative;
	background: #fff;
	border: 1px solid #efe0e2;
	border-radius: 12px;
	padding: 18px 20px 16px;
	margin: 10px 0 26px;
	box-shadow: 0 1px 3px rgba(212, 0, 47, .06);
	max-width: 640px;
	line-height: 1.55;
}
.speedy_user_address.speedy-ma-card:hover { border-color: #e6c3c7; }
/* The edit form opens below the (still-visible) saved-address summary, so hide its
   repeated logo header. */
#speedy_edit_user_address.speedy-ma-form .speedy-ma-head { display: none; }
#speedy_edit_user_address.speedy-ma-form { margin-top: -14px; }

.speedy-ma-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 12px;
	padding: 0 30px 12px 0;
	border-bottom: 1px solid #f6eeef;
}
.speedy-ma-logo { height: 28px; width: auto; display: inline-block; }
.speedy-ma-title { font-weight: 700; font-size: 16px; color: #d4002f; }

.speedy-ma-card .speedy-ma-edit {
	position: absolute !important;
	top: 16px;
	right: 18px;
	left: auto !important;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #d4002f;
	background: #fdeef0;
	text-decoration: none;
	font-size: 16px;
	line-height: 1;
	transition: background .15s ease, color .15s ease;
}
/* SVG-mask pencil so it renders as one crisp glyph (the theme forces the Dashicons font
   onto ::before, which otherwise doubled up as an emoji fallback) and recolours white on hover. */
.speedy-ma-card .speedy-ma-edit:before {
	content: "";
	display: block;
	width: 16px;
	height: 16px;
	background-color: #d4002f;
	-webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M3%2017.25V21h3.75L17.81%209.94l-3.75-3.75L3%2017.25zM20.71%207.04a1%201%200%200%200%200-1.41l-2.34-2.34a1%201%200%200%200-1.41%200l-1.83%201.83%203.75%203.75%201.83-1.83z'/%3E%3C/svg%3E") no-repeat center / contain;
	mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M3%2017.25V21h3.75L17.81%209.94l-3.75-3.75L3%2017.25zM20.71%207.04a1%201%200%200%200%200-1.41l-2.34-2.34a1%201%200%200%200-1.41%200l-1.83%201.83%203.75%203.75%201.83-1.83z'/%3E%3C/svg%3E") no-repeat center / contain;
}
/* The theme adds its own Dashicons edit pencil via ::after on this link — hide it so only our single pencil shows. */
.speedy-ma-card .speedy-ma-edit:after { content: none !important; display: none !important; }
.speedy-ma-card .speedy-ma-edit:hover { background: #d4002f; color: #fff; text-decoration: none; }
.speedy-ma-card .speedy-ma-edit:hover:before { background-color: #fff; }

.speedy-ma-body { color: #333; font-size: inherit; }
.speedy-ma-row { margin: 4px 0; }
.speedy-ma-row strong { color: #d4002f; font-weight: 600; margin-right: 6px; }

/* ---- edit form inside the card ---- */
#speedy_edit_user_address.speedy-ma-form .form-row { margin: 0 0 14px; }
#speedy_edit_user_address.speedy-ma-form label {
	display: block;
	font-weight: 600;
	font-size: 13px;
	color: #3a3a3a;
	margin: 0 0 5px;
}
#speedy_edit_user_address.speedy-ma-form input.input-text,
#speedy_edit_user_address.speedy-ma-form select {
	width: 100%;
	box-sizing: border-box;
	height: 42px;
	padding: 8px 12px;
	border: 1px solid #d9d9d9;
	border-radius: 8px;
	background: #fff;
	font-size: 14px;
}
#speedy_edit_user_address.speedy-ma-form input.input-text:focus,
#speedy_edit_user_address.speedy-ma-form select:focus {
	border-color: #d4002f;
	outline: none;
	box-shadow: 0 0 0 3px rgba(212, 0, 47, .12);
}
#speedy_edit_user_address.speedy-ma-form .select2-container { width: 100% !important; }
#speedy_edit_user_address.speedy-ma-form .select2-container--default .select2-selection--single {
	height: 42px;
	border: 1px solid #d9d9d9;
	border-radius: 8px;
}
#speedy_edit_user_address.speedy-ma-form .select2-container--default .select2-selection--single .select2-selection__rendered {
	line-height: 40px;
	padding-left: 12px;
}
#speedy_edit_user_address.speedy-ma-form .select2-container--default .select2-selection--single .select2-selection__arrow {
	height: 40px;
}
#speedy_edit_user_address.speedy-ma-form .speedy_save_receiver_address.button,
#speedy_edit_user_address.speedy-ma-form a#speedy_save_user_address {
	display: inline-block;
	background: #d4002f !important;
	border: 1px solid #d4002f !important;
	color: #fff !important;
	border-radius: 8px;
	padding: 11px 26px;
	font-weight: 600;
	text-decoration: none;
	box-shadow: 0 2px 6px rgba(212, 0, 47, .25);
}
#speedy_edit_user_address.speedy-ma-form .speedy_save_receiver_address.button:hover,
#speedy_edit_user_address.speedy-ma-form a#speedy_save_user_address:hover {
	background: #a80025 !important;
	border-color: #a80025 !important;
}
