/* Responsive Design */

/* Mobile Touch Optimizations */
@media (max-width: 768px) {
  /* Remove body background image on mobile to prevent overlap */
  body {
    background-image: none;
    background-color: var(--background-light);
  }

  /* Global touch targets */
  a,
  button,
  .btn,
  input,
  select,
  textarea {
    min-height: 44px;
    min-width: 44px;
  }

  /* Improved text readability */
  body {
    font-size: 16px;
    line-height: 1.5;
  }

  /* Enhanced tap targets */
  .clickable {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Menu Page Mobile Optimizations */
  .location-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
  }

  .location-btn {
    flex: 1;
    min-width: 120px;
    max-width: 150px;
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
    min-height: 48px;
    border-radius: 8px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .location-btn i {
    margin-right: 0.25rem;
    font-size: 0.8rem;
  }

  /* Menu Images Grid Mobile */
  .menu-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 0;
  }

  .menu-image-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .menu-image-item:active {
    transform: scale(0.98);
  }

  .menu-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
  }

  .menu-image:hover {
    transform: none;
  }

  .menu-image:active {
    transform: scale(0.95);
  }

  /* Menu Page Section Header */
  #menu-section .section-header {
    text-align: center;
    margin-bottom: 1.2rem;
    padding-top: 1rem;
  }

  #menu-section .section-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }
  /* Header Layout */
  .header {
    padding: 0;
  }

  .header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 0 1rem;
  }

  .nav-menu {
    display: none;
  }

  .logo {
    position: static;
    transform: none;
    order: 0;
    flex: 1;
    display: flex;
    justify-content: flex-start;
  }

  .logo-image {
    display: block;
    height: 100px;
    width: auto;
    max-width: 250px;
  }

  .logo-text {
    display: none;
  }

  .auth-section {
    order: 0;
    flex: none;
    display: none;
  }

  .auth-section .auth-buttons {
    display: none;
  }

  .auth-section .user-info {
    font-size: 0.85rem;
  }

  .auth-section .user-info .btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    min-height: 40px;
  }

  /* Navigation */
  .hamburger {
    display: flex;
    order: 1;
    flex: none;
    margin-left: 0.5rem;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
  }

  .hamburger span {
    width: 22px;
    height: 2px;
  }

  /* Mobile Menu */
  .mobile-menu {
    margin: 0 -1rem;
  }

  /* Container padding */
  .container {
    padding: 0 1rem;
  }

  /* Typography */
  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.3rem;
  }

  /* Buttons */
  .btn {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-outline {
    padding: 1rem 1.2rem;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Forms */
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 1rem;
    font-size: 1rem;
    min-height: 44px;
  }

  /* Grid layouts */
  .benefits-grid,
  .investment-grid,
  .process-steps {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Cards and sections */
  .benefit-item,
  .investment-item {
    padding: 1.5rem;
  }

  .benefit-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .investment-icon {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  /* Service buttons */
  .service-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    padding: 0 0.5rem;
  }

  .service-btn {
    padding: 0.8rem 0.5rem;
    font-size: 0.85rem;
    min-height: 44px;
    gap: 0.5rem;
  }

  .service-btn i {
    font-size: 1.8rem !important;
    margin-bottom: 0.25rem;
  }

  .service-btn span {
    font-size: 0.85rem !important;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
  }

  /* Hero sections */
  .hero-section {
    padding: 2rem 0;
    text-align: center;
  }

  .hero-section h1 {
    font-size: 1.8rem;
    line-height: 1.3;
  }

  .hero-section p {
    font-size: 1rem;
    line-height: 1.5;
  }

  .hero-text h1 {
    font-size: 2rem;
  }

  .hero-text p {
    font-size: 1rem;
  }

  /* Stats */
  .hero-stats {
    flex-direction: column;
    gap: 1.5rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  /* Section headers */
  .section-header h2 {
    font-size: 2rem;
  }

  .section-header p {
    font-size: 1rem;
  }

  /* Forms */
  .franchise-form {
    padding: 2rem;
    margin: 0 1rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .submit-btn {
    padding: 1rem 2rem;
    font-size: 1rem;
  }

  /* Contact details */
  .contact-details {
    flex-direction: column;
    gap: 1rem;
  }

  /* Process steps */
  .step-number {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  /* Modals */
  .modal-content {
    margin: 5% auto;
    width: 95%;
    max-width: none;
  }

  .modal-body {
    padding: 1rem;
  }

  /* Tables */
  .table-responsive {
    overflow-x: auto;
  }

  table {
    font-size: 0.9rem;
  }

  /* Back button */
  .back-button-container {
    margin-bottom: 1rem;
  }

  .back-button-container .btn {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Floating cart */
  .floating-cart {
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
  }

  .floating-cart-btn {
    width: 56px;
    height: 56px;
    font-size: 1.3rem;
  }

  .cart-badge {
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
  }

  /* Enhanced touch interactions */
  .mobile-nav-link {
    gap: 1rem;
  }

  /* Improved spacing for touch */
  .form-group {
    margin-bottom: 1.5rem;
  }

  /* Better focus states for accessibility */
  input:focus,
  select:focus,
  textarea:focus,
  button:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
  }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
  /* Ensure body background is removed on smaller screens too */
  body {
    background-image: none;
    background-color: var(--background-light);
  }

  .header {
    padding: 0;
  }

  .header .container {
    padding: 0 0.75rem;
  }

  .logo-image {
    display: block;
    height: 90px;
    width: auto;
    max-width: 220px;
  }

  .logo-text {
    display: none;
  }

  .hamburger span {
    width: 20px;
    height: 2px;
    margin: 2px 0;
  }

  .mobile-nav-link {
    padding: 1rem 1rem;
    font-size: 1rem;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .container {
    padding: 0 0.75rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .section-header h2 {
    font-size: 1.8rem;
  }

  .franchise-form {
    padding: 1.5rem;
    margin: 0 0.5rem;
  }

  .benefit-icon {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .investment-icon {
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }

  .hero-stats {
    gap: 1rem;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .step-number {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }

  .submit-btn {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    min-height: 48px;
  }

  /* Enhanced mobile interactions */
  input,
  select,
  textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Better mobile navigation */
  .mobile-menu {
    padding: 0.5rem 0;
  }

  /* Function room info cards optimization */
  .info-card {
    padding: 1.25rem;
    text-align: center;
  }

  .info-card i {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
  }

  .info-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .info-card p {
    font-size: 0.85rem;
  }

  /* Profile Page Mobile Styles */
  .profile-header {
    padding: 1.5rem 1rem;
    margin-bottom: 1.5rem;
  }

  .profile-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
  }

  .profile-header p {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .profile-header-actions {
    margin-top: 1rem;
  }

  .profile-container {
    gap: 1.5rem;
  }

  .profile-section {
    padding: 1.5rem 1rem;
    margin: 0 0.5rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .section-header h2 {
    font-size: 1.3rem;
  }

  /* Info Grid Mobile Layout */
  .info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .info-item {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
  }

  .info-item label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
  }

  .info-item span {
    font-size: 1rem;
    color: var(--text-color);
    word-break: break-word;
  }

  /* Profile Edit Form Mobile */
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
  }

  .form-actions .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  /* Gift Cards Mobile Layout */
  .gift-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .gift-card-item {
    padding: 1.25rem;
  }

  .gift-card-header {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .gift-card-amount {
    font-size: 1.5rem;
  }

  .gift-card-code {
    font-size: 0.9rem;
    padding: 0.5rem;
  }

  .gift-card-actions {
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
  }

  .gift-card-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  /* Loyalty Stamps Mobile */
  .stamp-counter {
    font-size: 1.1rem;
    justify-content: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .current-stamps {
    font-size: 1.5rem;
    color: var(--primary-color);
  }

  .stamp-progress-card {
    padding: 1.25rem;
  }

  .stamp-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin: 1.5rem 0;
  }

  .stamp-slot {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .stamp-info {
    text-align: center;
    margin-top: 1rem;
  }

  .stamp-info p {
    font-size: 0.9rem;
  }

  /* Order History Mobile */
  .order-filters {
    width: 100%;
    margin-top: 1rem;
  }

  .filter-select {
    width: 100%;
    min-height: 44px;
    padding: 0.75rem;
    font-size: 1rem;
  }

  .order-card {
    padding: 1.25rem;
    margin-bottom: 1rem;
  }

  .order-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .order-info {
    flex-direction: column;
    gap: 0.75rem;
  }

  .order-items {
    margin-top: 1rem;
  }

  .order-item {
    justify-content: space-between;
    padding: 0.75rem 0;
  }

  .order-total {
    font-size: 1.1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
  }

  /* Modal Mobile Styles */
  .modal-content {
    width: 95%;
    max-width: none;
    margin: 10% auto;
    max-height: 80vh;
    overflow-y: auto;
  }

  .modal-header {
    padding: 1rem;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .modal-header h3 {
    font-size: 1.2rem;
    margin: 0;
  }

  .modal-header .close {
    font-size: 1.5rem;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .modal-body {
    padding: 1rem;
  }

  #order-details-content {
    font-size: 0.95rem;
  }

  #order-details-content .order-summary {
    margin-bottom: 1.5rem;
  }

  #order-details-content .order-items {
    margin-top: 1rem;
  }

  #order-details-content .order-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
  }
}

/* Extra Small Mobile (480px and below) - Profile Specific */
@media (max-width: 480px) {
  /* Profile Header */
  .profile-header {
    padding: 1rem 0.75rem;
    margin-bottom: 1rem;
  }

  .profile-header h1 {
    font-size: 1.5rem;
    line-height: 1.2;
  }

  .profile-header p {
    font-size: 0.9rem;
  }

  /* Profile Container */
  .profile-container {
    gap: 1rem;
  }

  .profile-section {
    padding: 1rem 0.75rem;
    margin: 0 0.25rem;
  }

  .section-header {
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .section-header h2 {
    font-size: 1.1rem;
  }

  /* Info Items */
  .info-item {
    padding: 0.75rem;
  }

  .info-item label {
    font-size: 0.8rem;
  }

  .info-item span {
    font-size: 0.9rem;
  }

  /* Form Elements */
  .form-group {
    margin-bottom: 1rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 0.75rem;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .form-actions {
    gap: 0.5rem;
    margin-top: 1rem;
  }

  .form-actions .btn {
    min-height: 44px;
    font-size: 0.9rem;
  }

  /* Gift Cards */
  .gift-card-item {
    padding: 1rem;
  }

  .gift-card-amount {
    font-size: 1.2rem;
  }

  .gift-card-code {
    font-size: 0.8rem;
    padding: 0.4rem;
  }

  .gift-card-actions {
    gap: 0.5rem;
  }

  .gift-card-actions .btn {
    min-height: 40px;
    font-size: 0.85rem;
    padding: 0.6rem;
  }

  /* Loyalty Stamps */
  .stamp-counter {
    font-size: 1rem;
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: 0.2rem;
  }

  .current-stamps {
    font-size: 1.3rem;
  }

  .stamp-progress-card {
    padding: 1rem;
  }

  .stamp-grid {
    gap: 0.4rem;
    margin: 1rem 0;
  }

  .stamp-slot {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }

  .stamp-info p {
    font-size: 0.8rem;
  }

  /* Order History */
  .filter-select {
    min-height: 40px;
    padding: 0.6rem;
    font-size: 0.9rem;
  }

  .order-card {
    padding: 1rem;
  }

  .order-header {
    gap: 0.4rem;
  }

  .order-info {
    gap: 0.5rem;
  }

  .order-item {
    padding: 0.5rem 0;
    font-size: 0.9rem;
  }

  .order-total {
    font-size: 1rem;
  }

  /* Modal */
  .modal-content {
    width: 98%;
    margin: 5% auto;
    max-height: 90vh;
  }

  .modal-header {
    padding: 0.75rem;
  }

  .modal-header h3 {
    font-size: 1.1rem;
  }

  .modal-header .close {
    font-size: 1.3rem;
    padding: 0.4rem;
    min-width: 40px;
    min-height: 40px;
  }

  .modal-body {
    padding: 0.75rem;
  }

  #order-details-content {
    font-size: 0.9rem;
  }

  #order-details-content .order-item {
    padding: 0.6rem;
    font-size: 0.85rem;
  }

  /* Loading States */
  .loading-message,
  .loading-state {
    font-size: 0.9rem;
  }

  .loading-spinner {
    padding: 1rem;
  }

  /* Logout Button */
  .logout-btn {
    min-height: 44px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* Service buttons for smaller screens */
  .service-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    padding: 0 0.25rem;
  }

  .service-btn {
    padding: 0.6rem 0.4rem;
    font-size: 0.8rem;
    min-height: 40px;
    gap: 0.4rem;
  }

  .service-btn i {
    font-size: 1.5rem !important;
    margin-bottom: 0.2rem;
  }

  .service-btn span {
    font-size: 0.8rem !important;
    font-weight: 600;
    text-align: center;
    line-height: 1.1;
  }
}
