/* =============================================================
   Morocco Tours Category Widget – tours-widget.css
   Compatible with GoWilds Theme + Elementor
   ============================================================= */

/* Google Fonts – loaded via @import for widget self-containment */
@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@400;500;600&display=swap");

/* ── Reset & Base ─────────────────────────────────────────── */
.mtw-wrapper *,
.mtw-wrapper *::before,
.mtw-wrapper *::after {
  box-sizing: border-box;
}

/* ── Header ───────────────────────────────────────────────── */
.mtw-header {
  text-align: center;
  margin-bottom: 48px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Filter Bar ───────────────────────────────────────────── */
.mtw-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.mtw-filter-label {
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #444;
  white-space: nowrap;
}

.mtw-filter-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 10px 40px 10px 16px;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  background-color: #fff;
  border: 2px solid #2d5016;
  border-radius: 8px;
  cursor: pointer;
  min-width: 200px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%232D5016' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.mtw-filter-select:focus {
  outline: none;
  border-color: #5b8c4a;
  box-shadow: 0 0 0 3px rgba(91, 140, 74, 0.18);
}

/* ── Grid ─────────────────────────────────────────────────── */
.mtw-grid {
  display: grid;
  gap: 32px;
  width: 100%;
}

.mtw-grid-cols-1 {
  grid-template-columns: 1fr;
}
.mtw-grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.mtw-grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.mtw-grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ── Card ─────────────────────────────────────────────────── */
.mtw-card {
	justify-self: end;
  width: 100%;
  max-width: 550px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  padding: 0;
}

/* hidden state for filter */
.mtw-card.mtw-hidden {
  display: none !important;
}

/* ── Card Image ───────────────────────────────────────────── */
.mtw-card-image {
  width: 180px;
  min-width: 180px;
  border-radius: 12px;
  overflow: hidden;
  margin-right: 20px;
  flex-shrink: 0;
}

.mtw-card-image img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  transition: transform 0.4s ease;
}

.mtw-card:hover .mtw-card-image img {
  transform: scale(1.04);
}

/* ── Card Content ─────────────────────────────────────────── */
.mtw-card-content {
  flex: 1;
  padding: 0px 20px 20px 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.mtw-card-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 10px;
  padding: 0;
  line-height: 1.3;
}

.mtw-card-desc {
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  color: #666;
  margin: 0 0 18px;
  padding: 0;
  flex: 1;
}

/* ── Action Buttons ───────────────────────────────────────── */
.mtw-card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.mtw-btn {
  display: inline-block;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  padding: 10px 20px;
  transition:
    background-color 0.25s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
  white-space: nowrap;
  min-width: 160px;
  text-align: center;
}

.mtw-btn:hover {
	background: #C39E2C;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  text-decoration: none !important;
}

.mtw-btn-phone {
  background-color: #8b6914;
  color: #ffffff !important;
}

.mtw-btn-phone:hover {
  background-color: #7a5c10;
  color: #ffffff !important;
}

.mtw-btn-learn {
  background-color: #2d5016;
  color: #ffffff !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.mtw-btn-learn:hover {
  background-color: #3d6b1e;
  color: #ffffff !important;
}

/* ── Tablet (≤ 1024px) ────────────────────────────────────── */
@media (max-width: 1024px) {
  .mtw-grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .mtw-grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Mobile Landscape (≤ 767px) ───────────────────────────── */
@media (max-width: 767px) {
  .mtw-grid-cols-2,
  .mtw-grid-cols-3,
  .mtw-grid-cols-4 {
    grid-template-columns: 1fr;
  }

  .mtw-grid {
    gap: 20px;
  }

  .mtw-card {
    flex-direction: column;
  }

  .mtw-card-image {
    width: 100%;
    min-width: 100%;
    margin-right: 0;
    margin-bottom: 0;
    border-radius: 12px 12px 0 0;
  }

  .mtw-card-image img {
    width: 100%;
    height: 220px;
    border-radius: 12px 12px 0 0;
  }

  .mtw-card-content {
    padding: 16px 16px 20px;
  }

  .mtw-card-title {
    font-size: 18px;
  }

  .mtw-btn {
    width: 100%;
    min-width: unset;
  }

  .mtw-filter-select,
  .mtw-search-input {
    width: 100%;
    min-width: unset;
  }

  .mtw-search-wrap {
    max-width: 100%;
  }

  .mtw-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ── Mobile Portrait (≤ 480px) ────────────────────────────── */
@media (max-width: 480px) {
  .mtw-header {
    margin-bottom: 32px;
  }

  .mtw-main-title {
    font-size: 26px;
  }

  .mtw-header-desc {
    font-size: 14px;
  }

  .mtw-card-image img {
    height: 180px;
  }
}

/* ── Search Input ─────────────────────────────────────────── */
.mtw-search-wrap {
  flex: 1;
  max-width: 280px;
}

.mtw-search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232D5016' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  border: 2px solid #2d5016;
  border-radius: 8px;
  outline: none;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.mtw-search-input:focus {
  border-color: #5b8c4a;
  box-shadow: 0 0 0 3px rgba(91, 140, 74, 0.18);
}

/* ── Card title link ──────────────────────────────────────── */
.mtw-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.mtw-card-title a:hover {
  color: #2d5016;
  text-decoration: none;
}

.mtw-count {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.6;
  margin-left: 4px;
}

/* ── GoWilds theme integration overrides ─────────────────── */
.gowilds-theme .mtw-wrapper,
.tour-archive .mtw-wrapper {
  --mtw-primary: #2d5016;
  --mtw-secondary: #8b6914;
  --mtw-accent: #5b8c4a;
}

/* Prevent theme overriding button styles */
.mtw-wrapper .mtw-btn,
.mtw-wrapper .mtw-btn:visited,
.mtw-wrapper .mtw-btn:focus {
  color: #ffffff !important;
  text-decoration: none !important;
  box-shadow: none;
  outline: none;
}

.mtw-wrapper .mtw-btn:hover {
  color: #ffffff !important;
  text-decoration: none !important;
}

/* Elementor editor visibility */
.elementor-editor-active .mtw-card.mtw-hidden {
  display: flex !important;
  opacity: 0.5;
}
