/* ==========================================================================
   GIFTORY COMPREHENSIVE RESPONSIVE DESIGN SYSTEM
   Supports Mobile Phones (320px - 575px), Phablets & Small Tablets (576px - 767px),
   Tablets / iPads (768px - 991px), Laptops (992px - 1199px), Desktops (1200px+)
   ========================================================================== */

/* -------------------------------------------------------------------------
   1. GLOBAL TOUCH & FLUIDITY ENHANCEMENTS
   ------------------------------------------------------------------------- */
html, body {
  overflow-x: hidden !important;
  width: 100%;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* Prevent layout overflow */
.container, .container-fluid {
  padding-left: 16px;
  padding-right: 16px;
}

/* -------------------------------------------------------------------------
   2. HERO SLIDER RESPONSIVENESS (All Screen Sizes)
   ------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
  .hero-title {
    font-size: 2.5rem !important;
  }
  .hero-product-img {
    max-height: 320px;
  }
}

@media (max-width: 991.98px) {
  .hero-main-card {
    min-height: auto !important;
    border-radius: 22px;
    padding: 20px 15px 30px !important;
  }
  
  .hero-slides-wrapper {
    min-height: auto !important;
  }

  .hero-slide {
    min-height: auto !important;
  }

  .hero-slide .row {
    padding: 1.5rem 1rem !important;
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero-slide .col-lg-6.ps-md-5 {
    padding-left: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-title {
    font-size: 2.1rem !important;
    line-height: 1.25;
    margin-bottom: 14px !important;
    max-width: 540px;
  }

  .hero-price-wrap {
    justify-content: center;
    margin-bottom: 20px;
  }

  .hero-product-img {
    max-height: 260px;
    margin-bottom: 10px;
  }

  /* Left dots tab repositioned for tablets */
  .hero-side-dots {
    padding: 12px 6px;
    border-top-right-radius: 14px;
    border-bottom-right-radius: 14px;
  }
  .hero-dot {
    width: 8px;
    height: 8px;
  }

  /* Navigation arrows adjusted */
  .hero-nav-arrows {
    padding: 8px 12px;
    border-top-left-radius: 18px;
    border-bottom-right-radius: 22px;
  }
  .hero-arrow-btn {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }
}

@media (max-width: 575.98px) {
  .hero-wrapper {
    padding: 10px 0 20px !important;
  }

  .hero-main-card {
    border-radius: 18px;
    padding: 15px 8px 35px !important;
  }

  .hero-slide .row {
    padding: 1rem 0.5rem !important;
  }

  .hero-tagline {
    font-size: 12px !important;
    letter-spacing: 0.5px;
    margin-bottom: 8px !important;
  }

  .hero-title {
    font-size: 1.55rem !important;
    letter-spacing: -0.3px;
    margin-bottom: 12px !important;
  }

  .hero-price-wrap {
    gap: 8px;
    margin-bottom: 16px;
  }
  .hero-old-price {
    font-size: 0.95rem;
  }
  .hero-sale-price {
    font-size: 1.5rem;
  }
  .hero-discount-pill {
    font-size: 10px;
    padding: 3px 8px;
  }

  .hero-btn-buy {
    font-size: 13.5px;
    padding: 8px 24px;
  }

  .hero-product-img {
    max-height: 200px;
  }

  .hero-side-dots {
    display: none !important;
  }

  .hero-nav-arrows {
    display: flex !important;
    padding: 6px 10px;
    gap: 6px;
    border-top-left-radius: 16px;
    border-bottom-right-radius: 18px;
  }
  .hero-arrow-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
}

/* -------------------------------------------------------------------------
   3. HEADER & NAVIGATION RESPONSIVENESS
   ------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
  .site-header .main-nav-links {
    display: none !important;
  }
}

@media (max-width: 575.98px) {
  .top-promo-bar {
    font-size: 11.5px;
  }

  .site-header {
    padding: 6px 0;
  }
  .site-header .logo-text {
    font-size: 1.25rem !important;
  }
  .site-header .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }
  .icon-btn i {
    font-size: 15px !important;
  }
}

/* -------------------------------------------------------------------------
   4. PRODUCT CARDS & IMAGE TRANSITIONS (Grid on Mobile / Tablet / Desktop)
   ------------------------------------------------------------------------- */
.product-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

@media (max-width: 767.98px) {
  .product-img-wrapper {
    height: 180px !important;
  }
  .product-card {
    border-radius: 14px !important;
  }
  .product-title {
    font-size: 13.5px !important;
    min-height: 36px !important;
    margin-bottom: 6px !important;
  }
  .product-curr-price, .product-price-current {
    font-size: 1rem !important;
  }
  .product-old-price, .product-price-old {
    font-size: 0.75rem !important;
  }
  .btn-add-to-cart, .btn-add-cart {
    font-size: 12px !important;
    padding: 7px 12px !important;
  }
}

@media (max-width: 575.98px) {
  .row.row-cols-1.row-cols-sm-2.row-cols-md-3,
  .row.row-cols-1.row-cols-sm-2.row-cols-md-4,
  .row.row-cols-1.row-cols-sm-2.row-cols-lg-4 {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
  }
  
  .product-img-wrapper {
    height: 150px !important;
  }
  
  .product-badge-sale, .badge.position-absolute {
    font-size: 9px !important;
    padding: 2px 6px !important;
    margin: 6px !important;
  }

  .product-btn-wishlist {
    width: 30px !important;
    height: 30px !important;
    font-size: 11px !important;
    margin: 6px !important;
  }
}

/* -------------------------------------------------------------------------
   5. SHOP PAGE FILTER SIDEBAR & MOBILE ACCORDION
   ------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .shop-sidebar-card {
    position: static !important;
    margin-bottom: 20px;
    border-radius: 16px !important;
  }
  
  .category-hero-banner {
    padding: 40px 0 !important;
    border-radius: 0 0 20px 20px !important;
  }
  .category-hero-banner h1 {
    font-size: 1.75rem !important;
  }
}

/* -------------------------------------------------------------------------
   6. GIFT FINDER TOOL RESPONSIVENESS
   ------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .gift-finder-card {
    padding: 25px 18px !important;
    border-radius: 18px;
  }
  .finder-option-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* -------------------------------------------------------------------------
   7. FLASH DEAL / SPECIAL OFFER SECTION
   ------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .deal-timer-item {
    padding: 8px 12px;
    min-width: 55px;
  }
  .deal-timer-num {
    font-size: 1.35rem;
  }
  .deal-timer-lbl {
    font-size: 10px;
  }
}

@media (max-width: 575.98px) {
  #specialOfferCountdown {
    gap: 6px !important;
  }
  .deal-timer-item {
    padding: 6px 8px;
    min-width: 48px;
  }
  .deal-timer-num {
    font-size: 1.15rem;
  }
}

/* -------------------------------------------------------------------------
   8. PRODUCT DETAIL PAGE RESPONSIVENESS (product.php)
   ------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .product-gallery-wrapper {
    position: static !important;
    margin-bottom: 25px;
  }
  .main-image-container {
    min-height: 320px !important;
  }
  .main-image-container img {
    max-height: 320px !important;
  }
}

@media (max-width: 575.98px) {
  .main-image-container {
    min-height: 240px !important;
    padding: 10px !important;
  }
  .main-image-container img {
    max-height: 240px !important;
  }
  .product-detail-title {
    font-size: 1.35rem !important;
  }
}

/* -------------------------------------------------------------------------
   9. SHOPPING CART & CHECKOUT PAGES
   ------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .cart-table-wrap {
    overflow-x: auto;
  }
  
  .table-responsive {
    border-radius: 12px;
  }

  .checkout-order-summary {
    position: static !important;
    margin-top: 20px;
  }

  /* Checkout steps */
  .order-tracking-timeline {
    margin: 20px 0 10px;
  }
  .tracking-step-icon {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }
  .tracking-step-label {
    font-size: 10px;
  }
}

/* -------------------------------------------------------------------------
   10. FOOTER & FLOATING WHATSAPP
   ------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .site-footer {
    padding-top: 40px !important;
    margin-top: 40px !important;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  .floating-whatsapp-btn {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 26px;
  }
  .whatsapp-tooltip {
    display: none;
  }
}

/* -------------------------------------------------------------------------
   11. ADMIN PANEL RESPONSIVENESS (admin/)
   ------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  #sidebar {
    transform: translateX(-120%);
    width: 260px;
    z-index: 1050;
  }
  #sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  }
  #main-content {
    margin-left: 0 !important;
  }
  .content-wrapper {
    padding: 16px !important;
  }
}

@media (max-width: 575.98px) {
  .top-navbar {
    padding: 0 12px !important;
    height: 56px !important;
  }
  .content-wrapper {
    padding: 12px 8px !important;
  }
  .kpi-card .card-body {
    padding: 14px !important;
  }
}

/* Admin tables & filter rows */
@media (max-width: 767.98px) {
  .table-responsive table {
    font-size: 13px;
  }
  .table-responsive th,
  .table-responsive td {
    white-space: nowrap;
  }
  .date-picker-box,
  select[style*="width: 250px"],
  select[style*="width:250px"] {
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 575.98px) {
  .table-responsive table {
    font-size: 12px;
  }
  .content-wrapper .d-flex.flex-wrap,
  .content-wrapper .d-flex.justify-content-between {
    row-gap: 10px;
  }
  .content-wrapper h1, .content-wrapper h2, .content-wrapper h3 {
    font-size: 1.25rem !important;
  }
}

/* -------------------------------------------------------------------------
   12. GIFT FINDER TOOL & DEAL SECTION (Homepage) — small screen refinement
   ------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .gift-finder-card {
    padding: 22px 16px !important;
  }
  .finder-option-btn {
    font-size: 11.5px;
    padding: 6px 12px;
  }
  .deal-card {
    padding: 28px 20px !important;
  }
  .deal-timer-item {
    min-width: 44px;
    padding: 6px 6px;
  }
  .deal-timer-num {
    font-size: 1rem;
  }
  .deal-timer-lbl {
    font-size: 9px;
  }
}

@media (max-width: 575.98px) {
  #dealCountdownWrap,
  .deal-card [id*="deal"] {
    flex-wrap: wrap;
  }
  .deal-card .row {
    text-align: center;
  }
}

/* -------------------------------------------------------------------------
   13. ORDER TRACKING TIMELINE — mobile shrink & wrap
   ------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  .order-tracking-timeline {
    margin: 28px 0 10px;
  }
  .order-tracking-timeline::before {
    top: 17px;
    left: 20px;
    right: 20px;
  }
  .tracking-step-icon {
    width: 36px;
    height: 36px;
    font-size: 13px;
    border-width: 2px;
    margin-bottom: 6px;
  }
  .tracking-step-label {
    font-size: 9.5px;
    line-height: 1.2;
    word-break: break-word;
  }
}

@media (max-width: 420px) {
  .order-tracking-timeline {
    margin: 22px 0 8px;
  }
  .order-tracking-timeline::before {
    top: 14px;
    left: 14px;
    right: 14px;
  }
  .tracking-step-icon {
    width: 30px;
    height: 30px;
    font-size: 11px;
  }
  .tracking-step-label {
    font-size: 8.5px;
  }
}

/* -------------------------------------------------------------------------
   14. PRODUCT DETAIL PAGE — gallery & purchase row on mobile/tablet
   ------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .product-gallery-wrapper.sticky-top {
    position: static !important;
    top: auto !important;
  }
}

@media (max-width: 575.98px) {
  #galleryThumbnails .gallery-thumb-item {
    width: 64px !important;
    height: 64px !important;
  }
  .input-group[style*="width: 140px"],
  .input-group[style*="width:140px"] {
    width: 120px !important;
    flex-shrink: 0;
  }
}

/* -------------------------------------------------------------------------
   15. OCCASION / CATEGORY PILL GRIDS — small screens
   ------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
  .occasion-pill-card {
    padding: 14px 8px;
  }
  .occasion-icon-wrap {
    width: 42px;
    height: 42px;
    font-size: 17px;
    margin-bottom: 8px;
  }
  .cat-circle-thumb {
    width: 92px;
    height: 92px;
  }
  .cat-circle-card {
    padding: 20px 12px;
  }
  .category-img-box {
    height: 150px;
  }
}

/* -------------------------------------------------------------------------
   16. SHOP FILTERS, SORT BAR & FORMS — general mobile safety
   ------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
  select[style*="width: 190px"],
  select[style*="width:190px"] {
    width: 100% !important;
    max-width: 220px;
  }
  .search-box-wrapper {
    width: 100% !important;
  }
  .search-box-wrapper:focus-within {
    width: 100% !important;
  }
}

/* -------------------------------------------------------------------------
   17. CHECKOUT & CART SUMMARY — stacking order on small screens
   ------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .checkout-order-summary,
  .cart-summary-card {
    position: static !important;
  }
}

@media (max-width: 575.98px) {
  .cart-table-wrap table td,
  .cart-table-wrap table th {
    font-size: 12.5px;
    padding: 8px 6px !important;
  }
}

/* -------------------------------------------------------------------------
   18. GLOBAL SAFETY NET — prevent horizontal scroll (scoped, non-destructive)
   ------------------------------------------------------------------------- */
/* Only let flex/grid columns shrink below their content size (needed so
   long unbroken strings don't force the whole row wider than the screen).
   Scoped to Bootstrap's own grid/flex classes only — NOT `*` — so headings,
   prices, and KPI numbers are never forced to wrap character-by-character. */
.row > [class*="col-"],
.d-flex > *,
.flex-grow-1,
.flex-fill {
  min-width: 0;
}

/* Long, genuinely breakable text (free text, descriptions, messages) may
   wrap on word boundaries; short labels/numbers are left alone so they
   never shatter into single characters. */
p, .card-text, .text-wrap-safe {
  overflow-wrap: break-word;
}

table {
  max-width: 100%;
}

@media (max-width: 991.98px) {
  .container, .container-fluid, .container-lg, .container-xl {
    max-width: 100%;
  }
}

@media (max-width: 575.98px) {
  .container, .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }
  h1 { font-size: 1.6rem !important; }
  h2, .section-title { font-size: 1.4rem !important; }
  h3 { font-size: 1.2rem !important; }
  .btn { font-size: 13.5px; }
}

/* -------------------------------------------------------------------------
   19. TOUCH DEVICE ENHANCEMENTS
   ------------------------------------------------------------------------- */
@media (hover: none) and (pointer: coarse) {
  .btn, .icon-btn, .finder-option-btn, a.dropdown-item, .product-btn-wishlist,
  .hero-arrow-btn, .hero-dot, #sidebar a {
    min-height: 38px;
  }
  .product-card:hover {
    transform: none;
  }
}

/* -------------------------------------------------------------------------
   20. LARGE DESKTOP / WIDE SCREEN POLISH (1400px+)
   ------------------------------------------------------------------------- */
@media (min-width: 1400px) {
  .hero-main-card,
  .hero-slides-wrapper,
  .hero-slide {
    min-height: 520px;
  }
  .hero-product-img {
    max-height: 420px;
  }
}