/* responsive.css - Comprehensive Fluid & Responsive Design System for Kishna Fashion */

/* ── 1. GLOBAL FLUID & UTILITY OVERRIDES ── */
:root {
  --fluid-container: min(1240px, calc(100% - 32px));
}

@media (max-width: 480px) {
  :root {
    --fluid-container: calc(100% - 24px);
  }
}

.container {
  width: var(--fluid-container) !important;
}

/* Fluid Product Card Titles to prevent uneven wrapping & alignment glitches ("ghich pich") */
.product-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.6em;
  line-height: 1.3;
}

/* Prevent image distortion across viewports */
.product-image img,
.pdp-main-image img,
.collection-card img,
.story-image img {
  object-fit: cover;
  width: 100%;
}

/* ── 2. LARGE LAPTOP & DESKTOP (1200px to 1399px) ── */
@media (max-width: 1399px) {
  .hero-title {
    font-size: clamp(52px, 6.5vw, 88px);
  }
  .shop-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
  .pdp-grid {
    gap: 40px;
  }
}

@media (max-width: 1199px) {
  .hero {
    height: min(780px, 90vh);
    min-height: 600px;
  }
  .hero-title {
    font-size: clamp(46px, 6vw, 76px);
  }
  .hero-description {
    font-size: 13.5px;
    max-width: 480px;
  }
  .shop-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  .collections {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .collection-card:first-child {
    grid-column: span 2;
    height: 420px;
  }
  .collection-card {
    height: 380px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 30px;
  }
}

/* ── 3. TABLETS & PORTRAIT IPADS (769px to 950px) ── */
@media (max-width: 950px) {
  /* Navigation */
  .nav-links {
    display: none !important;
  }
  .menu-button {
    display: grid !important;
  }
  .navbar {
    height: 64px;
    padding-inline: 18px;
  }
  .logo {
    font-size: 17px;
    letter-spacing: 2px;
  }
  
  /* Shop Toolbar & Filters */
  .shop-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 24px;
  }
  .shop-filters::-webkit-scrollbar {
    display: none;
  }
  .shop-filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  /* Layout Grids */
  .shop-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .pdp-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .pdp-gallery {
    position: static;
  }
  .pdp-main-image {
    max-height: 480px;
  }
  .cart-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .cart-summary {
    position: static;
  }
  .checkout-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .checkout-summary {
    position: static;
  }
  
  /* Story & Features */
  .story-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .story-image {
    height: 420px;
  }
  .newsletter-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  
  /* Quick View Modal */
  .modal {
    grid-template-columns: 1fr;
    max-height: 85vh;
  }
  .modal-image-wrap {
    height: 280px;
  }
  .modal-body {
    padding: 24px;
  }
}

/* ── 4. PHABLETS & LARGE PHONES (601px to 768px) ── */
@media (max-width: 768px) {
  .section {
    padding: 60px 0;
  }
  .section-title {
    font-size: clamp(32px, 5.5vw, 48px);
  }
  .hero-title {
    font-size: clamp(38px, 7vw, 58px);
    letter-spacing: -1.5px;
  }
  .hero-copy {
    padding-top: 40px;
  }
  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .collections {
    grid-template-columns: 1fr;
  }
  .collection-card:first-child {
    grid-column: span 1;
    height: 360px;
  }
  .collection-card {
    height: 340px;
  }
  .product-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .product-slider {
    gap: 14px;
  }
  .product-card {
    min-width: calc(46% - 10px);
  }
  
  /* Form Layout */
  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .payment-options {
    flex-direction: column;
    gap: 10px;
  }
}

/* ── 5. STANDARD SMARTPHONES (400px to 600px) ── */
@media (max-width: 600px) {
  /* Site Header & Top Bar */
  .announcement {
    font-size: 8.5px;
    letter-spacing: 1.2px;
    padding: 0 8px;
  }
  .navbar-wrap {
    padding-top: 6px;
  }
  .navbar {
    height: 58px;
    padding-inline: 12px;
  }
  .logo {
    font-size: 15px;
    letter-spacing: 1.5px;
  }
  .nav-actions {
    gap: 6px;
  }
  .nav-button:not(.nav-user-btn) {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
  .nav-user-btn {
    height: 36px !important;
    padding: 0 10px !important;
    font-size: 11px !important;
  }
  
  /* Hero Banner */
  .hero {
    height: min(620px, 82vh);
    min-height: 480px;
  }
  .hero-copy {
    padding-top: 30px;
  }
  .hero-kicker {
    font-size: 8.5px;
    letter-spacing: 2.5px;
    margin-bottom: 12px;
  }
  .hero-title {
    font-size: clamp(32px, 8vw, 46px);
    margin-bottom: 16px;
  }
  .hero-description {
    font-size: 12.5px;
    line-height: 1.6;
    margin-bottom: 22px;
  }
  .hero-buttons {
    gap: 8px;
  }
  .hero-buttons .btn {
    min-height: 44px;
    padding: 0 18px;
    font-size: 10px;
    width: 100%;
  }
  .hero-controls {
    bottom: 16px;
  }
  .slider-number {
    font-size: 20px;
  }
  .slider-progress {
    width: 55px;
  }
  .hero-arrow {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  /* Shop Page & Products */
  .shop-header {
    padding: 36px 12px;
    margin-bottom: 24px;
  }
  .shop-header h1 {
    font-size: clamp(28px, 6vw, 42px);
  }
  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .product-image {
    min-height: unset;
    aspect-ratio: 3 / 4;
    border-radius: 14px;
  }
  .product-info {
    padding: 10px 2px 2px 2px;
  }
  .product-name {
    font-size: 12.5px;
    line-height: 1.3;
    min-height: 2.6em;
    margin-bottom: 4px;
  }
  .price {
    font-size: 13.5px;
  }
  .old-price {
    font-size: 10.5px;
  }
  .add-button {
    font-size: 9.5px;
  }
  .quick-view-wrap {
    display: none; /* Hide hover quick-view on touch devices to avoid touch overlap */
  }
  
  /* PDP Page */
  .pdp-main-image {
    max-height: 360px;
    border-radius: 14px;
  }
  .pdp-thumbnails {
    gap: 8px;
  }
  .pdp-thumb {
    width: 58px;
    height: 58px;
    border-radius: 8px;
  }
  .pdp-title {
    font-size: clamp(24px, 5.5vw, 32px);
    margin-bottom: 12px;
  }
  .pdp-price {
    font-size: 22px;
  }
  .pdp-actions {
    flex-direction: column;
    gap: 10px;
  }
  .pdp-actions .btn {
    width: 100%;
    min-height: 46px;
  }
  
  /* Cart & Checkout */
  .cart-item {
    grid-template-columns: 70px 1fr;
    gap: 12px;
    padding: 14px;
    position: relative;
  }
  .cart-item-img {
    width: 70px;
    height: 70px;
    border-radius: 10px;
  }
  .cart-item-name {
    font-size: 13px;
    padding-right: 24px;
  }
  .cart-item-remove {
    position: absolute;
    top: 12px;
    right: 12px;
  }
  .cart-summary,
  .checkout-form-section,
  .checkout-summary {
    padding: 20px 16px;
    border-radius: 16px;
  }
  .checkout-header {
    padding: 30px 0 20px;
  }
  
  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  
  /* Modals */
  .modal-overlay {
    padding: 12px;
  }
  .modal {
    border-radius: 18px;
    width: 100%;
  }
  .modal-image-wrap {
    height: 220px;
  }
  .modal-body {
    padding: 18px;
  }
  .modal-title {
    font-size: 22px;
  }
  
  /* Customer Auth Card */
  .kf-auth-card {
    padding: 24px 18px !important;
    border-radius: 18px !important;
  }
}

/* ── 6. ULTRA COMPACT & COMPACT PHONES (Below 399px) ── */
@media (max-width: 399px) {
  .logo span {
    display: inline;
  }
  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .product-info {
    padding: 8px 0;
  }
  .product-name {
    font-size: 11.5px;
  }
  .price {
    font-size: 12.5px;
  }
  .btn {
    padding: 0 16px;
    font-size: 10px;
  }
}

/* ── MOBILE NAVIGATION DRAWER & OVERLAY ── */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(38, 27, 31, 0.65);
  backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: min(300px, 85vw);
  height: 100vh;
  background: #521727;
  color: #ffffff;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.35);
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 24px 20px;
  box-sizing: border-box;
}

.mobile-nav-drawer.open {
  right: 0;
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(197, 160, 108, 0.3);
  margin-bottom: 24px;
}

.mobile-nav-header .logo {
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  text-decoration: none;
}

.mobile-nav-header .logo span {
  color: #c5a06c;
}

.mobile-nav-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(197, 160, 108, 0.4);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  cursor: pointer;
  transition: 0.2s ease;
}

.mobile-nav-close:hover {
  background: #c5a06c;
  color: #521727;
}

.mobile-nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-nav-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  transition: 0.2s ease;
}

.mobile-nav-links a i {
  font-size: 18px;
  color: #c5a06c;
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
  background: rgba(197, 160, 108, 0.2);
  color: #c5a06c;
}

.mobile-nav-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(197, 160, 108, 0.3);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.mobile-nav-footer a {
  color: #c5a06c;
  text-decoration: none;
  font-weight: 600;
}


/* ── MOBILE CARD & POLICY PAGE RESPONSIVENESS FIXES ── */
@media (max-width: 768px) {
  .contact-page-card,
  .policy-page-card {
    padding: 24px 18px !important;
    border-radius: 18px !important;
  }
  .contact-page-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .contact-page-box {
    padding: 16px !important;
    border-radius: 12px !important;
    word-break: break-word !important;
  }
  .contact-page-box a {
    word-break: break-all !important;
  }
}

/* ── TRACK ORDER / MY ORDERS RESPONSIVE FIXES ── */
@media (max-width: 640px) {
  .track-search-card,
  .track-order-card {
    padding: 20px 16px !important;
    border-radius: 16px !important;
  }
  .track-form-row {
    flex-direction: column !important;
    gap: 12px !important;
  }
  .track-form-row input {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .track-form-row button {
    width: 100% !important;
    height: 48px !important;
    justify-content: center !important;
  }
  .track-order-body {
    grid-template-columns: 1fr !important;
    padding: 20px 16px !important;
    gap: 24px !important;
  }
  .track-order-header {
    padding: 16px 18px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .track-order-header > div:last-child {
    text-align: left !important;
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }
}

/* ── CHECKOUT PAGE RESPONSIVE: SHOW ORDER SUMMARY AT THE TOP ── */
@media (max-width: 950px) {
  .checkout-grid {
    display: flex !important;
    flex-direction: column !important;
  }
  .checkout-summary,
  .checkout-grid .cart-summary {
    order: -1 !important; /* Forces Order Summary to display at the top above the form */
    margin-bottom: 24px !important;
    background: #ffffff !important;
    border-radius: 18px !important;
    box-shadow: 0 4px 20px rgba(74, 14, 23, 0.08) !important;
    border: 1px solid rgba(197, 160, 108, 0.3) !important;
  }
}

/* ── BRAND LOGO & FAVICON STYLING ── */
.brand-logo-img {
  height: 44px;
  width: 44px;
  object-fit: contain;
  border-radius: 50%;
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.logo {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  text-decoration: none !important;
}
.logo:hover .brand-logo-img {
  transform: scale(1.05);
}

/* ── TRACK ORDER & BUTTON RESPONSIVE (iPhone 11 & Small Screens) ── */
.track-search-box,
.track-search-card,
.track-order-card {
  box-sizing: border-box !important;
  max-width: 100% !important;
}

@media (max-width: 640px) {
  .logo {
    font-size: 15px !important;
    gap: 8px !important;
  }
  .brand-logo-img {
    height: 36px !important;
    width: 36px !important;
  }
  .track-search-box,
  .track-search-card,
  .track-order-card {
    padding: 20px 14px !important;
    border-radius: 16px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .track-form-row,
  .track-input-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .track-form-row input,
  .track-form-row .track-input,
  .track-input-row input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    flex: none !important;
    height: 48px !important;
  }
  .track-form-row button,
  .track-form-row .track-submit-btn,
  .track-input-row button {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    flex: none !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: normal !important;
  }
  .kf-modal-actions {
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }
  .kf-modal-actions .kf-action-btn {
    width: 100% !important;
    flex: none !important;
    box-sizing: border-box !important;
  }
}
