/* ========================================
   VLASTNÍ PŘEPRAVA - DELIVERY MODAL CSS
   ======================================== */

/* Colorbox Modal - Dodatečné Styly */
#dp-delivery-modal .content-modal {
  padding: 20px;
}

#dp-delivery-modal h1 {
  margin-bottom: 15px;
}

#dp-delivery-modal .form-group {
  margin-bottom: 20px;
}

#dp-delivery-modal .form-control {
  height: 45px;
}

#dp-delivery-modal .submit-wrapper {
  text-align: center;
  margin-top: 30px;
}

/* ========================================
   SKRYTÍ PRODUKTU PŘEPRAVNÉ (ID 57)
   ======================================== */

.in-krok-1 .msg.msg-success {
  display: none;
}

/* V košíku */
.cart-table tr.removeable[data-micro-sku='57'] .p-quantity,
.cart-table tr.removeable[data-micro-sku='57'] .p-price,
.cart-table tr.removeable[data-micro-sku='57'] form,
.cart-table tr.removeable[data-micro-sku='57'] .p-availability {
  visibility: hidden !important;
}

/* V rekapitulaci objednávky */
.order-summary-inner .cart-items .cart-item[data-micro-sku='57'],
.order-summary-item[data-micro-sku="57"],
.cart-item[data-micro-sku="57"],
.order-summary-item:has(a[href*="dopravne"]) {
  display: none !important;
}

/* Widget košíku */
.cart-widget-product[data-micro-sku='57'] .cart-widget-product-amount,
.cart-widget-product[data-micro-sku='57'] .cart-widget-product-unit,
.cart-widget-product[data-micro-sku='57'] .cart-widget-product-delete {
  visibility: hidden;
}

/* Helper items */
.order-summary-item.helper {
  display: none;
}

/* ========================================
   FLOATUJÍCÍ BUTTON
   ======================================== */

@keyframes dp-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.dp-floating-delivery-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  max-width: 320px;
}

.dp-floating-content-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  max-width: 280px;
  animation: dp-bounce 2s ease-in-out infinite;
  position: relative;
}

.dp-floating-delivery-btn.dp-floating-collapsed .dp-floating-content-wrapper {
  display: none;
}

.dp-floating-arrow {
  width: 45px;
  height: auto;
  flex-shrink: 0;
}

.dp-floating-close {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.dp-floating-close:hover {
  background: rgba(0, 0, 0, 0.78);
}

.dp-floating-text {
  color: #1f1f1f;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  text-align: left;
  text-shadow: none;
}

.dp-floating-text strong {
  font-weight: 700;
}

.dp-floating-btn {
  background: #a4c639;
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(164, 198, 57, 0.4);
  text-transform: uppercase;
}

.dp-floating-btn:hover {
  background: #93b332;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(164, 198, 57, 0.5);
}

.dp-floating-icon-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px 0 0 10px;
  border: none;
  background: #a4c639;
  color: #fff;
  box-shadow: 0 6px 16px rgba(164, 198, 57, 0.45);
  cursor: pointer;
  padding: 0;
}

.dp-floating-icon-btn .icon-van {
  font-size: 20px;
  line-height: 1;
}

.dp-floating-icon-btn:hover {
  background: #93b332;
}

@media screen and (max-width: 768px) {
  .dp-floating-delivery-btn {
    bottom: 14px;
    left: 0;
    right: auto;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .dp-floating-content-wrapper {
    gap: 8px;
    margin-bottom: 6px;
    margin-left: 6px;
    padding: 6px 8px;
    max-width: 240px;
  }
  
  .dp-floating-text {
    font-size: 13px;
  }
  
  .dp-floating-arrow {
    width: 40px;
  }
  
  .dp-floating-btn {
    display: none;
  }

  .dp-floating-icon-btn {
    display: inline-flex;
    border-radius: 0 10px 10px 0;
  }
}

@media screen and (max-width: 480px) {
  .dp-floating-text {
    font-size: 12px;
    line-height: 1.35;
  }

  .dp-floating-arrow {
    width: 32px;
  }
}

/* ========================================
   DELIVERY MODAL - KOMPAKTNÍ STYL
   ======================================== */

.dp-delivery-modal {
  padding: 20px;
}

.dp-delivery-modal h2 {
  margin: 0 0 5px;
  font-size: 20px;
}

.dp-delivery-modal .text-muted {
  margin-bottom: 12px;
  font-size: 13px;
}

/* Formulář */
.dp-address-form {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 15px;
}

.dp-form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.dp-form-field {
  flex: 1;
}

.dp-form-field label {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
  font-weight: 500;
  color: #333;
}

.dp-form-field .form-control {
  height: 36px;
  font-size: 13px;
  width: 100%;
}

.dp-field-street {
  flex: 2;
}

.dp-field-city {
  flex: 1.5;
}

.dp-field-zip {
  flex: 0.8;
  min-width: 80px;
}

/* ========================================
   AUTOCOMPLETE
   ======================================== */

.dp-autocomplete-wrapper {
  position: relative;
}

.dp-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  max-height: 250px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dp-autocomplete-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: background-color 0.15s ease;
}

.dp-autocomplete-item:last-child {
  border-bottom: none;
}

.dp-autocomplete-item:hover,
.dp-autocomplete-item.active {
  background-color: #e7f3ff;
}

.dp-suggest-main {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.dp-suggest-secondary {
  display: block;
  font-size: 12px;
  color: #777;
  margin-top: 2px;
}

.dp-address-form .red {
  color: #dc3545;
}

.dp-form-submit {
  margin-top: 10px;
}

.dp-form-submit .btn {
  width: 100%;
  padding: 10px 20px;
}

/* ========================================
   SKLADY - MAPA A LEGENDA
   ======================================== */

.dp-warehouses-section {
  margin-top: 25px;
  margin-bottom: 12px;
}

.dp-warehouses-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.dp-warehouses-header h4 {
  margin: 0;
  font-size: 15px;
  color: #333;
}

.dp-warehouses-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dp-warehouse-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #555;
}

.dp-warehouse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

#dp-warehouses-map {
  width: 100%;
  height: 280px;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  overflow: hidden;
}

.dp-pricing-info {
  text-align: center;
  padding: 8px 12px;
  background: #fff3cd;
  border-radius: 4px;
  border: 1px solid #ffc107;
}

.dp-pricing-info small {
  font-size: 12px;
  color: #856404;
}

/* ========================================
   VÝSLEDEK VÝPOČTU (INLINE)
   ======================================== */

.dp-result-inline {
  margin-top: 15px;
  margin-bottom: 15px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 12px 15px;
}

.dp-result-table {
  width: 100%;
  border-collapse: collapse;
}

.dp-result-table td {
  padding: 6px 0;
  font-size: 14px;
  color: #333;
}

.dp-result-table td:first-child {
  color: #666;
}

.dp-result-table td:last-child {
  text-align: right;
}

.dp-result-table .dp-result-price-row {
  border-top: 1px solid #dee2e6;
}

.dp-result-table .dp-result-price-row td {
  padding-top: 10px;
  font-size: 16px;
}

.dp-result-error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  padding: 12px 15px;
  color: #721c24;
  font-size: 13px;
  text-align: center;
}

/* Tlačítko potvrdit - zelené jako hlavní CTA */
.dp-confirm-btn {
  background-color: #8bc34a !important;
  border-color: #8bc34a !important;
  color: #fff !important;
  font-weight: 600;
  padding: 12px 30px !important;
  font-size: 15px !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dp-confirm-btn:hover {
  background-color: #7cb342 !important;
  border-color: #7cb342 !important;
}

/* Loading spinner */
.dp-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: dpSpin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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

/* ========================================
   RESULT MODAL (MAPA S TRASOU)
   ======================================== */

.dp-result-modal {
  padding: 20px;
}

.dp-fallback-warning {
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 10px 15px;
  margin-bottom: 15px;
  color: #856404;
  text-align: center;
}

.dp-fallback-warning small {
  font-size: 14px;
}

.dp-result-info {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.dp-result-row {
  padding: 10px 0;
  border-bottom: 1px solid #e9ecef;
  font-size: 16px;
}

.dp-result-row:last-of-type {
  border-bottom: none;
}

.dp-price-row {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 2px solid #007bff;
  font-size: 18px;
}

.dp-price {
  color: #007bff;
  font-size: 24px;
  font-weight: bold;
  display: inline-block;
  margin-left: 10px;
}

#dp-route-map {
  border: 2px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Leaflet map overrides */
.leaflet-container {
  font-family: inherit;
}

.dp-modal-with-map .content-modal {
  max-width: 100%;
}

.dp-modal-with-warehouses #cboxLoadedContent {
  padding: 0 !important;
}

.dp-modal-with-warehouses .content-modal {
  border-radius: 4px;
}

/* ========================================
   DELIVERY INFO V SHIPPING SELECTU
   Využívá Shoptet native styl:
   .radio-wrapper input[type=radio]+label .sublabel
   ======================================== */

/* Základní layout - flexbox pro inline zobrazení */
.delivery-address-info.sublabel .dp-delivery-details {
  display: block;
  margin-bottom: 5px;
}

.delivery-address-info.sublabel .dp-detail-item {
  display: inline;
}

.delivery-address-info.sublabel .dp-detail-item strong {
  font-weight: 700;
}

.delivery-address-info.sublabel .dp-detail-separator {
  display: inline;
  margin: 0 8px;
  opacity: 0.5;
}

.delivery-address-info.sublabel .dp-change-link {
  display: inline-block;
  font-size: 12px;
  text-decoration: underline;
}

/* Skryjeme info když doprava není aktivní */
#shipping-29:not(.active) .delivery-address-info {
  display: none;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media screen and (max-width: 768px) {
  .dp-result-modal {
    padding: 15px;
  }
  
  .dp-result-info {
    padding: 15px;
  }
  
  .dp-result-row {
    font-size: 14px;
  }
  
  .dp-price {
    font-size: 20px;
  }
  
  #dp-route-map {
    height: 300px !important;
  }
}

@media screen and (max-width: 700px) {
  .dp-form-row {
    flex-wrap: wrap;
  }
  
  .dp-field-street {
    flex: 1 1 100%;
  }
  
  .dp-field-city {
    flex: 1 1 60%;
  }
  
  .dp-field-zip {
    flex: 1 1 35%;
  }
  
  .dp-warehouses-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .dp-warehouses-legend {
    gap: 8px;
  }
}

@media screen and (max-width: 480px) {
  .dp-delivery-modal {
    padding: 12px;
  }
  
  .dp-delivery-modal h2 {
    font-size: 17px;
  }
  
  .dp-address-form {
    padding: 10px;
  }
  
  .dp-form-row {
    gap: 8px;
  }
  
  .dp-field-city,
  .dp-field-zip {
    flex: 1 1 45%;
  }
  
  #dp-warehouses-map {
    height: 220px;
  }
  
  .dp-warehouse-legend-item {
    font-size: 11px;
  }
  
  .dp-warehouse-dot {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 767px) {
  .delivery-address-info.sublabel .dp-detail-separator {
    display: none;
  }
  
  .delivery-address-info.sublabel .dp-detail-item {
    display: block;
    margin-bottom: 3px;
  }
  
  .delivery-address-info.sublabel .dp-detail-item:last-child {
    margin-bottom: 0;
  }
}
