/* ========================================
   Mobile Responsive Design - Samsung AI Solution
   ======================================== */

/* CRITICAL: Prevent horizontal overflow */
html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

* {
  box-sizing: border-box;
}

/* Base Reset & Typography */
* {
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Prevent all elements from overflowing */
img, 
video, 
canvas, 
iframe, 
svg {
  max-width: 100%;
  height: auto;
}

/* Container max-width enforcement */
.container,
.max-w-7xl,
.max-w-6xl,
.max-w-5xl,
.max-w-4xl {
  max-width: 100% !important;
  width: 100% !important;
}

/* Touch-friendly Interactive Elements */
button, 
a, 
input[type="submit"],
input[type="button"],
.btn,
.card {
  min-height: 44px;
  min-width: 44px;
}

/* Mobile Header Optimization */
@media (max-width: 768px) {
  /* Header Top Bar */
  .header-top {
    height: 60px !important;
    padding: 8px 0 !important;
    width: 100% !important;
  }
  
  .header-top .max-w-7xl {
    padding-left: 16px !important;
    padding-right: 16px !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  
  /* Logo Size */
  .header-top img[alt*="삼성"] {
    height: 32px !important;
    max-width: 150px !important;
  }
  
  /* Hide desktop search bar on mobile */
  .header-top .hidden.md\\:flex {
    display: none !important;
  }
  
  /* Mobile Menu Button */
  #mobile-menu-button {
    padding: 8px !important;
  }
  
  /* Navigation Menu */
  .header-bottom {
    display: none !important;
  }
}

/* Mobile Menu Overlay */
#mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: none;
  backdrop-filter: blur(2px);
}

#mobile-menu-overlay.active {
  display: block;
}

/* Mobile Menu Panel */
#mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 320px;
  height: 100vh;
  background: white;
  z-index: 9999;
  transition: right 0.3s ease-in-out;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

#mobile-menu.active {
  right: 0;
}

/* Mobile Search Bar */
@media (max-width: 768px) {
  #mobile-search-container {
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
  }
  
  #mobile-search-input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    font-size: 14px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
  }
}

/* Product Grid Responsive - IMPROVED */
@media (max-width: 640px) {
  /* Single column on small mobile */
  .grid-cols-2.md\\:grid-cols-4,
  .grid.grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
  }
  
  /* Product cards */
  .product-card {
    margin-bottom: 16px;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Product card text sizing */
  .product-card h3 {
    font-size: 16px !important;
    line-height: 1.4 !important;
  }
  
  .product-card .text-sm {
    font-size: 13px !important;
  }
  
  .product-card .price,
  .product-card .text-2xl {
    font-size: 18px !important;
  }
  
  /* Product card padding */
  .product-card .p-4 {
    padding: 12px !important;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  /* 2 columns on tablet */
  .grid-cols-2.md\\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Slider/Banner Mobile Optimization - IMPROVED */
@media (max-width: 768px) {
  /* Banner height on mobile */
  #banner-slider,
  .swiper-slide,
  .banner-image {
    height: 256px !important; /* h-64 equivalent */
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  /* Banner background - prevent text cutoff */
  #banner-slider .min-w-full {
    background-size: cover !important;
    background-position: center center !important;
    width: 100% !important;
  }
  
  /* Darker overlay for better text readability */
  #banner-slider .bg-black {
    background-color: rgba(0, 0, 0, 0.5) !important;
  }
  
  /* Banner text sizing */
  #banner-slider h2,
  .banner-content h2 {
    font-size: 24px !important;
    line-height: 1.3 !important;
    margin-bottom: 12px !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  }
  
  #banner-slider p,
  .banner-content p {
    font-size: 14px !important;
    line-height: 1.5 !important;
    margin-bottom: 24px !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  }
  
  /* Banner button */
  #banner-slider a,
  .banner-button {
    padding: 12px 24px !important;
    font-size: 14px !important;
    min-width: 140px !important;
  }
  
  /* Banner indicators - larger on mobile */
  #banner-indicators button {
    height: 10px !important;
    min-height: 10px !important;
  }
  
  #banner-indicators button.active,
  #banner-indicators button:first-child {
    width: 24px !important;
  }
}

/* Mobile Typography - ENHANCED */
@media (max-width: 768px) {
  h1 {
    font-size: 24px !important;
    line-height: 1.3 !important;
  }
  
  h2 {
    font-size: 20px !important;
    line-height: 1.4 !important;
  }
  
  h3 {
    font-size: 18px !important;
    line-height: 1.4 !important;
  }
  
  p, body {
    font-size: 14px !important;
    line-height: 1.6 !important;
  }
  
  .text-sm {
    font-size: 12px !important;
  }
  
  .text-xs {
    font-size: 11px !important;
  }
  
  .text-lg {
    font-size: 16px !important;
  }
  
  .text-xl {
    font-size: 18px !important;
  }
  
  .text-2xl {
    font-size: 20px !important;
  }
  
  .text-3xl {
    font-size: 24px !important;
  }
  
  .text-4xl {
    font-size: 28px !important;
  }
}

/* Mobile Spacing - ENHANCED */
@media (max-width: 768px) {
  .container,
  .max-w-7xl {
    padding-left: 16px !important;
    padding-right: 16px !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  
  section {
    padding-top: 24px !important;
    padding-bottom: 24px !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  
  .py-12 {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
  }
  
  .gap-4 {
    gap: 12px !important;
  }
  
  .gap-6 {
    gap: 16px !important;
  }
  
  .gap-8 {
    gap: 24px !important;
  }
  
  .mb-8 {
    margin-bottom: 24px !important;
  }
  
  .mb-4 {
    margin-bottom: 12px !important;
  }
}

/* Section Titles on Mobile */
@media (max-width: 768px) {
  section h2.text-3xl {
    font-size: 22px !important;
    margin-bottom: 20px !important;
  }
  
  section h2.text-2xl {
    font-size: 20px !important;
  }
}

/* CRITICAL: Quick Lead Bar Mobile Fix */
@media (max-width: 768px) {
  .quick-lead-bar {
    width: 100% !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    padding: 16px !important;
    box-sizing: border-box !important;
  }
  
  .quick-lead-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }
  
  .quick-lead-form {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .quick-lead-input,
  .quick-lead-submit {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Admin Page Mobile Responsive */
@media (max-width: 1024px) {
  /* Hide desktop sidebar on mobile */
  .admin-sidebar {
    display: none !important;
  }
  
  /* Full width content on mobile */
  .admin-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  
  /* Mobile admin navigation */
  #mobile-admin-nav {
    display: block !important;
  }
  
  /* Admin tables horizontal scroll */
  .admin-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  .admin-table {
    min-width: 800px;
  }
  
  /* Admin cards stack on mobile */
  .admin-grid {
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }
  
  /* Admin forms full width */
  .admin-form input,
  .admin-form select,
  .admin-form textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Modal Mobile Optimization */
@media (max-width: 768px) {
  .modal {
    width: 95% !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    overflow-y: auto;
    left: 2.5% !important;
    right: 2.5% !important;
  }
  
  .modal-content {
    padding: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .modal-header {
    padding: 12px 16px !important;
  }
  
  .modal-footer {
    padding: 12px 16px !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  .modal-footer button {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Form Elements Mobile */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important; /* Prevent zoom on iOS */
    padding: 12px !important;
    height: auto !important;
    min-height: 44px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  label {
    font-size: 14px !important;
    margin-bottom: 6px !important;
  }
  
  form {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Buttons Mobile */
@media (max-width: 768px) {
  button,
  .btn {
    font-size: 14px !important;
    padding: 12px 20px !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
  }
  
  .btn-sm {
    font-size: 12px !important;
    padding: 8px 16px !important;
    min-height: 36px !important;
  }
  
  .btn-lg {
    font-size: 16px !important;
    padding: 14px 24px !important;
    min-height: 48px !important;
  }
}

/* Cart & Checkout Mobile */
@media (max-width: 768px) {
  .cart-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100% !important;
  }
  
  .cart-item-image {
    width: 100% !important;
    height: 180px !important;
  }
  
  .cart-item-details {
    width: 100% !important;
    margin-top: 12px !important;
  }
  
  .cart-summary {
    position: relative !important;
    margin-top: 24px !important;
    width: 100% !important;
  }
}

/* Floating Banner Mobile - IMPROVED */
@media (max-width: 768px) {
  #floating-banner {
    width: calc(100% - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    left: 16px !important;
    right: 16px !important;
    bottom: 16px !important;
    padding: 14px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }
  
  #floating-banner .phone-text {
    font-size: 16px !important;
    font-weight: 600 !important;
  }
  
  #floating-banner button {
    padding: 12px 18px !important;
    font-size: 14px !important;
    min-height: 44px !important;
  }
}

/* Analytics Dashboard Mobile */
@media (max-width: 1024px) {
  .analytics-tab-content {
    padding: 16px !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  
  .analytics-tab-content .grid {
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }
  
  .analytics-card {
    margin-bottom: 16px !important;
    width: 100% !important;
  }
  
  .chart-container {
    height: 300px !important;
    width: 100% !important;
  }
}

/* Table Responsive */
@media (max-width: 768px) {
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  table {
    min-width: 600px;
  }
  
  th, td {
    padding: 8px 12px !important;
    font-size: 13px !important;
  }
}

/* Footer Mobile */
@media (max-width: 768px) {
  footer {
    padding: 24px 16px !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  
  footer .grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    width: 100% !important;
  }
  
  footer h3 {
    font-size: 16px !important;
  }
  
  footer p,
  footer a {
    font-size: 13px !important;
  }
}

/* Category Pills Mobile */
@media (max-width: 768px) {
  .category-pills {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    scrollbar-width: none;
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  .category-pills::-webkit-scrollbar {
    display: none;
  }
  
  .category-pill {
    display: inline-block;
    padding: 8px 16px !important;
    font-size: 13px !important;
  }
}

/* Loading States Mobile */
@media (max-width: 768px) {
  .loading-spinner {
    width: 32px !important;
    height: 32px !important;
  }
  
  .skeleton {
    height: 180px !important;
    width: 100% !important;
  }
}

/* Image Optimization */
@media (max-width: 768px) {
  img {
    height: auto !important;
    max-width: 100% !important;
  }
  
  .aspect-ratio-16-9 {
    aspect-ratio: 16 / 9;
  }
  
  .aspect-ratio-4-3 {
    aspect-ratio: 4 / 3;
  }
  
  .aspect-ratio-1-1 {
    aspect-ratio: 1 / 1;
  }
  
  .aspect-square {
    aspect-ratio: 1 / 1;
  }
}

/* Installation Cases - Mobile Optimization */
@media (max-width: 768px) {
  .installation-case-card {
    margin-bottom: 16px;
    width: 100% !important;
  }
  
  .installation-case-card img {
    height: 200px !important;
    width: 100% !important;
  }
  
  .installation-case-card h3 {
    font-size: 16px !important;
  }
  
  .installation-case-card p {
    font-size: 13px !important;
  }
}

/* Industry Showcase - Mobile */
@media (max-width: 768px) {
  .industry-card {
    padding: 16px !important;
    width: 100% !important;
  }
  
  .industry-card h3 {
    font-size: 16px !important;
  }
  
  .industry-icon {
    font-size: 32px !important;
  }
}

/* Accessibility & Touch */
@media (max-width: 768px) {
  /* Increase touch targets */
  a, button, input, select {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
  
  /* Smooth scrolling */
  html {
    scroll-behavior: smooth;
  }
  
  /* Prevent text inflation */
  html {
    -webkit-text-size-adjust: 100%;
  }
  
  /* Better tap highlighting */
  a:active, button:active {
    opacity: 0.7;
  }
}

/* Landscape Mobile Optimization */
@media (max-width: 896px) and (orientation: landscape) {
  .header-top {
    height: 50px !important;
  }
  
  .modal {
    max-height: 85vh !important;
  }
  
  section {
    padding-top: 16px !important;
    padding-bottom: 16px !important;
  }
  
  #banner-slider {
    height: 200px !important;
  }
}

/* iPad & Tablet Optimization */
@media (min-width: 768px) and (max-width: 1024px) {
  .container {
    max-width: 720px !important;
  }
  
  .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  
  .grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  
  .grid-cols-2.md\\:grid-cols-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Small Mobile (<375px) Extra Optimization */
@media (max-width: 374px) {
  .header-top {
    height: 56px !important;
  }
  
  .header-top img[alt*="삼성"] {
    height: 28px !important;
  }
  
  #banner-slider h2 {
    font-size: 20px !important;
  }
  
  #banner-slider p {
    font-size: 13px !important;
  }
  
  button, .btn {
    font-size: 13px !important;
    padding: 10px 16px !important;
  }
  
  .container,
  section,
  .quick-lead-bar,
  footer {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}


/* Touch-friendly Interactive Elements */
button, 
a, 
input[type="submit"],
input[type="button"],
.btn,
.card {
  min-height: 44px;
  min-width: 44px;
}

/* Mobile Header Optimization */
@media (max-width: 768px) {
  /* Header Top Bar */
  .header-top {
    height: 60px !important;
    padding: 8px 0 !important;
  }
  
  .header-top .max-w-7xl {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  
  /* Logo Size */
  .header-top img[alt*="삼성"] {
    height: 32px !important;
  }
  
  /* Hide desktop search bar on mobile */
  .header-top .hidden.md\\:flex {
    display: none !important;
  }
  
  /* Mobile Menu Button */
  #mobile-menu-button {
    padding: 8px !important;
  }
  
  /* Navigation Menu */
  .header-bottom {
    display: none !important;
  }
}

/* Mobile Menu Overlay */
#mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: none;
  backdrop-filter: blur(2px);
}

#mobile-menu-overlay.active {
  display: block;
}

/* Mobile Menu Panel */
#mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 320px;
  height: 100vh;
  background: white;
  z-index: 9999;
  transition: right 0.3s ease-in-out;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

#mobile-menu.active {
  right: 0;
}

/* Mobile Search Bar */
@media (max-width: 768px) {
  #mobile-search-container {
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
  }
  
  #mobile-search-input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    font-size: 14px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
  }
}

/* Product Grid Responsive - IMPROVED */
@media (max-width: 640px) {
  /* Single column on small mobile */
  .grid-cols-2.md\\:grid-cols-4,
  .grid.grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }
  
  /* Product cards */
  .product-card {
    margin-bottom: 16px;
  }
  
  /* Product card text sizing */
  .product-card h3 {
    font-size: 16px !important;
    line-height: 1.4 !important;
  }
  
  .product-card .text-sm {
    font-size: 13px !important;
  }
  
  .product-card .price,
  .product-card .text-2xl {
    font-size: 18px !important;
  }
  
  /* Product card padding */
  .product-card .p-4 {
    padding: 12px !important;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  /* 2 columns on tablet */
  .grid-cols-2.md\\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Slider/Banner Mobile Optimization - IMPROVED */
@media (max-width: 768px) {
  /* Banner height on mobile */
  #banner-slider,
  .swiper-slide,
  .banner-image {
    height: 256px !important; /* h-64 equivalent */
  }
  
  /* Banner background - prevent text cutoff */
  #banner-slider .min-w-full {
    background-size: cover !important;
    background-position: center center !important;
  }
  
  /* Darker overlay for better text readability */
  #banner-slider .bg-black {
    background-color: rgba(0, 0, 0, 0.5) !important;
  }
  
  /* Banner text sizing */
  #banner-slider h2,
  .banner-content h2 {
    font-size: 24px !important;
    line-height: 1.3 !important;
    margin-bottom: 12px !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  }
  
  #banner-slider p,
  .banner-content p {
    font-size: 14px !important;
    line-height: 1.5 !important;
    margin-bottom: 24px !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  }
  
  /* Banner button */
  #banner-slider a,
  .banner-button {
    padding: 12px 24px !important;
    font-size: 14px !important;
    min-width: 140px !important;
  }
  
  /* Banner indicators - larger on mobile */
  #banner-indicators button {
    height: 10px !important;
    min-height: 10px !important;
  }
  
  #banner-indicators button.active,
  #banner-indicators button:first-child {
    width: 24px !important;
  }
}

/* Mobile Typography - ENHANCED */
@media (max-width: 768px) {
  h1 {
    font-size: 24px !important;
    line-height: 1.3 !important;
  }
  
  h2 {
    font-size: 20px !important;
    line-height: 1.4 !important;
  }
  
  h3 {
    font-size: 18px !important;
    line-height: 1.4 !important;
  }
  
  p, body {
    font-size: 14px !important;
    line-height: 1.6 !important;
  }
  
  .text-sm {
    font-size: 12px !important;
  }
  
  .text-xs {
    font-size: 11px !important;
  }
  
  .text-lg {
    font-size: 16px !important;
  }
  
  .text-xl {
    font-size: 18px !important;
  }
  
  .text-2xl {
    font-size: 20px !important;
  }
  
  .text-3xl {
    font-size: 24px !important;
  }
  
  .text-4xl {
    font-size: 28px !important;
  }
}

/* Mobile Spacing - ENHANCED */
@media (max-width: 768px) {
  .container,
  .max-w-7xl {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  
  section {
    padding-top: 24px !important;
    padding-bottom: 24px !important;
  }
  
  .py-12 {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
  }
  
  .gap-4 {
    gap: 12px !important;
  }
  
  .gap-6 {
    gap: 16px !important;
  }
  
  .gap-8 {
    gap: 24px !important;
  }
  
  .mb-8 {
    margin-bottom: 24px !important;
  }
  
  .mb-4 {
    margin-bottom: 12px !important;
  }
}

/* Section Titles on Mobile */
@media (max-width: 768px) {
  section h2.text-3xl {
    font-size: 22px !important;
    margin-bottom: 20px !important;
  }
  
  section h2.text-2xl {
    font-size: 20px !important;
  }
}

/* Admin Page Mobile Responsive */
@media (max-width: 1024px) {
  /* Hide desktop sidebar on mobile */
  .admin-sidebar {
    display: none !important;
  }
  
  /* Full width content on mobile */
  .admin-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
  
  /* Mobile admin navigation */
  #mobile-admin-nav {
    display: block !important;
  }
  
  /* Admin tables horizontal scroll */
  .admin-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .admin-table {
    min-width: 800px;
  }
  
  /* Admin cards stack on mobile */
  .admin-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Admin forms full width */
  .admin-form input,
  .admin-form select,
  .admin-form textarea {
    width: 100% !important;
  }
}

/* Modal Mobile Optimization */
@media (max-width: 768px) {
  .modal {
    width: 95% !important;
    max-width: 95% !important;
    max-height: 90vh !important;
    overflow-y: auto;
  }
  
  .modal-content {
    padding: 16px !important;
  }
  
  .modal-header {
    padding: 12px 16px !important;
  }
  
  .modal-footer {
    padding: 12px 16px !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  .modal-footer button {
    width: 100% !important;
  }
}

/* Form Elements Mobile */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important; /* Prevent zoom on iOS */
    padding: 12px !important;
    height: auto !important;
    min-height: 44px !important;
  }
  
  label {
    font-size: 14px !important;
    margin-bottom: 6px !important;
  }
}

/* Buttons Mobile */
@media (max-width: 768px) {
  button,
  .btn {
    font-size: 14px !important;
    padding: 12px 20px !important;
    min-height: 44px !important;
  }
  
  .btn-sm {
    font-size: 12px !important;
    padding: 8px 16px !important;
    min-height: 36px !important;
  }
  
  .btn-lg {
    font-size: 16px !important;
    padding: 14px 24px !important;
    min-height: 48px !important;
  }
}

/* Cart & Checkout Mobile */
@media (max-width: 768px) {
  .cart-item {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  
  .cart-item-image {
    width: 100% !important;
    height: 180px !important;
  }
  
  .cart-item-details {
    width: 100% !important;
    margin-top: 12px !important;
  }
  
  .cart-summary {
    position: relative !important;
    margin-top: 24px !important;
  }
}

/* Floating Banner Mobile - IMPROVED */
@media (max-width: 768px) {
  #floating-banner {
    width: calc(100% - 32px) !important;
    left: 16px !important;
    right: 16px !important;
    bottom: 16px !important;
    padding: 14px !important;
    border-radius: 12px !important;
  }
  
  #floating-banner .phone-text {
    font-size: 16px !important;
    font-weight: 600 !important;
  }
  
  #floating-banner button {
    padding: 12px 18px !important;
    font-size: 14px !important;
    min-height: 44px !important;
  }
}

/* Analytics Dashboard Mobile */
@media (max-width: 1024px) {
  .analytics-tab-content {
    padding: 16px !important;
  }
  
  .analytics-tab-content .grid {
    grid-template-columns: 1fr !important;
  }
  
  .analytics-card {
    margin-bottom: 16px !important;
  }
  
  .chart-container {
    height: 300px !important;
  }
}

/* Table Responsive */
@media (max-width: 768px) {
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  table {
    min-width: 600px;
  }
  
  th, td {
    padding: 8px 12px !important;
    font-size: 13px !important;
  }
}

/* Footer Mobile */
@media (max-width: 768px) {
  footer {
    padding: 24px 16px !important;
  }
  
  footer .grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  
  footer h3 {
    font-size: 16px !important;
  }
  
  footer p,
  footer a {
    font-size: 13px !important;
  }
}

/* Category Pills Mobile */
@media (max-width: 768px) {
  .category-pills {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    scrollbar-width: none;
  }
  
  .category-pills::-webkit-scrollbar {
    display: none;
  }
  
  .category-pill {
    display: inline-block;
    padding: 8px 16px !important;
    font-size: 13px !important;
  }
}

/* Loading States Mobile */
@media (max-width: 768px) {
  .loading-spinner {
    width: 32px !important;
    height: 32px !important;
  }
  
  .skeleton {
    height: 180px !important;
  }
}

/* Image Optimization */
@media (max-width: 768px) {
  img {
    height: auto !important;
    max-width: 100% !important;
  }
  
  .aspect-ratio-16-9 {
    aspect-ratio: 16 / 9;
  }
  
  .aspect-ratio-4-3 {
    aspect-ratio: 4 / 3;
  }
  
  .aspect-ratio-1-1 {
    aspect-ratio: 1 / 1;
  }
  
  .aspect-square {
    aspect-ratio: 1 / 1;
  }
}

/* Installation Cases - Mobile Optimization */
@media (max-width: 768px) {
  .installation-case-card {
    margin-bottom: 16px;
  }
  
  .installation-case-card img {
    height: 200px !important;
  }
  
  .installation-case-card h3 {
    font-size: 16px !important;
  }
  
  .installation-case-card p {
    font-size: 13px !important;
  }
}

/* Industry Showcase - Mobile */
@media (max-width: 768px) {
  .industry-card {
    padding: 16px !important;
  }
  
  .industry-card h3 {
    font-size: 16px !important;
  }
  
  .industry-icon {
    font-size: 32px !important;
  }
}

/* Accessibility & Touch */
@media (max-width: 768px) {
  /* Increase touch targets */
  a, button, input, select {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }
  
  /* Smooth scrolling */
  html {
    scroll-behavior: smooth;
  }
  
  /* Prevent text inflation */
  html {
    -webkit-text-size-adjust: 100%;
  }
  
  /* Better tap highlighting */
  a:active, button:active {
    opacity: 0.7;
  }
}

/* Landscape Mobile Optimization */
@media (max-width: 896px) and (orientation: landscape) {
  .header-top {
    height: 50px !important;
  }
  
  .modal {
    max-height: 85vh !important;
  }
  
  section {
    padding-top: 16px !important;
    padding-bottom: 16px !important;
  }
  
  #banner-slider {
    height: 200px !important;
  }
}

/* iPad & Tablet Optimization */
@media (min-width: 768px) and (max-width: 1024px) {
  .container {
    max-width: 720px !important;
  }
  
  .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  
  .grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  
  .grid-cols-2.md\\:grid-cols-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Small Mobile (<375px) Extra Optimization */
@media (max-width: 374px) {
  .header-top {
    height: 56px !important;
  }
  
  .header-top img[alt*="삼성"] {
    height: 28px !important;
  }
  
  #banner-slider h2 {
    font-size: 20px !important;
  }
  
  #banner-slider p {
    font-size: 13px !important;
  }
  
  button, .btn {
    font-size: 13px !important;
    padding: 10px 16px !important;
  }
}


/* ==========================================
   MOBILE TOUCH & INTERACTION ENHANCEMENTS
   ========================================== */

/* Remove tap highlight color globally */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Touch-friendly button and link spacing */
@media (max-width: 768px) {
  /* Add touch feedback */
  a:active:not(.no-touch), 
  button:active:not(.no-touch), 
  [onclick]:active:not(.no-touch) {
    opacity: 0.7;
    transform: scale(0.98);
    transition: all 0.1s ease-in-out;
  }
  
  /* Increase horizontal scrollable area indicator */
  .overflow-x-auto::-webkit-scrollbar,
  .scroll-container::-webkit-scrollbar {
    height: 8px;
  }
  
  .overflow-x-auto::-webkit-scrollbar-thumb,
  .scroll-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
  }
  
  /* Modal close buttons - extra large on mobile */
  .modal .close, .modal-close, [aria-label="Close"] {
    min-width: 48px !important;
    min-height: 48px !important;
    font-size: 28px !important;
  }
}

/* ==========================================
   MOBILE INSTALLATION CASES ENHANCEMENT
   ========================================== */

@media (max-width: 768px) {
  .installation-case-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    transition: all 0.15s;
  }
}

/* ==========================================
   MOBILE LOADING STATES
   ========================================== */

@media (max-width: 768px) {
  .loading-skeleton {
    background: linear-gradient(
      90deg,
      #f3f4f6 0%,
      #e5e7eb 50%,
      #f3f4f6 100%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 8px;
  }
  
  @keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }
  
  .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
}

/* ==========================================
   MOBILE SMOOTH SCROLLING
   ========================================== */

@media (max-width: 768px) {
  html {
    scroll-behavior: smooth;
  }
  
  /* Improve momentum scrolling on iOS */
  body, .scroll-container, .overflow-y-auto {
    -webkit-overflow-scrolling: touch;
  }
}

/* ==========================================
   END OF MOBILE RESPONSIVE CSS
   ========================================== */
