/* Mobile-responsive styles for Spirits Collection */
/* Breakpoint: 768px — below is mobile, above is desktop (unchanged) */

/* ── Mobile Navigation ── */
.mobile-nav {
  display: none;
}

@media (max-width: 767.98px) {
  .mobile-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .desktop-nav {
    display: none !important;
  }

  .mobile-gear-btn {
    background: none;
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    color: var(--text-muted);
    padding: 0.4rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
  }

  .mobile-gear-btn:hover,
  .mobile-gear-btn.active {
    color: var(--gold);
    border-color: var(--glass-border-hover);
  }

  .mobile-gear-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 1rem;
    min-width: 200px;
    background: rgba(15, 14, 12, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 0.5rem 0;
    z-index: 200;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  }

  body.light-theme .mobile-gear-dropdown {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  }

  .mobile-gear-dropdown.show {
    display: block;
  }

  .mobile-gear-dropdown a {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s;
  }

  .mobile-gear-dropdown a:hover {
    background: rgba(212, 168, 75, 0.08);
  }

  .mobile-gear-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.25rem 0;
  }

  .mobile-gear-row {
    display: flex;
    gap: 0;
  }

  .mobile-gear-row a {
    flex: 1;
    text-align: center;
    border-right: 1px solid var(--glass-border);
  }

  .mobile-gear-row a:last-child {
    border-right: none;
  }
}

/* ── Mobile Swipe Tabs ── */
.mobile-swipe-tabs,
.mobile-search,
.mobile-filters,
.mobile-bottle-list {
  display: none;
}

@media (max-width: 767.98px) {
  /* Hide desktop collection elements */
  .collection-header {
    display: none !important;
  }

  /* Hide desktop bottle layouts on mobile */
  .desktop-bottle-layouts {
    display: none !important;
  }

  /* Swipe Tabs */
  .mobile-swipe-tabs {
    display: flex;
    border-bottom: 1px solid var(--glass-border);
    margin: 0 -0.75rem;
    padding: 0 0.75rem;
  }

  .mobile-tab {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
  }

  .mobile-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
  }

  /* Mobile Search */
  .mobile-search {
    display: block;
    padding: 0.75rem 0;
  }

  .mobile-search .form-control {
    width: 100%;
    max-width: none !important;
  }

  /* Mobile Filters */
  .mobile-filters {
    display: block;
    margin-bottom: 1rem;
  }

  .mobile-filter-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    color: var(--text);
    cursor: pointer;
    font-size: 0.85rem;
    gap: 0.5rem;
  }

  .mobile-filter-summary {
    flex: 1;
    text-align: right;
    color: var(--gold);
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-filter-chevron {
    transition: transform 0.2s;
    color: var(--text-muted);
    flex-shrink: 0;
  }

  .mobile-filter-toggle.open .mobile-filter-chevron {
    transform: rotate(180deg);
  }

  .mobile-filter-panel {
    display: none;
    padding: 0.75rem 0;
  }

  .mobile-filter-panel.show {
    display: block;
  }

  .mobile-filter-panel .form-select {
    width: 100%;
    max-width: none !important;
    margin-bottom: 0.5rem;
  }

  /* Mobile Hybrid Bottle Cards */
  .mobile-bottle-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .mobile-bottle-card {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    transition: border-color 0.2s;
  }

  .mobile-bottle-card:active {
    border-color: var(--glass-border-hover);
  }

  .mobile-bottle-photo {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    background: rgba(212, 168, 75, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-bottle-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .mobile-bottle-photo .mobile-bottle-placeholder {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.4;
    padding: 12px;
  }

  .mobile-bottle-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .mobile-bottle-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.2;
    margin-bottom: 0.15rem;
  }

  .mobile-bottle-distillery {
    color: var(--gold);
    font-size: 0.8rem;
    margin-bottom: 0.15rem;
  }

  .mobile-bottle-meta {
    color: var(--text-muted);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-bottle-footer {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.3rem;
    align-items: center;
  }
}

/* ── Mobile FAB ── */
.mobile-fab {
  display: none;
}

.mobile-sheet-backdrop,
.mobile-choice-sheet {
  display: none;
}

@media (max-width: 767.98px) {
  .mobile-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gold);
    color: #080808;
    border: none;
    box-shadow: 0 4px 16px rgba(212, 168, 75, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 100;
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .mobile-fab:active {
    transform: scale(0.92);
  }

  /* Choice Sheet */
  .mobile-sheet-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 300;
  }

  .mobile-sheet-backdrop.show {
    display: block;
  }

  .mobile-choice-sheet {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(20, 18, 15, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--glass-border);
    border-radius: 1.25rem 1.25rem 0 0;
    padding: 0.5rem 1.25rem 1.5rem;
    z-index: 301;
    transform: translateY(calc(100% + 2rem));
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  }

  body.light-theme .mobile-choice-sheet {
    background: rgba(255, 255, 255, 0.98);
  }

  .mobile-choice-sheet.show {
    transform: translateY(0);
  }

  .mobile-sheet-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--glass-border-hover);
    margin: 0.5rem auto 1rem;
  }

  .mobile-sheet-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 1rem;
    text-align: center;
  }

  .mobile-sheet-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .mobile-sheet-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s;
  }

  .mobile-sheet-option:active {
    border-color: var(--glass-border-hover);
  }

  .mobile-sheet-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
  }

  .mobile-sheet-option-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
  }

  .mobile-sheet-option-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
  }
}

/* ── Mobile Performance ── */
@media (max-width: 767.98px) {
  /* Disable particles */
  .particles {
    display: none !important;
  }

  /* Disable 3D hover effects */
  .glass-card:hover {
    transform: none !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
  }

  .glass-card::before {
    display: none !important;
  }

  /* Reduce glassmorphism blur */
  .glass-card,
  .glass-panel {
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
  }

  /* Reduce navbar blur */
  .navbar {
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
  }
}

/* ── Mobile Bottle Detail ── */
@media (max-width: 767.98px) {
  /* Stack the two-column detail layout */
  .bottle-detail-row {
    flex-direction: column !important;
  }

  .bottle-detail-row > .col-md-5,
  .bottle-detail-row > .col-md-7 {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
  }

  /* Full-width bottle photo */
  .bottle-detail-row img {
    width: 100% !important;
    max-height: 50vh;
    object-fit: contain;
  }

  /* Action buttons row */
  .detail-actions .d-flex {
    flex-wrap: wrap !important;
  }

  .detail-actions .btn {
    flex: 1 1 auto;
    min-height: 44px;
  }
}

/* ── Mobile Bottle Form ── */
@media (max-width: 767.98px) {
  /* Stack form columns — the form itself is a .row, plus nested rows */
  .bottle-form,
  .bottle-form .row {
    flex-direction: column !important;
  }

  .bottle-form .col-md-6,
  .bottle-form .col-md-4,
  .bottle-form .col-md-8,
  .bottle-form .col-md-12,
  .bottle-form .col-md-3,
  .bottle-form .col-md-2 {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
  }

  /* Touch-friendly inputs */
  .bottle-form input,
  .bottle-form select,
  .bottle-form textarea,
  .bottle-form .form-control,
  .bottle-form .form-select {
    min-height: 44px !important;
    font-size: 16px !important;
  }

  /* Full-width buttons */
  .bottle-form .btn {
    width: 100%;
    min-height: 44px;
    margin-bottom: 0.5rem;
  }
}

/* ── Mobile Stats ── */
@media (max-width: 767.98px) {
  /* 2x2 hero grid */
  .stats-grid .row.g-3 {
    flex-wrap: wrap !important;
    gap: 0 !important;
    justify-content: center !important;
  }

  .stat-divider {
    display: none !important;
  }

  /* Stack chart panels */
  .stats-grid .row.g-4 {
    flex-direction: column !important;
  }

  .stats-grid .col-md-4,
  .stats-grid .col-md-6,
  .stats-grid .col-md-8,
  .stats-grid .col-lg-4 {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
  }

  /* Chart containers */
  .stats-chart-panel {
    margin-bottom: 1rem;
  }
}

/* ── General Mobile Touch Targets ── */
@media (max-width: 767.98px) {
  .btn-gold,
  .btn-glass,
  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Wider footer spacing for FAB clearance */
  footer,
  .impressum-footer {
    padding-bottom: 5rem !important;
  }
}
