/* ============================================
   MYEDEN - MOBILE-FIRST RESPONSIVE STYLES
   ============================================ */

/* ============================================
   1. CSS VARIABLES FOR RESPONSIVE DESIGN
   ============================================ */
:root {
  /* Mobile-first spacing scale */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  /* Responsive font sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  
  /* Touch targets */
  --touch-min: 44px;
  --touch-comfortable: 48px;
}

@media (min-width: 768px) {
  :root {
    --space-md: 20px;
    --space-lg: 28px;
    --space-xl: 40px;
  }
}

@media (min-width: 992px) {
  :root {
    --space-lg: 32px;
    --space-xl: 48px;
  }
}

/* ============================================
   2. MOBILE NAVIGATION
   ============================================ */
.menu-toggle {
  display: flex;
  width: var(--touch-comfortable);
  height: var(--touch-comfortable);
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100;
}

.menu-toggle:hover {
  background: var(--accent);
  color: #000;
}

@media (min-width: 992px) {
  .menu-toggle {
    display: none;
  }
}

@media (max-width: 991px) {
  /* Mobile menu container */
  .nav-links,
  .nav-actions {
    position: fixed;
    left: 0;
    right: 0;
    background: rgba(3, 3, 3, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 20px;
    gap: 0;
    transform: translateY(-150%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
    border-bottom: 1px solid var(--border);
  }
  
  .nav-links {
    top: 80px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .nav-actions {
    top: auto;
    bottom: 0;
    border-top: 1px solid var(--border);
    border-bottom: none;
    padding: 16px 20px;
    gap: 12px;
    max-height: 120px;
  }
  
  .nav-links.is-open,
  .nav-links.is-open ~ .nav-actions,
  .nav-links.is-open + .nav-actions {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  /* Also target when siteNavActions is sibling */
  .site-header:has(.nav-links.is-open) .nav-actions {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-links a {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 1rem;
    width: 100%;
    text-align: center;
    min-height: var(--touch-comfortable);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .nav-links a:last-child {
    border-bottom: none;
  }
  
  .nav-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .user-chip {
    text-align: center;
    justify-content: center;
    width: 100%;
    min-height: var(--touch-comfortable);
  }
  
  .logout-form {
    width: 100%;
  }
  
  .logout-form .btn {
    width: 100%;
    justify-content: center;
    min-height: var(--touch-comfortable);
  }
  
  /* Adjust header height for mobile */
  .nav-wrap {
    height: 70px;
  }
  
  .brand-logo {
    height: 40px;
  }
}

@media (min-width: 992px) {
  .nav-links {
    display: flex !important;
    flex-direction: row;
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    background: transparent;
    padding: 0;
    gap: 40px;
    max-height: none;
    overflow-y: visible;
  }
  
  .nav-links a {
    width: auto;
    text-align: left;
    border-bottom: none;
    padding: 10px 0;
  }
  
  .nav-actions {
    flex-direction: row;
    width: auto;
    padding-top: 0;
    border-top: none;
  }
  
  .nav-wrap {
    height: 80px;
  }
}

/* ============================================
   3. HERO SECTION RESPONSIVE
   ============================================ */
.hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding-top: 20px;
  padding-bottom: var(--space-xl);
  min-height: auto;
}

.hero-box {
  padding: var(--space-md);
  order: 2;
  border-radius: var(--radius-sm);
}

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  margin-bottom: var(--space-md);
  line-height: 1.2;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hero-lead {
  font-size: var(--text-base);
  margin-bottom: var(--space-lg);
  max-width: 100%;
  line-height: 1.6;
}

.hero-visual {
  height: 300px;
  order: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.hero-showcase {
  position: relative;
  bottom: auto;
  left: auto;
  margin-top: var(--space-md);
  right: auto;
  padding: var(--space-md);
}

.showcase-stats-row {
  flex-direction: column;
  gap: var(--space-sm);
}

.showcase-list {
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

.hero-actions {
  flex-direction: column;
  gap: var(--space-sm);
}

.hero-actions .btn {
  width: 100%;
  justify-content: center;
  min-height: var(--touch-comfortable);
  padding: 16px 24px;
}

.showcase-panel {
  padding: var(--space-md);
  border-radius: var(--radius-sm);
}

@media (min-width: 576px) {
  .hero-visual {
    height: 400px;
  }
  
  .hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
  }
}

@media (min-width: 768px) {
  .hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  
  .hero-visual {
    height: 500px;
  }
  
  .hero-box {
    order: 1;
    padding: var(--space-lg);
  }
  
  .hero-visual {
    order: 2;
  }
  
  .hero-actions {
    flex-direction: row;
  }
  
  .hero-actions .btn {
    width: auto;
  }
  
  .showcase-stats-row {
    flex-direction: row;
  }
  
  .showcase-panel {
    padding: var(--space-lg);
  }
}

@media (min-width: 992px) {
  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    padding-top: 40px;
  }
  
  .hero-box {
    order: 1;
  }
  
  .hero-visual {
    order: 2;
    height: 600px;
  }
  
  .hero-showcase {
    position: absolute;
    bottom: 24px;
    left: 24px;
    right: 24px;
    margin-top: 0;
  }
  
  .hero h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
  }
}

@media (min-width: 1200px) {
  .hero-visual {
    height: 700px;
  }
}

/* ============================================
   4. GRID SYSTEMS RESPONSIVE
   ============================================ */
.grid,
.grid-2,
.grid-3,
.grid-4,
.summaries-grid,
.analytics-kpis {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

.summaries-grid {
  gap: var(--space-md);
}

@media (min-width: 576px) {
  .summaries-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .analytics-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .analytics-kpis {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 992px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .summaries-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .summaries-grid {
    gap: var(--space-lg);
  }
}

/* Analytics split grid */
.analytics-split {
  grid-template-columns: 1fr;
}

@media (min-width: 992px) {
  .analytics-split {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================
   5. CARDS RESPONSIVE
   ============================================ */
.card,
.hero-box,
.panel,
.showcase-panel {
  padding: var(--space-md);
  border-radius: var(--radius-sm);
}

.summary-card {
  display: flex;
  flex-direction: column;
}

.summary-card .summary-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
}

.summary-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.summary-card p {
  font-size: var(--text-sm);
  margin-bottom: var(--space-xs);
}

.summary-card .form-actions {
  margin-top: auto;
  flex-direction: column;
  gap: var(--space-sm);
}

.summary-card .form-actions .btn {
  width: 100%;
  justify-content: center;
  padding: 12px 20px;
  font-size: var(--text-sm);
}

/* Feature tiles */
.feature-tile {
  padding: var(--space-lg);
}

.feature-tile .tile-icon {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.feature-tile h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
}

.feature-tile p {
  font-size: var(--text-sm);
}

/* Action cards */
.action-card {
  padding: var(--space-md);
}

.action-card .action-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.action-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-xs);
}

.action-card p {
  font-size: var(--text-sm);
}

/* KPI Cards */
.kpi {
  flex-direction: row;
  gap: var(--space-md);
  padding: var(--space-md) !important;
  align-items: center;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.kpi strong {
  font-size: 1.5rem !important;
  line-height: 1.1;
}

.kpi.kpi-progress .kpi-data strong {
  font-size: 1.3rem !important;
}

.kpi-data p {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Dashboard table panel */
.table-panel {
  margin: 0 calc(-1 * var(--space-md));
  padding: 0 var(--space-md);
  width: calc(100% + 2 * var(--space-md));
  border-radius: var(--radius-sm);
}

/* Action cards */
.action-card {
  padding: var(--space-md);
  text-align: center;
}

.action-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-xs);
}

.action-card p {
  font-size: var(--text-sm);
}

@media (min-width: 768px) {
  .kpi {
    flex-direction: column;
    gap: var(--space-sm);
    align-items: flex-start;
  }
  
  .kpi-icon {
    width: 56px;
    height: 56px;
  }
  
  .kpi strong {
    font-size: 2rem !important;
  }
}

@media (min-width: 992px) {
  .kpi {
    flex-direction: row;
    gap: var(--space-md);
    padding: var(--space-lg) !important;
    align-items: center;
  }
  
  .kpi-icon {
    width: 64px;
    height: 64px;
    font-size: 1.75rem;
  }
  
  .kpi strong {
    font-size: 2.5rem !important;
  }
}

/* Contact cards */
.contact-grid {
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .contact-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   6. FORMS RESPONSIVE
   ============================================ */
.form-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

.form-grid .span-full {
  grid-column: 1 / -1;
}

/* Filter grid specific */
.filter-grid {
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.filter-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.filter-actions .btn {
  width: 100%;
  justify-content: center;
  min-height: var(--touch-comfortable);
}

/* Form inputs */
.input,
select,
textarea {
  padding: 12px 14px;
  font-size: var(--text-base);
  min-height: var(--touch-comfortable);
  border-radius: 10px;
}

/* Product form cards */
.product-form-card {
  padding: var(--space-md);
  border-radius: var(--radius-sm);
}

.product-form-head {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
}

.product-form-head h4 {
  font-size: var(--text-lg);
}

.remove-product-btn {
  align-self: flex-end;
  min-height: var(--touch-min);
  padding: 8px 16px;
}

@media (min-width: 576px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .filter-actions {
    flex-direction: row;
    grid-column: 1 / -1;
    flex-wrap: wrap;
  }
  
  .filter-actions .btn {
    width: auto;
    flex: 1;
  }
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
  
  .filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .filter-actions .btn {
    flex: 0 0 auto;
  }
}

@media (min-width: 992px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .filter-grid {
    grid-template-columns: repeat(4, 1fr);
    align-items: end;
  }
  
  .filter-actions {
    grid-column: auto;
  }
}

/* Product forms specific */
.product-forms-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.product-form-item {
  padding: var(--space-md);
}

@media (min-width: 768px) {
  .product-form-item {
    padding: var(--space-lg);
  }
}

/* Sticky actions for mobile */
.sticky-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(3, 3, 3, 0.98);
  backdrop-filter: blur(10px);
  padding: var(--space-md);
  border-top: 1px solid var(--border);
  z-index: 90;
  margin: 0;
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: var(--space-sm);
}

.sticky-actions .btn {
  flex: 1;
  max-width: 200px;
}

/* Add padding to body to account for sticky bar */
body:has(.sticky-actions) {
  padding-bottom: 80px;
}

@media (min-width: 992px) {
  .sticky-actions {
    position: static;
    background: transparent;
    backdrop-filter: none;
    border-top: none;
    padding: var(--space-lg) 0;
    justify-content: flex-start;
    margin: inherit;
  }
  
  .sticky-actions .btn {
    flex: 0 0 auto;
    max-width: none;
  }
  
  body:has(.sticky-actions) {
    padding-bottom: 0;
  }
}

/* ============================================
   7. TABLES RESPONSIVE
   ============================================ */
.table-panel {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(-1 * var(--space-md));
  padding: 0 var(--space-md);
  width: calc(100% + 2 * var(--space-md));
}

.list-table {
  min-width: 600px;
  font-size: var(--text-sm);
}

.list-table th,
.list-table td {
  padding: 12px 16px;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .list-table {
    min-width: 100%;
    display: block;
  }
  
  .list-table thead {
    display: none;
  }
  
  .list-table tbody,
  .list-table tr {
    display: block;
    width: 100%;
  }
  
  .list-table tr {
    margin-bottom: var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    background: var(--card);
  }
  
  .list-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    white-space: normal;
  }
  
  .list-table td:last-child {
    border-bottom: none;
  }
  
  .list-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--accent);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: var(--space-md);
    flex-shrink: 0;
    min-width: 100px;
  }
  
  .list-table .btn {
    padding: 8px 16px;
    font-size: var(--text-xs);
  }
}

@media (min-width: 768px) {
  .table-panel {
    overflow-x: visible;
    margin: 0;
    padding: 0;
    width: 100%;
  }
  
  .list-table {
    min-width: 100%;
    font-size: var(--text-base);
  }
  
  .list-table th,
  .list-table td {
    padding: 16px 20px;
  }
}

/* ============================================
   8. PREVIEW PAGES RESPONSIVE
   ============================================ */
.preview-slip {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.preview-slip-summary,
.preview-slip-product {
  flex-direction: column;
}

.preview-meta,
.preview-details {
  width: 100%;
}

.preview-meta h3,
.preview-details h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-md);
}

.meta-row,
.detail-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: var(--space-sm) 0;
}

.meta-row strong,
.detail-row strong {
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta-row span,
.detail-row span {
  font-size: var(--text-base);
}

.preview-meta img.summary-image {
  width: 100%;
  max-width: 200px;
  height: auto;
  margin: 0 auto var(--space-md);
  display: block;
}

.preview-head-meta {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
}

.preview-doc-id {
  font-size: var(--text-xs);
}

/* Product gallery */
.product-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.gallery-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

@media (min-width: 576px) {
  .product-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .gallery-item img {
    height: 180px;
  }
}

@media (min-width: 768px) {
  .preview-slip {
    flex-direction: row;
    gap: var(--space-xl);
  }
  
  .preview-slip-summary,
  .preview-slip-product {
    flex-direction: row;
  }
  
  .preview-meta {
    width: 35%;
    flex-shrink: 0;
  }
  
  .preview-details {
    flex: 1;
  }
  
  .meta-row,
  .detail-row {
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
  }
  
  .meta-row strong,
  .detail-row strong {
    width: 140px;
    flex-shrink: 0;
    font-size: var(--text-sm);
  }
  
  .preview-head-meta {
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
  }
}

@media (min-width: 992px) {
  .preview-meta {
    width: 30%;
  }
  
  .product-gallery {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .gallery-item img {
    height: 200px;
  }
}

/* ============================================
   9. ANALYTICS RESPONSIVE
   ============================================ */
.analytics-filter-panel {
  padding: var(--space-md);
}

.analytics-filter-panel .form-actions {
  flex-direction: column;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.analytics-filter-panel select {
  width: 100%;
  min-width: 150px;
}

.analytics-filter-panel .btn {
  width: 100%;
  justify-content: center;
  min-height: var(--touch-comfortable);
}

.bar-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: var(--space-sm) 0;
}

.bar-label {
  font-size: var(--text-sm);
  min-width: auto;
  margin-bottom: 4px;
}

.bar {
  width: 100%;
  height: 8px;
}

.bar-value {
  font-size: var(--text-sm);
  margin-left: 0;
  margin-top: 4px;
}

.trend-bars .bar-label {
  font-size: var(--text-xs);
}

/* Analytics panels */
.analytics-split {
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.panel-head {
  margin-bottom: var(--space-md);
}

.panel-head h3 {
  font-size: var(--text-lg);
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
}

@media (min-width: 768px) {
  .analytics-filter-panel {
    padding: var(--space-lg);
  }
  
  .analytics-filter-panel select {
    width: auto;
    min-width: 150px;
  }
  
  .bar-row {
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
  }
  
  .bar-label {
    min-width: 100px;
    margin-bottom: 0;
  }
  
  .bar {
    flex: 1;
    height: 10px;
  }
  
  .bar-value {
    min-width: 30px;
    text-align: right;
    margin-left: var(--space-md);
    margin-top: 0;
  }
}

@media (min-width: 992px) {
  .bar-label {
    min-width: 120px;
  }
}

/* ============================================
   10. SECTION TITLES & GENERAL LAYOUT
   ============================================ */
.section-title {
  text-align: center;
  margin: var(--space-xl) 0 var(--space-lg);
  padding: 0 var(--space-md);
}

.section-title h1,
.section-title h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: var(--space-sm);
}

.section-title .btn {
  width: 100%;
  margin-top: var(--space-md);
}

/* Form actions */
.form-actions {
  flex-direction: column;
  gap: var(--space-sm);
}

.form-actions .btn {
  width: 100%;
  justify-content: center;
}

@media (min-width: 576px) {
  .form-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .form-actions .btn {
    width: auto;
    flex: 1;
  }
}

@media (min-width: 768px) {
  .section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    flex-wrap: wrap;
    gap: var(--space-md);
  }
  
  .section-title h1,
  .section-title h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    margin-bottom: 0;
  }
  
  .section-title .btn {
    width: auto;
    margin-top: 0;
    flex: 0 0 auto;
  }
  
  .form-actions {
    justify-content: flex-start;
  }
  
  .form-actions .btn {
    flex: 0 0 auto;
  }
}

@media (min-width: 992px) {
  .section-title {
    margin: var(--space-5) 0 var(--space-4);
  }
}

/* ============================================
   11. FOOTER RESPONSIVE
   ============================================ */
.site-footer .container {
  flex-direction: column;
  gap: var(--space-lg);
  padding: var(--space-xl) var(--space-md);
}

.footer-brand {
  text-align: center;
}

.footer-brand p {
  max-width: 100%;
}

.footer-nav {
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.footer-nav div {
  text-align: center;
}

.footer-bottom {
  flex-direction: column;
  text-align: center;
  gap: var(--space-sm);
}

@media (min-width: 576px) {
  .footer-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-xl);
  }
  
  .footer-nav div {
    text-align: left;
  }
}

@media (min-width: 768px) {
  .site-footer .container {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: var(--space-xl) var(--space-lg);
  }
  
  .footer-brand {
    text-align: left;
    width: 100%;
  }
  
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
}

@media (min-width: 992px) {
  .footer-brand {
    width: auto;
  }
}

/* ============================================
   12. AUTH PAGE RESPONSIVE
   ============================================ */
.auth-wrap {
  max-width: 100%;
  margin: var(--space-md);
  padding: var(--space-md);
}

.auth-wrap h2 {
  font-size: var(--text-xl);
  text-align: center;
}

.auth-wrap > p {
  text-align: center;
  font-size: var(--text-sm);
}

.tab-switch {
  flex-direction: row;
  gap: var(--space-sm);
  margin: var(--space-lg) 0;
}

.tab-switch .btn {
  flex: 1;
  padding: 12px 16px;
  font-size: var(--text-sm);
}

.auth-wrap .form-grid {
  gap: var(--space-md);
}

.auth-wrap .muted {
  text-align: center;
  font-size: var(--text-sm);
}

@media (min-width: 768px) {
  .auth-wrap {
    max-width: 600px;
    margin: var(--space-xl) auto;
    padding: var(--space-xl);
  }
  
  .auth-wrap h2 {
    font-size: var(--text-2xl);
  }
  
  .tab-switch .btn {
    padding: 14px 32px;
    font-size: var(--text-base);
  }
}

@media (min-width: 992px) {
  .auth-wrap {
    max-width: 760px;
  }
}

/* ============================================
   13. LIGHTBOX RESPONSIVE
   ============================================ */
.image-lightbox-overlay {
  padding: var(--space-md);
}

.image-lightbox-overlay img {
  max-width: 100vw;
  max-height: 70vh;
  border-radius: var(--radius-sm);
}

.lightbox-close-btn {
  top: var(--space-md);
  right: var(--space-md);
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

@media (min-width: 768px) {
  .image-lightbox-overlay img {
    max-width: 90vw;
    max-height: 85vh;
  }
  
  .lightbox-close-btn {
    top: var(--space-lg);
    right: var(--space-lg);
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }
}

/* ============================================
   14. PAGINATION RESPONSIVE
   ============================================ */
.pagination-panel {
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
  padding: var(--space-md);
}

.pagination-meta {
  font-size: var(--text-sm);
  text-align: center;
}

.pagination-panel .form-actions {
  width: 100%;
}

.pagination-panel .form-actions .btn {
  flex: 1;
}

@media (min-width: 576px) {
  .pagination-panel {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .pagination-panel .form-actions {
    width: auto;
  }
  
  .pagination-panel .form-actions .btn {
    flex: 0 0 auto;
  }
}

/* ============================================
   15. CONTAINER & SPACING OVERRIDES
   ============================================ */
.container {
  width: min(1300px, 96vw);
  padding: 0 var(--space-sm);
}

@media (min-width: 768px) {
  .container {
    width: min(1300px, 94vw);
    padding: 0 var(--space-md);
  }
}

/* Adjust site main padding */
.site-main {
  padding-top: 20px;
}

@media (min-width: 768px) {
  .site-main {
    padding-top: 40px;
  }
}

/* ============================================
   16. UTILITY CLASSES
   ============================================ */
.hide-mobile {
  display: none !important;
}

@media (min-width: 768px) {
  .hide-mobile {
    display: block !important;
  }
  
  .hide-desktop {
    display: none !important;
  }
}

/* Text alignment utilities */
.text-center-mobile {
  text-align: center;
}

@media (min-width: 768px) {
  .text-center-mobile {
    text-align: left;
  }
}

/* ============================================
   17. IMAGE PREVIEW RESPONSIVE
   ============================================ */
.image-preview,
.existing-preview {
    width: 100%;
    max-width: 200px;
}

.image-preview img,
.existing-preview img {
    width: 100%;
    height: auto;
    max-height: 200px;
}

@media (min-width: 576px) {
    .image-preview,
    .existing-preview {
        max-width: 250px;
    }
    
    .image-preview img,
    .existing-preview img {
        max-height: 250px;
    }
}

/* Fabric upload section responsive */
.fabric-upload-section {
    margin-top: var(--space-md);
}

/* Gallery slots responsive */
.gallery-slots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

@media (min-width: 576px) {
    .gallery-slots-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .gallery-slots-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.gallery-slot {
    position: relative;
}

.gallery-slot-preview img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

@media (min-width: 576px) {
    .gallery-slot-preview img {
        height: 120px;
    }
}

/* ============================================
   18. AUTH PAGE RESPONSIVE
   ============================================ */
.auth-container {
  padding: var(--space-md);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: var(--space-lg);
  border-radius: var(--radius-md);
}

.auth-card h1 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-md);
  text-align: center;
}

.auth-card .tab-btn {
  width: 100%;
  min-height: var(--touch-comfortable);
  padding: 12px 16px;
}

.auth-card .input {
  width: 100%;
  min-height: var(--touch-comfortable);
}

.auth-card .btn {
  width: 100%;
  min-height: var(--touch-comfortable);
  padding: 16px 24px;
}

.auth-card .form-actions {
  flex-direction: column;
  gap: var(--space-sm);
}

.auth-card .form-actions .btn {
  width: 100%;
}

@media (min-width: 576px) {
  .auth-card {
    padding: var(--space-xl);
  }
  
  .auth-card h1 {
    font-size: var(--text-2xl);
  }
}

/* ============================================
   19. PRINT STYLES REFINEMENT
   ============================================ */
@media print {
  .site-header,
  .site-footer,
  .nav-actions,
  .menu-toggle,
  .sticky-actions,
  .form-actions:not(.hero-actions),
  .btn:not(.print-btn) {
    display: none !important;
  }
  
  body {
    background: #fff !important;
    color: #000 !important;
    padding: 0 !important;
  }
  
  .card, .panel, .hero-box {
    background: #fff !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  
  .container {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
  }
  
  .preview-slip {
    flex-direction: row !important;
    page-break-inside: avoid;
  }
  
  h1, h2, h3, h4 {
    color: #000 !important;
  }
}
