/* vcard49 — Travel Theme — Responsive Design */

/* ========== MOBILE DRAWER ========== */

/* Overlay behind drawer */
.v49-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1039;
  transition: opacity .3s;
}
.v49-drawer-overlay.active {
  display: block;
}

/* Drawer panel — slides in from right */
.v49-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  background: #fff;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 32px rgba(0,0,0,.15);
  overflow-y: auto;
}
.v49-mobile-drawer.active {
  transform: translateX(0);
}

/* Drawer header row */
.v49-mobile-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #F0F0F0;
  background: #FFF8E1;
  flex-shrink: 0;
}

/* Close button inside drawer */
.v49-drawer-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #3A3A3A;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}
.v49-drawer-close:hover {
  background: #FFE082;
}

/* Nav links inside drawer */
.v49-mobile-drawer__nav {
  flex: 1;
  padding: 8px 0;
}
.v49-drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  color: #3A3A3A;
  text-decoration: none;
  border-bottom: 1px solid #F5F5F5;
  transition: background .15s, color .15s;
}
.v49-drawer-link i {
  width: 20px;
  text-align: center;
  color: #FFC107;
  font-size: 14px;
}
.v49-drawer-link:hover {
  background: #FFF8E1;
  color: #FFB300;
}

/* Cart / Account buttons at bottom of drawer */
.v49-mobile-drawer__actions {
  padding: 16px;
  border-top: 1px solid #F0F0F0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.v49-drawer-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #FFC107;
  color: #3A3A3A;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: background .15s;
}
.v49-drawer-action-btn:hover {
  background: #FFB300;
  color: #3A3A3A;
}

/* Hide drawer on desktop */
@media (min-width: 769px) {
  .v49-mobile-drawer,
  .v49-drawer-overlay,
  #mobileNavOverlay { display: none !important; }
}

/* ========== TABLET (768px and down) ========== */

@media (max-width: 768px) {
  :root {
    --v49-font-size-4xl: 2rem;
    --v49-font-size-3xl: 1.5rem;
    --v49-spacing-3xl: 2rem;
    --v49-spacing-2xl: 1.5rem;
  }

  /* Header */
  .v49-header__container {
    padding: 0 12px;
    gap: 10px;
  }

  /* Hide desktop nav, show burger */
  .v49-nav {
    display: none !important;
  }

  .v49-mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #FFF8E1;
  }

  .v49-header__actions {
    gap: 8px;
  }

  /* Hide wishlist icon on mobile to save space */
  .v49-header__actions > a[href="javascript:void(0)"] {
    display: none;
  }

  /* Hero */
  .v49-hero {
    height: 350px;
  }

  .v49-hero__title {
    font-size: var(--v49-font-size-2xl);
  }

  .v49-hero__subtitle {
    font-size: var(--v49-font-size-base);
  }

  .v49-hero__content {
    padding: var(--v49-spacing-lg);
  }

  /* Categories */
  .v49-categories {
    padding: var(--v49-spacing-2xl) var(--v49-spacing-md);
  }

  .v49-categories__grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: var(--v49-spacing-md);
  }

  .v49-category-card {
    padding: var(--v49-spacing-md);
  }

  .v49-category-card__icon {
    font-size: var(--v49-font-size-3xl);
  }

  .v49-category-card__name {
    font-size: 11px;
  }

  /* Featured */
  .v49-featured {
    padding: var(--v49-spacing-2xl) var(--v49-spacing-md);
  }

  .v49-featured__grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--v49-spacing-lg);
  }

  /* Product Card */
  .v49-pcard__name {
    font-size: var(--v49-font-size-base);
  }

  .v49-pcard__image {
    height: 180px;
  }

  /* Footer */
  .v49-footer {
    padding: var(--v49-spacing-2xl) var(--v49-spacing-md);
  }

  .v49-footer__grid {
    gap: var(--v49-spacing-lg);
  }

  .v49-footer__bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* ========== MOBILE (480px and down) ========== */

@media (max-width: 480px) {
  :root {
    --v49-font-size-4xl: 1.5rem;
    --v49-font-size-3xl: 1.25rem;
    --v49-font-size-xl: 1rem;
    --v49-spacing-3xl: 1.5rem;
    --v49-spacing-2xl: 1rem;
    --v49-spacing-lg: 1rem;
  }

  body {
    font-size: var(--v49-font-size-sm);
  }

  /* Header */
  .v49-header {
    padding: var(--v49-spacing-md) 0;
  }

  .v49-header__container {
    padding: 0 var(--v49-spacing-md);
  }

  .v49-logo {
    font-size: var(--v49-font-size-lg);
  }

  .v49-logo i {
    font-size: var(--v49-font-size-2xl);
  }

  /* Hero */
  .v49-hero {
    height: 280px;
  }

  .v49-hero__title {
    font-size: var(--v49-font-size-2xl);
    margin-bottom: var(--v49-spacing-md);
  }

  .v49-hero__subtitle {
    font-size: var(--v49-font-size-sm);
    margin-bottom: var(--v49-spacing-lg);
  }

  .v49-hero__cta {
    padding: var(--v49-spacing-sm) var(--v49-spacing-lg);
    font-size: var(--v49-font-size-sm);
  }

  .v49-hero__content {
    padding: var(--v49-spacing-md);
  }

  /* Categories */
  .v49-categories {
    padding: var(--v49-spacing-lg) var(--v49-spacing-md);
  }

  .v49-categories__title {
    font-size: var(--v49-font-size-2xl);
    margin-bottom: var(--v49-spacing-lg);
  }

  .v49-categories__grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: var(--v49-spacing-sm);
  }

  .v49-category-card {
    padding: var(--v49-spacing-sm);
  }

  .v49-category-card__icon {
    font-size: var(--v49-font-size-2xl);
    margin-bottom: var(--v49-spacing-sm);
  }

  .v49-category-card__name {
    font-size: 10px;
  }

  /* Featured */
  .v49-featured {
    padding: var(--v49-spacing-lg) var(--v49-spacing-md);
  }

  .v49-featured__title {
    font-size: var(--v49-font-size-2xl);
    margin-bottom: var(--v49-spacing-lg);
  }

  .v49-featured__grid {
    grid-template-columns: 1fr;
    gap: var(--v49-spacing-lg);
  }

  /* Product Card */
  .v49-pcard {
    margin-bottom: var(--v49-spacing-md);
  }

  .v49-pcard__image {
    height: 150px;
  }

  .v49-pcard__content {
    padding: var(--v49-spacing-md);
  }

  .v49-pcard__name {
    font-size: var(--v49-font-size-sm);
    margin-bottom: var(--v49-spacing-xs);
  }

  .v49-pcard__price-main {
    font-size: var(--v49-font-size-lg);
  }

  .v49-pcard__footer {
    flex-direction: column;
    gap: var(--v49-spacing-sm);
    align-items: stretch;
  }

  .v49-pcard__actions {
    display: flex;
    gap: var(--v49-spacing-sm);
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
  }

  .v49-pcard__actions .v49-pcard__wish-btn {
    width: auto;
    min-width: 44px;
    padding: 0.75rem;
  }

  .v49-pcard__actions .v49-btn-primary {
    flex: 1 1 100%;
  }

  .v49-pcard__actions .v49-btn-primary .fa,
  .v49-pcard__actions .v49-btn-primary svg {
    margin-right: 0.5rem;
  }

  .v49-btn-primary {
    width: 100%;
  }

  /* Footer */
  .v49-footer {
    padding: var(--v49-spacing-lg) var(--v49-spacing-md);
  }

  .v49-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--v49-spacing-lg);
  }

  .v49-footer__section h4 {
    font-size: var(--v49-font-size-base);
  }

  .v49-footer__socials {
    justify-content: center;
    width: 100%;
  }

  /* Modal */
  .v49-modal__content {
    width: 95%;
    max-height: 95vh;
  }

  .v49-modal__header,
  .v49-modal__body,
  .v49-modal__footer {
    padding: var(--v49-spacing-md);
  }

  .v49-modal__title {
    font-size: var(--v49-font-size-lg);
  }
}

/* ========== INLINE-GRID RESETS — pages that use hardcoded grid-template-columns ========== */

@media (max-width: 768px) {
  /* Service detail, offer detail, business-info two-column layouts */
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Edit-profile two column */
  [style*="grid-template-columns:1fr 300px"],
  [style*="grid-template-columns: 1fr 300px"] {
    grid-template-columns: 1fr !important;
  }

  /* Order detail two-column */
  [style*="grid-template-columns:1fr 340px"],
  [style*="grid-template-columns: 1fr 340px"] {
    grid-template-columns: 1fr !important;
  }

  /* Gallery three-column */
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Ecommerce customer pages */
  .v49-ec-card-body [style*="grid-template-columns:1fr 1fr"],
  .v49-ec-card-body [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Business info section map height */
  #about [style*="height:380px"] {
    height: 260px !important;
  }
}

@media (max-width: 480px) {
  /* Gallery on small phones: single column */
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* v49-featured__grid already handled but reinforce */
  .v49-featured__grid {
    grid-template-columns: 1fr !important;
  }

  /* Ecommerce layout */
  .v49-ec-stepper {
    padding: 10px 8px !important;
    gap: 4px !important;
    overflow-x: auto;
  }
  .v49-ec-step {
    font-size: 11px !important;
    min-width: 60px;
  }
}

/* ========== LANDSCAPE MOBILE (576px) ========== */

@media (max-width: 576px) and (orientation: landscape) {
  .v49-hero {
    height: 300px;
  }

  .v49-hero__title {
    font-size: var(--v49-font-size-2xl);
  }

  .v49-hero__subtitle {
    display: none;
  }

  .v49-categories__grid {
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  }
}

/* ========== DESKTOP (1200px and up) ========== */

@media (min-width: 1200px) {
  .v49-featured__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .v49-categories__grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* ========== LARGE DESKTOP (1400px and up) ========== */

@media (min-width: 1400px) {
  .v49-container {
    max-width: 1400px;
  }

  .v49-featured__grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ========== EXTRA LARGE (1600px and up) ========== */

@media (min-width: 1600px) {
  :root {
    --v49-font-size-4xl: 3rem;
    --v49-font-size-3xl: 2.25rem;
  }

  .v49-hero {
    height: 600px;
  }

  .v49-hero__title {
    font-size: var(--v49-font-size-4xl);
  }

  .v49-hero__subtitle {
    font-size: var(--v49-font-size-xl);
  }
}

/* ========== UTILITY CLASSES ========== */

@media (max-width: 768px) {
  .v49-hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .v49-show-mobile {
    display: none !important;
  }
}

/* Scrollbar styling for better UX */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--v49-light-grey);
}

::-webkit-scrollbar-thumb {
  background: var(--v49-accent-gold);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--v49-primary-yellow);
}
