/**
 * Ilha Urbana — Calculadora de Frete Redesign
 * "Praia Urbana" — Brazilian coastal modern
 *
 * Integração visual com Woodmart Theme
 * Primary: #1C61E7 • Surface: #fff • Text: #767676
 * Fonts: Open Sans (body) / Lexend Deca (headings)
 */

/* ============================================================
 * 1. CONTAINER — Reset & Base
 * ============================================================ */
.woo-better-parent-container {
  font-family: "Open Sans", Arial, Helvetica, sans-serif !important;
  color: #767676 !important;
  margin-top: 24px !important;
}

/* ============================================================
 * 2. FORM — Input + Button group
 * ============================================================ */
#custom-postcode-form {
  margin-top: 0 !important;
  padding: 0 !important;
}

/* --- Input Group Wrapper --- */
.woo-better-container-current-style {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.woo-better-container-current-style:focus-within {
  border-color: #1C61E7;
  box-shadow: 0 2px 12px rgba(28, 97, 231, 0.12);
}

/* --- Input + Button Layout --- */
.woo-better-input-button-group-current-style {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
}

/* --- Input Wrapper (holds input + icon) --- */
.woo-better-input-wrapper-current-style {
  position: relative !important;
  flex: 1 !important;
  min-width: 0 !important;
}

/* --- CEP Input --- */
.woo-better-input-current-style {
  width: 100% !important;
  height: 44px !important;
  padding: 0 42px 0 16px !important;
  font-family: "Open Sans", Arial, Helvetica, sans-serif !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  color: #333 !important;
  background-color: #f8f9fa !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 8px !important;
  outline: none !important;
  box-shadow: none !important;
  transition: all 0.25s ease !important;
  letter-spacing: 0.02em !important;
}

.woo-better-input-current-style::placeholder {
  color: #aaa !important;
  font-size: 14px !important;
  letter-spacing: 0.01em !important;
}

.woo-better-input-current-style:hover {
  border-color: rgba(0, 0, 0, 0.15) !important;
  background-color: #fff !important;
}

.woo-better-input-current-style:focus {
  border-color: #1C61E7 !important;
  background-color: #fff !important;
  box-shadow: 0 0 0 3px rgba(28, 97, 231, 0.08) !important;
}

/* --- CEP Icon inside input --- */
.woo-better-icon-current-style {
  position: absolute !important;
  right: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 18px !important;
  height: 18px !important;
  opacity: 0.4 !important;
  pointer-events: none !important;
  transition: opacity 0.25s ease !important;
}

.woo-better-input-current-style:focus ~ .woo-better-icon-current-style,
.woo-better-input-wrapper-current-style:focus-within .woo-better-icon-current-style {
  opacity: 0.65 !important;
}

/* --- CONSULTAR Button --- */
.woo-better-button-current-style {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: 44px !important;
  min-width: 120px !important;
  padding: 0 24px !important;
  font-family: "Open Sans", Arial, Helvetica, sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  color: #ffffff !important;
  background-color: #1C61E7 !important;
  border: none !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(28, 97, 231, 0.25) !important;
  transition: all 0.25s ease !important;
  white-space: nowrap !important;
}

.woo-better-button-current-style:hover {
  background-color: #1554d4 !important;
  box-shadow: 0 4px 16px rgba(28, 97, 231, 0.35) !important;
  transform: translateY(-1px) !important;
}

.woo-better-button-current-style:active {
  transform: translateY(0) !important;
  box-shadow: 0 1px 4px rgba(28, 97, 231, 0.2) !important;
}

/* --- Button loading state --- */
.woo-better-button-current-style:disabled {
  background-color: #c5cdd8 !important;
  color: #8b95a1 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* --- "Não sei meu CEP" link --- */
.woo-better-link-current-style {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin-top: 10px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #767676 !important;
  text-decoration: none !important;
  letter-spacing: 0.01em !important;
  transition: color 0.2s ease !important;
}

.woo-better-link-current-style:hover {
  color: #1C61E7 !important;
  text-decoration: underline !important;
}

.woo-better-link-current-style::before {
  content: "📍";
  font-size: 12px;
}

/* ============================================================
 * 3. RESULTS CARD — Info Block (after CEP query)
 * ============================================================ */
.woo-better-info-block {
  margin: 20px 0 !important;
  padding: 0 !important;
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 12px !important;
  font-family: "Open Sans", Arial, Helvetica, sans-serif !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06) !important;
  overflow: hidden !important;
  animation: ilhaFadeIn 0.4s ease !important;
}

@keyframes ilhaFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- CEP Display Bar --- */
.woo-better-current-postcode-block {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 14px 20px !important;
  background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%) !important;
  border-bottom: 1px solid rgba(28, 97, 231, 0.08) !important;
  min-width: auto !important;
  gap: 12px !important;
}

/* --- Toggle + Postcode wrapper --- */
.woo-better-toggle-postcode-wrapper {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex: 1 !important;
  min-width: 0 !important;
}

/* --- Toggle button (expand/collapse) --- */
.woo-better-toggle-button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  background: rgba(28, 97, 231, 0.08) !important;
  border: none !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  transition: all 0.25s ease !important;
}

.woo-better-toggle-button:hover {
  background: rgba(28, 97, 231, 0.15) !important;
  transform: scale(1.05) !important;
}

/* --- Toggle icon --- */
.woo-better-toggle-icon {
  width: 16px !important;
  height: 16px !important;
  opacity: 0.6 !important;
  transition: transform 0.3s ease, opacity 0.25s ease !important;
}

.woo-better-toggle-button:hover .woo-better-toggle-icon {
  opacity: 0.9 !important;
}

/* --- CEP text --- */
.woo-better-current-postcode-text {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #333 !important;
  letter-spacing: 0.02em !important;
}

.woo-better-current-postcode-text strong {
  color: #1C61E7 !important;
  font-weight: 600 !important;
  margin-right: 4px !important;
}

/* --- "Alterar" button --- */
.woo-better-change-postcode-button {
  display: inline-flex !important;
  align-items: center !important;
  padding: 6px 16px !important;
  font-family: "Open Sans", Arial, Helvetica, sans-serif !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  color: #1C61E7 !important;
  background: transparent !important;
  border: 1.5px solid #1C61E7 !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.25s ease !important;
  flex-shrink: 0 !important;
}

.woo-better-change-postcode-button:hover {
  background: #1C61E7 !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(28, 97, 231, 0.2) !important;
}

/* ============================================================
 * 4. CONTENT BLOCK — Expandable shipping details
 * ============================================================ */
.woo-better-content-block {
  height: 0 !important;
  overflow: hidden !important;
  background: #fff !important;
  transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.woo-better-content-block.expanded {
  height: auto !important;
  padding: 20px !important;
  border: none !important;
}

/* --- Product Name --- */
.woo-better-product-name {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #242424 !important;
  font-family: "Lexend Deca", Arial, Helvetica, sans-serif !important;
  margin: 0 0 6px 0 !important;
  padding: 0 !important;
}

/* --- Product Quantity --- */
.woo-better-product-quantity {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 13px !important;
  color: #767676 !important;
  margin: 0 0 16px 0 !important;
  padding: 0 !important;
}

/* --- Icons --- */
.woo-better-icon {
  width: 18px !important;
  height: 18px !important;
  opacity: 0.5 !important;
  flex-shrink: 0 !important;
  margin-right: 0 !important;
}

/* ============================================================
 * 5. SHIPPING METHODS LIST
 * ============================================================ */
.woo-better-shipping-methods {
  margin-top: 4px !important;
}

.woo-better-shipping-methods > p {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #242424 !important;
  font-family: "Lexend Deca", Arial, Helvetica, sans-serif !important;
  margin: 0 0 10px 0 !important;
}

/* --- Shipping list --- */
.woo-better-shipping-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.woo-better-shipping-list li {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 10px 14px !important;
  background: #f8fafb !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  color: #333 !important;
  transition: all 0.2s ease !important;
}

.woo-better-shipping-list li:hover {
  background: #f0f4ff !important;
  border-color: rgba(28, 97, 231, 0.12) !important;
}

.woo-better-shipping-list li strong {
  color: #1C61E7 !important;
  font-weight: 600 !important;
  font-size: 15px !important;
}

/* ============================================================
 * 6. SEPARATOR
 * ============================================================ */
.woo-better-separator {
  border: none !important;
  border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
  margin: 16px 0 !important;
}

/* ============================================================
 * 7. UPDATE SECTION
 * ============================================================ */
.woo-better-update-section {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-top: 8px !important;
  padding: 10px 0 0 0 !important;
}

/* --- Update icon button --- */
.woo-better-update-icon-container {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  background: rgba(28, 97, 231, 0.06) !important;
  border: none !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  transition: all 0.3s ease !important;
}

.woo-better-update-icon-container:hover {
  background: rgba(28, 97, 231, 0.12) !important;
  transform: rotate(30deg) !important;
}

.woo-better-update-icon-container:focus {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(28, 97, 231, 0.15) !important;
}

.woo-better-update-icon {
  width: 20px !important;
  height: 20px !important;
  opacity: 0.55 !important;
  transition: all 0.3s ease !important;
}

.woo-better-update-icon-container:hover .woo-better-update-icon {
  opacity: 0.85 !important;
}

/* --- Spinning animation --- */
.woo-better-update-icon.spinning {
  animation: ilhaSpin 0.8s linear infinite !important;
  opacity: 1 !important;
}

@keyframes ilhaSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --- Update text container --- */
.woo-better-update-text-container {
  flex: 1 !important;
  line-height: 1.5 !important;
}

/* --- Update date --- */
.woo-better-update-date {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #999 !important;
  margin: 0 0 2px 0 !important;
  padding: 0 !important;
  letter-spacing: 0.01em !important;
}

.woo-better-update-date.flash {
  animation: ilhaFlash 2s ease-in-out !important;
}

@keyframes ilhaFlash {
  0%, 100% { color: #999; }
  20%, 80% { color: #1C61E7; }
}

/* --- Info text --- */
.woo-better-info-text {
  font-size: 12px !important;
  color: #aaa !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.4 !important;
}

/* ============================================================
 * 8. ERROR MESSAGE
 * ============================================================ */
.woo-better-error-message {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #e53935 !important;
  text-align: center !important;
  padding: 16px 20px !important;
  margin: 0 !important;
  background: #fff5f5 !important;
  border-radius: 8px !important;
  border: 1px solid rgba(229, 57, 53, 0.12) !important;
}

/* ============================================================
 * 10. RESPONSIVE
 * ============================================================ */
@media (max-width: 480px) {
  .woo-better-input-button-group-current-style {
    flex-direction: column !important;
  }

  .woo-better-button-current-style {
    width: 100% !important;
  }

  .woo-better-current-postcode-block {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .woo-better-change-postcode-button {
    align-self: flex-end !important;
  }
}

/* ============================================================
 * 11. SUBTLE PRINT / ACCESSIBILITY
 * ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .woo-better-info-block,
  .woo-better-button-current-style,
  .woo-better-update-icon-container,
  .woo-better-content-block {
    animation: none !important;
    transition: none !important;
  }
}
