/* =============================================
   Travelly - Public Styles
   ============================================= */

:root {
  --travelly-primary:    #2271b1;
  --travelly-secondary:  #135e96;
  --travelly-accent:     #f0a500;
  --travelly-success:    #5cb85c;
  --travelly-danger:     #d9534f;
  --travelly-warning:    #f0ad4e;
  --travelly-text:       #2c3e50;
  --travelly-text-light: #6c757d;
  --travelly-border:     #e2e8f0;
  --travelly-bg:         #f8fafc;
  --travelly-white:      #ffffff;
  --travelly-radius:     12px;
  --travelly-radius-sm:  8px;
  --travelly-shadow:     0 4px 20px rgba(0,0,0,0.08);
  --travelly-shadow-md:  0 8px 30px rgba(0,0,0,0.12);
  --travelly-transition: all 0.3s ease;
}

/* ---- Base Reset ---- */
.travelly-single-tour *, .travelly-tours-grid *,
.travelly-search-form-wrap *, .travelly-my-bookings * {
  box-sizing: border-box;
}

/* =============================================
   TOURS GRID
   ============================================= */
.travelly-tours-grid {
  display: grid;
  gap: 28px;
  margin: 24px 0;
}
.travelly-cols-2 { grid-template-columns: repeat(2, 1fr); }
.travelly-cols-3 { grid-template-columns: repeat(3, 1fr); }
.travelly-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .travelly-cols-3, .travelly-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .travelly-cols-2, .travelly-cols-3, .travelly-cols-4 { grid-template-columns: 1fr; }
}

.travelly-no-tours {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--travelly-text-light);
  font-size: 1.1rem;
}

/* =============================================
   TOUR CARD
   ============================================= */
.travelly-tour-card {
  background: var(--travelly-white);
  border-radius: var(--travelly-radius);
  box-shadow: var(--travelly-shadow);
  overflow: hidden;
  transition: var(--travelly-transition);
  display: flex;
  flex-direction: column;
}
.travelly-tour-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--travelly-shadow-md);
}

.travelly-tour-card__image-wrap {
  position: relative;
  overflow: hidden;
  height: 220px;
}
.travelly-tour-card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.travelly-tour-card:hover .travelly-tour-card__image-wrap img {
  transform: scale(1.07);
}
.travelly-tour-card__no-image {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8f4f8, #c8e6f5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
}

/* Badges */
.travelly-badge {
  position: absolute;
  top: 14px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.travelly-badge--sale {
  background: #e74c3c;
  color: #fff;
  right: 14px;
}
.travelly-badge--category {
  background: rgba(0,0,0,0.55);
  color: #fff;
  left: 14px;
}

.travelly-tour-card__body {
  padding: 20px;
  flex: 1;
}
.travelly-tour-card__location {
  font-size: 0.82rem;
  color: var(--travelly-text-light);
  margin-bottom: 8px;
}
.travelly-tour-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.4;
}
.travelly-tour-card__title a {
  color: var(--travelly-text);
  text-decoration: none;
  transition: color 0.2s;
}
.travelly-tour-card__title a:hover {
  color: var(--travelly-primary);
}
.travelly-tour-card__excerpt {
  color: var(--travelly-text-light);
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 0 0 14px;
}
.travelly-tour-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--travelly-text-light);
}
.travelly-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.travelly-rating { color: #f0a500; }

.travelly-tour-card__footer {
  padding: 16px 20px;
  border-top: 1px solid var(--travelly-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.travelly-tour-card__price {
  font-size: 0.82rem;
  color: var(--travelly-text-light);
  line-height: 1.3;
}
.travelly-price--old {
  text-decoration: line-through;
  color: var(--travelly-text-light);
  font-size: 0.85rem;
  display: block;
}
.travelly-price--current {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--travelly-primary);
}
.travelly-price--per {
  font-size: 0.75rem;
  color: var(--travelly-text-light);
}

/* =============================================
   BUTTONS
   ============================================= */
.travelly-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--travelly-radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--travelly-transition);
  border: 2px solid transparent;
  white-space: nowrap;
}
.travelly-btn--primary {
  background: var(--travelly-primary);
  color: var(--travelly-white) !important;
}
.travelly-btn--primary:hover {
  background: var(--travelly-secondary);
  transform: translateY(-1px);
}
.travelly-btn--outline {
  background: transparent;
  color: var(--travelly-primary);
  border-color: var(--travelly-primary);
}
.travelly-btn--outline:hover {
  background: var(--travelly-primary);
  color: var(--travelly-white) !important;
}
.travelly-btn--ghost {
  background: var(--travelly-bg);
  color: var(--travelly-text);
  border-color: var(--travelly-border);
}
.travelly-btn--ghost:hover {
  background: var(--travelly-border);
}
.travelly-btn--full { width: 100%; }
.travelly-btn--lg { padding: 14px 28px; font-size: 1rem; }

/* =============================================
   SEARCH FORM
   ============================================= */
.travelly-search-form-wrap {
  background: var(--travelly-white);
  border-radius: var(--travelly-radius);
  box-shadow: var(--travelly-shadow);
  padding: 28px;
  margin-bottom: 30px;
}
.travelly-search-fields {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 16px;
  align-items: end;
}
@media (max-width: 768px) {
  .travelly-search-fields { grid-template-columns: 1fr; }
}
.travelly-search-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--travelly-text);
  margin-bottom: 6px;
}
.travelly-search-field input,
.travelly-search-field select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--travelly-border);
  border-radius: var(--travelly-radius-sm);
  font-size: 0.9rem;
  color: var(--travelly-text);
  background: var(--travelly-white);
  transition: border-color 0.2s;
  outline: none;
}
.travelly-search-field input:focus,
.travelly-search-field select:focus {
  border-color: var(--travelly-primary);
}

/* =============================================
   SINGLE TOUR
   ============================================= */
.travelly-single-tour { margin: 0 0 50px; }

.travelly-tour-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  border-radius: var(--travelly-radius);
  overflow: hidden;
}
.travelly-main-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--travelly-radius);
}
.travelly-gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.travelly-thumb {
  width: 90px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  flex-shrink: 0;
  border: 3px solid transparent;
}
.travelly-thumb:hover, .travelly-thumb.active {
  opacity: 1;
  border-color: var(--travelly-primary);
}

.travelly-tour-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 36px;
  margin-top: 32px;
  align-items: start;
}
@media (max-width: 1024px) {
  .travelly-tour-layout { grid-template-columns: 1fr; }
  .travelly-tour-sidebar { order: -1; }
}

.travelly-breadcrumb {
  font-size: 0.85rem;
  color: var(--travelly-text-light);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.travelly-breadcrumb a {
  color: var(--travelly-primary);
  text-decoration: none;
}

.travelly-tour-header { margin-bottom: 24px; }
.travelly-tour-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.travelly-cat-badge {
  background: rgba(34,113,177,0.1);
  color: var(--travelly-primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}
.travelly-tour-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--travelly-text);
  margin: 0 0 16px;
  line-height: 1.3;
}
@media (max-width: 768px) { .travelly-tour-title { font-size: 1.5rem; } }

.travelly-tour-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--travelly-text-light);
  font-size: 0.9rem;
  padding: 16px 0;
  border-top: 1px solid var(--travelly-border);
  border-bottom: 1px solid var(--travelly-border);
}
.travelly-rating-stars { color: #f0a500; }

/* Tabs */
.travelly-tabs { margin-top: 30px; }
.travelly-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 2px solid var(--travelly-border);
  margin-bottom: 24px;
}
.travelly-tab-btn {
  background: none;
  border: none;
  padding: 12px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--travelly-text-light);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: var(--travelly-transition);
}
.travelly-tab-btn:hover { color: var(--travelly-primary); }
.travelly-tab-btn.active {
  color: var(--travelly-primary);
  border-bottom-color: var(--travelly-primary);
}
.travelly-tab-content { display: none; }
.travelly-tab-content.active { display: block; }

/* Info Grid */
.travelly-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 28px;
  padding: 24px;
  background: var(--travelly-bg);
  border-radius: var(--travelly-radius);
}
.travelly-info-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.travelly-info-icon { font-size: 1.4rem; flex-shrink: 0; }
.travelly-info-item strong {
  display: block;
  font-size: 0.78rem;
  color: var(--travelly-text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}
.travelly-info-item span:last-child {
  color: var(--travelly-text);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Includes / Excludes */
.travelly-includes-excludes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}
@media (max-width: 600px) {
  .travelly-includes-excludes { grid-template-columns: 1fr; }
}
.travelly-includes h4, .travelly-excludes h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 14px;
}
.travelly-includes ul, .travelly-excludes ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.travelly-includes li, .travelly-excludes li {
  padding: 8px 0 8px 28px;
  position: relative;
  border-bottom: 1px solid var(--travelly-border);
  font-size: 0.9rem;
  color: var(--travelly-text);
}
.travelly-includes li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--travelly-success);
  font-weight: 700;
}
.travelly-excludes li::before {
  content: '✕';
  position: absolute;
  left: 0;
  color: var(--travelly-danger);
  font-weight: 700;
}
[dir="rtl"] .travelly-includes li,
[dir="rtl"] .travelly-excludes li {
  padding: 8px 28px 8px 0;
}
[dir="rtl"] .travelly-includes li::before,
[dir="rtl"] .travelly-excludes li::before {
  right: 0; left: auto;
}

/* FAQs */
.travelly-faq-item {
  border: 1px solid var(--travelly-border);
  border-radius: var(--travelly-radius-sm);
  overflow: hidden;
  margin-bottom: 10px;
}
.travelly-faq-question {
  width: 100%;
  background: var(--travelly-bg);
  border: none;
  padding: 16px 20px;
  text-align: right;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--travelly-text);
  transition: background 0.2s;
}
.travelly-faq-question:hover, .travelly-faq-question.active {
  background: rgba(34,113,177,0.08);
}
.travelly-faq-icon {
  font-size: 1.3rem;
  color: var(--travelly-primary);
  transition: transform 0.3s;
  flex-shrink: 0;
  margin-right: 10px;
}
[dir="rtl"] .travelly-faq-icon { margin-right: 0; margin-left: 10px; }
.travelly-faq-question.active .travelly-faq-icon { transform: rotate(45deg); }
.travelly-faq-answer {
  display: none;
  padding: 16px 20px;
  color: var(--travelly-text-light);
  font-size: 0.9rem;
  line-height: 1.7;
  background: var(--travelly-white);
}
.travelly-faq-answer.open { display: block; }

/* Organizer */
.travelly-organizer {
  margin-top: 24px;
  padding: 16px 20px;
  background: var(--travelly-bg);
  border-radius: var(--travelly-radius-sm);
}
.travelly-organizer h4 { margin: 0 0 8px; font-size: 0.85rem; color: var(--travelly-text-light); }
.travelly-organizer-link {
  color: var(--travelly-primary);
  text-decoration: none;
  font-weight: 600;
}

/* Share */
.travelly-share-box {
  background: var(--travelly-white);
  border-radius: var(--travelly-radius);
  box-shadow: var(--travelly-shadow);
  padding: 20px;
  margin-top: 20px;
}
.travelly-share-box h4 { margin: 0 0 14px; font-size: 0.95rem; font-weight: 700; }
.travelly-share-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.travelly-share-btn {
  padding: 8px 16px;
  border-radius: var(--travelly-radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
}
.travelly-share-fb { background: #1877f2; }
.travelly-share-wa { background: #25d366; }
.travelly-share-tw { background: #1da1f2; }

/* =============================================
   BOOKING FORM
   ============================================= */
.travelly-booking-widget {
  background: var(--travelly-white);
  border-radius: var(--travelly-radius);
  box-shadow: var(--travelly-shadow-md);
  overflow: hidden;
  position: sticky;
  top: 20px;
}
.travelly-booking-form-wrap { }

.travelly-booking-form-header {
  background: linear-gradient(135deg, var(--travelly-primary), var(--travelly-secondary));
  padding: 20px 24px;
  color: #fff;
}
.travelly-booking-price .travelly-price--current {
  font-size: 2rem;
  color: #fff;
}
.travelly-booking-price .travelly-price--old {
  color: rgba(255,255,255,0.7);
}
.travelly-booking-price .travelly-price--per {
  color: rgba(255,255,255,0.8);
}

.travelly-booking-form { padding: 24px; }
.travelly-form-group { margin-bottom: 20px; }
.travelly-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--travelly-text);
  margin-bottom: 8px;
}
.travelly-label .required { color: #e74c3c; }
.travelly-input, .travelly-select, .travelly-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--travelly-border);
  border-radius: var(--travelly-radius-sm);
  font-size: 0.9rem;
  color: var(--travelly-text);
  background: var(--travelly-white);
  transition: border-color 0.2s;
  outline: none;
  font-family: inherit;
}
.travelly-input:focus, .travelly-select:focus, .travelly-textarea:focus {
  border-color: var(--travelly-primary);
  box-shadow: 0 0 0 3px rgba(34,113,177,0.1);
}
.travelly-textarea { resize: vertical; }

/* Tickets List */
.travelly-tickets-list, .travelly-extras-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.travelly-ticket-item, .travelly-extra-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--travelly-bg);
  border-radius: var(--travelly-radius-sm);
  border: 1px solid var(--travelly-border);
  gap: 16px;
}
.travelly-ticket-info, .travelly-extra-info {
  flex: 1;
}
.travelly-ticket-name, .travelly-extra-name {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--travelly-text);
}
.travelly-ticket-desc {
  display: block;
  font-size: 0.78rem;
  color: var(--travelly-text-light);
  margin-top: 2px;
}
.travelly-ticket-price, .travelly-extra-price {
  display: block;
  font-size: 0.88rem;
  color: var(--travelly-primary);
  font-weight: 600;
  margin-top: 4px;
}

/* Qty Controls */
.travelly-ticket-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.travelly-qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--travelly-primary);
  background: var(--travelly-white);
  color: var(--travelly-primary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--travelly-transition);
  padding: 0;
  line-height: 1;
}
.travelly-qty-btn:hover {
  background: var(--travelly-primary);
  color: #fff;
}
.travelly-qty-input {
  width: 48px;
  text-align: center;
  border: 2px solid var(--travelly-border);
  border-radius: var(--travelly-radius-sm);
  padding: 6px 4px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--travelly-text);
  -moz-appearance: textfield;
}
.travelly-qty-input::-webkit-outer-spin-button,
.travelly-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Price Summary */
.travelly-price-summary {
  background: var(--travelly-bg);
  border-radius: var(--travelly-radius-sm);
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--travelly-border);
}
.travelly-price-summary__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--travelly-text);
  margin-bottom: 10px;
}
.travelly-price-summary__rows { margin-bottom: 10px; }
.travelly-price-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--travelly-text-light);
  padding: 4px 0;
}
.travelly-price-summary__total {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 800;
  color: var(--travelly-text);
  border-top: 1px solid var(--travelly-border);
  padding-top: 10px;
}
.travelly-price-total {
  color: var(--travelly-primary);
  font-size: 1.1rem;
}
.travelly-form-note {
  text-align: center;
  color: var(--travelly-text-light);
  margin-top: 10px;
}

/* =============================================
   MY BOOKINGS
   ============================================= */
.travelly-my-bookings { padding: 20px 0; }
.travelly-my-bookings h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--travelly-text);
}

.travelly-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--travelly-bg);
  border-radius: var(--travelly-radius);
}
.travelly-empty-icon { font-size: 4rem; margin-bottom: 16px; }
.travelly-empty-state h3 { font-size: 1.3rem; margin-bottom: 10px; }
.travelly-empty-state p { color: var(--travelly-text-light); margin-bottom: 24px; }

.travelly-bookings-list { display: flex; flex-direction: column; gap: 20px; }

.travelly-booking-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  background: var(--travelly-white);
  border-radius: var(--travelly-radius);
  box-shadow: var(--travelly-shadow);
  overflow: hidden;
  transition: var(--travelly-transition);
}
.travelly-booking-card:hover { box-shadow: var(--travelly-shadow-md); }

@media (max-width: 600px) {
  .travelly-booking-card { grid-template-columns: 1fr; }
  .travelly-booking-card__image { height: 180px; }
}

.travelly-booking-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.travelly-booking-card__no-image {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8f4f8, #c8e6f5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  min-height: 120px;
}
.travelly-booking-card__content { padding: 20px; }
.travelly-booking-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.travelly-booking-card__header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}
.travelly-booking-card__header a { color: var(--travelly-text); text-decoration: none; }
.travelly-booking-card__header a:hover { color: var(--travelly-primary); }

.travelly-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.travelly-booking-card__meta { margin-bottom: 16px; }
.travelly-booking-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.87rem;
  color: var(--travelly-text);
  padding: 5px 0;
  border-bottom: 1px solid var(--travelly-border);
}
.travelly-booking-meta-item:last-child { border-bottom: none; }
.meta-icon { font-size: 1rem; flex-shrink: 0; }

.travelly-booking-card__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Map */
.travelly-map-wrapper { position: relative; }
.travelly-map {
  width: 100%;
  border-radius: var(--travelly-radius);
  overflow: hidden;
}
.travelly-map-address {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--travelly-text-light);
}

/* Notice */
.travelly-notice {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--travelly-radius-sm);
  padding: 14px 18px;
  color: #856404;
  font-size: 0.9rem;
}
.travelly-notice a { color: var(--travelly-primary); }
