/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins";
  line-height: 1.6;
  color: #252321;
  background-color: #efefee;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header Styles */
.header {
  background: linear-gradient(
    to right,
    #780603,
    #ab0905,
    #ffffff
  ); /* Gradient from Figma */
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 5rem; /* Increased height to match Figma */
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: white;
  letter-spacing: 0.05em;
}

.logo-img {
  height: 2.5rem; /* Adjust height as needed to match Figma */
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Dropdown Styles */
.dropdown {
  position: relative;
}

.dropdown-btn {
  background-color: #efefee; /* Light gray background */
  border: none;
  color: #252321; /* Dark text color */
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem; /* More rounded corners */
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
  font-weight: 500;
}

.dropdown-btn:hover {
  background-color: #dbdad9; /* Slightly darker on hover */
}

.dropdown-icon {
  color: #252321; /* Ensure icon color matches text */
}

.dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 0.25rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  min-width: 150px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
}

.dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-content a {
  display: block;
  padding: 0.75rem 1rem;
  color: #252321;
  text-decoration: none;
  transition: background-color 0.2s;
}

.dropdown-content a:hover {
  background-color: #f5f5f5;
}

/* Button Styles */
.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-primary {
  background-color: #de0b06;
  color: white;
  /* border: 1px solid white; White border as per Figma */
  border-radius: 0.5rem; /* More rounded corners */
}

.btn-primary:hover {
  background-color: #9b0804;
}

.btn-secondary {
  background-color: #6d6b67;
  color: white;
  border-radius: 0.5rem; /* More rounded corners */
}

.btn-secondary:hover {
  background-color: #494641;
}

.btn-outline {
  background-color: white;
  color: #de0b06;
  border: 1px solid #de0b06;
}

.btn-outline:hover {
  background-color: #de0b06;
  color: white;
}

/* Main Content */
.main {
  padding: 2rem 0;
}

/* Shipping Section */
.shipping-section {
  background: #dbdad9;
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  color: #252321;
}

.shipping-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 2rem;
}

.tracking-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6d6b67;
  margin-bottom: 0.5rem;
}

.input-wrapper {
  position: relative;
}

.city-select {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 0.75rem;
  background-color: #ededec;
  border: none;
  border-radius: 0.25rem;
  color: #252321;
  cursor: pointer;
  appearance: none; /* Hide default arrow */
  -webkit-appearance: none;
  -moz-appearance: none;
}

.city-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px #de0b06;
}

.input-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6d6b67;
  pointer-events: none; /* Allow clicks to pass through to select */
}

.tracking-input {
  width: 100%;
  padding: 0.75rem 0.75rem; /* Adjusted padding */
  background-color: #ededec;
  border: 1px solid #dbdad9; /* Added border as per image */
  border-radius: 0.5rem; /* More rounded corners for consistency */
  color: #252321;
  font-size: 1rem; /* Match font size */
}

.tracking-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px #de0b06;
}

/* Custom Select Styles */
.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select-display {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 0.75rem;
  background-color: #ededec;
  border: 1px solid #dbdad9; /* Added border */
  border-radius: 0.5rem;
  color: #252321;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  position: relative;
  z-index: 2; /* Ensure it's above options when closed */
}

.custom-select-display .selected-text {
  flex-grow: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.custom-select-display .selected-logo {
  height: 20px; /* Adjust size for logo in display */
  width: auto;
  margin-right: 0.5rem;
}

.custom-select-display .input-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%) rotate(0deg); /* Initial state */
  transition: transform 0.2s ease;
  pointer-events: none;
}

.custom-select-wrapper.open .custom-select-display .input-icon {
  transform: translateY(-50%) rotate(90deg); /* Rotate when open */
}

.custom-select-options {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: #6d6b67; /* Dark gray background for options */
  border-radius: 0.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  z-index: 1; /* Below display when closed */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.custom-select-wrapper.open .custom-select-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-option {
  padding: 0.75rem 1rem;
  color: white; /* White text for options */
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background-color 0.2s;
}

.custom-option:hover {
  background-color: #494641; /* Darker gray on hover */
}

.custom-option .option-logo {
  height: 25px; /* Size for logos in options */
  width: auto;
  object-fit: contain;
}

/* Expedition Section */
.expedition-section {
  margin-top: 2rem;
}

.expedition-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: #252321;
}

.expedition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.expedition-item {
  background: white;
  padding: 0.5rem;
  border-radius: 32px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #dbdad9;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
}

.expedition-item img {
  max-width: 100%;
  max-height: 40px;
  object-fit: contain;
}

/* Content Section */
.content-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-top: 2rem;
}

.illustration-container {
  display: flex;
  justify-content: center;
}

.illustration {
  max-width: 100%;
  height: auto;
}

/* FAQ Styles */
.faq-title {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  color: #252321;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background-color: #f5f5f5;
  border-radius: 0.5rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #252321;
  font-size: 1rem;
  transition: background-color 0.2s;
}

.faq-question:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.faq-bullet {
  width: 8px;
  height: 8px;
  background-color: #de0b06;
  border-radius: 50%;
  flex-shrink: 0;
}

.faq-text {
  flex: 1;
}

.faq-icon {
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item.active .faq-icon {
  transform: rotate(90deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.faq-item.active .faq-answer {
  max-height: 200px;
}

.faq-answer p {
  padding: 0 1rem 1rem;
  color: #6d6b67;
}

/* Footer */
.footer {
  background-color: #9b0804;
  color: white;
  margin-top: 2rem;
  padding: 1rem 0;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: auto;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: white;
  letter-spacing: 0.05em;
}

.footer-text {
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    height: auto;
    padding: 1rem 0;
    gap: 1rem;
  }

  .nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .shipping-form {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .tracking-form {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .expedition-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-section {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .faq-title {
    font-size: 2rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.5rem;
  }

  .shipping-section {
    padding: 1rem;
  }

  .expedition-grid {
    grid-template-columns: 1fr;
  }

  .faq-title {
    font-size: 1.75rem;
  }
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: 0.5rem;
  max-width: 90vw;
  width: 1335px; /* Adjusted width as per request */
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #ededec;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: bold;
  color: #252321;
  margin: 0;
}

.modal-title .route {
  font-weight: 900;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: #6d6b67;
  border-radius: 0.25rem;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background-color: #f5f5f5;
}

.modal-body {
  padding: 2rem;
  max-height: 70vh;
  overflow-y: auto;
}

.shipping-results {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.shipping-option {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid #ededec;
  border-radius: 0.5rem;
  background: #fafafa;
}

.courier-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
}

.courier-logo {
  width: 80px;
  height: 40px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.courier-name {
  font-size: 0.75rem;
  font-weight: bold;
  color: #252321;
  text-align: center;
}

.pricing-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-row.total {
  border-top: 1px solid #ededec;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
  font-weight: bold;
}

.price-label {
  font-size: 0.875rem;
  color: #6d6b67;
}

.price-value {
  font-size: 0.875rem;
  color: #252321;
  font-weight: 500;
}

.price-row.total .price-label,
.price-row.total .price-value {
  font-weight: bold;
  color: #252321;
}

/* Tracking Modal Styles */
.tracking-modal-content {
  max-width: 1335px;
  width: 90vw;
}

.package-info {
  margin-bottom: 2rem;
}

.info-row {
  display: flex;
  margin-bottom: 0.75rem;
  align-items: flex-start;
}

.info-label {
  min-width: 140px;
  font-weight: 500;
  color: #252321;
  flex-shrink: 0;
}

.info-separator {
  margin: 0 0.5rem;
  color: #252321;
}

.info-value {
  color: #252321;
  flex: 1;
}

/* Progress Section */
.progress-tracking-section {
  background: white; /* White background as per new image */
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.progress-tracker {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 1rem 0;
}

.progress-segment {
  flex-grow: 1; /* Allow segments to grow */
  height: 4px;
  background-color: black; /* Default to black for inactive */
  margin: 0 0.5rem; /* Small margin between segments and steps */
}

.progress-segment.active {
  background-color: #de0b06; /* Red for active segments */
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  text-align: center;
}

.step-icon {
  width: 68px; /* Match SVG width */
  height: 68px; /* Match SVG height */
  background-color: transparent;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  border: none;
}

.step-icon img {
  width: 68px; /* Match SVG width */
  height: 68px; /* Match SVG height */
  filter: brightness(0%); /* Default to black for inactive */
}

.progress-step.active .step-icon img {
  filter: none; /* Show original red color when active */
}

.step-label {
  font-size: 1rem;
  color: black; /* Default to black for inactive */
  font-weight: 500;
}

.progress-step.active .step-label {
  color: #de0b06; /* Red for active */
  font-weight: bold;
}

/* Tracking Details */
.tracking-details {
  margin-top: 2rem;
}

.tracking-details-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #252321;
  margin-bottom: 1.5rem;
}

.tracking-icon {
  color: #6d6b67;
}

.tracking-timeline {
  position: relative;
  padding-left: 1rem;
}

.tracking-timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #e5e5e5;
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0.25rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #de0b06;
}

.timeline-date {
  font-weight: 600;
  color: #252321;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.timeline-description {
  color: #6d6b67;
  font-size: 0.875rem;
  line-height: 1.4;
}

/* Responsive Tracking Modal */
@media (max-width: 768px) {
  .progress-tracking-section {
    display: none;
  }

  .tracking-modal-content {
    width: 95vw;
    max-height: 90vh;
  }

  .info-row {
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
  }

  .info-label {
    min-width: auto;
    font-weight: 600;
  }

  .info-separator {
    display: none;
  }

  .progress-container {
    flex-direction: column;
    gap: 1rem;
  }

  .progress-step {
    flex-direction: row;
    width: 100%;
    text-align: left;
  }

  .progress-icon {
    margin-bottom: 0;
    margin-right: 1rem;
    flex-shrink: 0;
  }

  .progress-line {
    display: none;
  }

  .progress-label {
    margin-top: 0;
    text-align: left;
  }
}

@media (max-width: 480px) {
  .progress-icon {
    width: 40px;
    height: 40px;
  }

  .timeline-item {
    padding-left: 1rem;
  }

  .tracking-timeline {
    padding-left: 0.75rem;
  }
}

/* Responsive Modal */
@media (max-width: 1360px) {
  /* Adjust breakpoint for new modal width */
  .modal-content {
    width: 95vw; /* Allow it to shrink on smaller screens */
  }
}

@media (max-width: 768px) {
  .modal-content {
    max-height: 95vh;
  }

  .modal-header {
    padding: 1rem;
  }

  .modal-title {
    font-size: 1rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .shipping-results {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .shipping-option {
    padding: 1rem;
  }

  .courier-info {
    min-width: 100px;
  }

  .courier-logo {
    width: 60px;
    height: 30px;
  }

  .courier-name {
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .modal-header {
    padding: 0.75rem;
  }

  .modal-title {
    font-size: 0.9rem;
  }

  .modal-body {
    padding: 0.75rem;
  }

  .shipping-option {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0.75rem;
  }

  .courier-info {
    margin-bottom: 1rem;
  }

  .pricing-info {
    width: 100%;
  }
}
