/* Responsive Styles */
@media screen and (max-width: 1024px) {
  .main-container {
    width: 90%;
  }

  .full-column {
    width: 100%;
  }

  .header-actions {
    align-items: unset;
  }
}

@media screen and (max-width: 768px) {
  .navbar {
    padding: 0 15px;
    width: calc(100% - 30px);
  }

  .modal-overlay.show {
    padding: 10px;
  }

  .header-actions {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .header-actions .filter-select {
    width: 100%;
    min-width: unset;
  }

  .nav-menu {
    top: 60px;
    position: fixed;
    left: 0;
    right: 0;
    background: var(--card-bg);
    padding: 20px;
    border-bottom: var(--border-light);
    flex-direction: column;
    gap: 10px;
    display: none;
    z-index: 999;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-menu a {
    width: 100%;
    justify-content: space-between;
  }

  .dropdown {
    position: static;
    width: 100%;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    margin-top: 10px;
  }

  .nav-menu li.active .dropdown {
    display: block;
  }

  .nav-left {
    gap: 10px;
  }

  .main-container {
    flex-direction: column;
    gap: 20px;
  }

  .left-column,
  .right-column {
    width: 100%;
  }

  .left-column {
    order: 2;
  }

  .right-column {
    order: 1;
  }

  .profile-dropdown {
    right: -10px;
  }
}

@media screen and (max-width: 480px) {
  .orders-header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .header-actions {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .header-actions .filter-select {
    width: 100%;
    min-width: unset;
  }

  .header-toolbar {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .order-details {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .order-amount {
    text-align: left;
  }

  .badge-revenue {
    padding: 4px 8px;
    font-size: 13px;
  }
}

/* Responsive Footer */
@media screen and (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }

  .footer-left {
    align-items: center;
  }

  .footer-center .footer-links {
    justify-content: center;
    gap: 1rem;
  }

  .footer-right .social-links {
    justify-content: center;
  }
}

@media screen and (max-width: 480px) {
  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }

  .footer-content {
    padding: 1rem;
  }
}

@media screen and (max-width: 768px) {
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    order: -1;
    /* Ensures it appears first in flex container */
  }
}

/* Responsive behavior for areas grid */
@media screen and (max-width: 1200px) {
  .analytics-list.areas-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .analytics-list.areas-grid {
    grid-template-columns: 1fr;
  }

  .search-input {
    width: 90% !important;
  }

  .header-actions input {
    width: 95% !important;
  }
}

/* Responsive Analytics Grid */
@media screen and (max-width: 1024px) and (min-width: 769px) {
  .analytics-item {
    padding: 14px;
  }

  .analytics-info h3 {
    font-size: 13px;
  }
}

@media screen and (max-width: 768px) {
  .analytics-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .analytics-item {
    padding: 14px;
  }

  .category-image {
    margin-right: 10px;
  }

  .category-image img {
    width: 35px;
    height: 35px;
  }

  .analytics-info h3 {
    font-size: 13px;
  }

  .analytics-details {
    gap: 6px;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-container {
    margin: 80px 0 2rem;
    padding: 0 1rem;
  }

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

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

  .category-tabs {
    flex-direction: column;
  }

  .tab-btn {
    justify-content: flex-start;
    padding: 12px 16px;
  }

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

  .products-filters {
    flex-direction: column;
  }

  .filter-group {
    flex: 1;
  }

  .large-popup {
    max-width: 95vw;
    margin: 20px;
  }

  .category-card-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .extra-groups-assignment,
  .tags-assignment {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .breadcrumb-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .category-card-actions {
    flex-direction: column;
  }

  .product-card-actions {
    flex-direction: column;
  }

  .batch-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Responsive adjustments for smaller screens */
@media (max-width: 900px) {
  .category-name-column {
    width: 20%;
  }

  .category-description-column {
    width: 35%;
  }

  .category-actions-column {
    width: 25%;
  }
}

@media (max-width: 600px) {
  .category-name-column {
    width: 25%;
  }

  .category-description-column {
    width: 30%;
  }

  .category-status-column {
    width: 20%;
  }

  .category-actions-column {
    width: 25%;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .calendar-popup {
    width: 95%;
    margin: 10px;
  }

  .calendar-header {
    padding: 15px;
  }

  .calendar-title {
    font-size: 16px;
  }

  .calendar-body {
    padding: 15px;
  }

  .calendar-day {
    min-height: 50px;
    padding: 6px;
  }

  .calendar-day-number {
    font-size: 12px;
  }

  .calendar-day-count {
    font-size: 9px;
    padding: 1px 4px;
  }

  .calendar-legend {
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* Responsive Design for Restaurant Stats */
@media (max-width: 768px) {
  .restaurant-stats {
    flex-direction: column;
    gap: 15px;
  }

  .restaurant-stat {
    padding: 12px;
  }

  .restaurant-stat-icon {
    width: 35px;
    height: 35px;
    font-size: 14px;
  }

  .restaurant-stat-value {
    font-size: 20px;
  }

  /* Reservations page responsive stat values */
  .reservation-stat-value {
    font-size: 20px;
  }

  .table-edit-content {
    width: 95%;
    margin: 10px;
  }

  .table-edit-header,
  .table-edit-body,
  .table-edit-actions {
    padding: 15px;
  }

  .table-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
  }

  /* Mobile overrides for table-item */
  .table-item {
    padding: 6px;
    min-height: 75px;
  }

  .table-number {
    font-size: 14px;
  }

  .table-info {
    font-size: 10px;
  }

  .table-status {
    font-size: 9px;
    padding: 1px 4px;
  }

  /* Mobile styling for table actions - kept separate from main definition */
  .table-actions {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .add-table-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
    font-size: 13px;
  }

  #autoArrangeBtn {
    width: 100%;
    justify-content: center;
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .table-settings-popup {
    width: 95%;
    max-height: 95vh;
  }

  .settings-form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .table-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .time-slots-container {
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  }

  .settings-actions {
    flex-direction: column;
  }
}

/* Responsive adjustments for reservation cards */
@media (max-width: 768px) {
  .reservation-item {
    flex-direction: column;
    gap: 16px;
  }

  .reservation-info {
    flex-direction: column;
    gap: 12px;
  }

  .reservation-actions {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .reservation-actions .btn-outline {
    min-width: auto;
    flex: 1;
  }

  .btn-icon-group {
    margin-left: auto;
  }
}

/* Responsive adjustments for edit reservation popup */
@media (max-width: 768px) {
  .edit-reservation-popup {
    width: 95%;
    margin: 10px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn-danger {
    margin-left: 0;
    order: -1;
  }
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Responsive adjustments for modal */
@media (max-width: 900px) {
  .popup-content,
  .large-popup {
    width: 90%;
    min-width: 0;
    max-width: 98vw;
    padding: 1.5rem 0.5rem 1rem 0.5rem;
  }

  #groupCouponsModal.popup-overlay {
    display: block !important;
  }

  .pages-container {
    width: 93% !important;
  }

  .add-product-modal .modal-content {
    width: 100%;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .group-coupons-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 600px) {
  .orders-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
  }
  .header-toolbar .filter-select,
  .header-toolbar .date-filter {
    width: 90%;
    min-width: unset;
  }
  .header-toolbar .btn-primary {
    width: 100%;
    min-width: unset;
  }
  .quick-actions {
    gap: 0.5rem;
  }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .customer-item {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .customer-info {
    min-width: 0;
  }
  .customer-stats,
  .customer-actions {
    min-width: 0;
  }
}
@media (max-width: 600px) {
  .customer-list,
  .areas-list {
    gap: 0.75rem;
    margin-top: 1rem;
  }
  .customer-item {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem 0.5rem;
  }
  .section-header {
    padding: 0.75rem;
    font-size: 1rem;
  }
  .customer-actions {
    gap: 0.25rem;
  }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .product-checkbox {
    max-width: calc(50% - 0.75rem);
  }
}

@media (max-width: 768px) {
  .product-checkbox {
    max-width: 100%;
    min-width: 100%;
  }
}

/* Responsive adjustments for template grid */
@media (max-width: 768px) {
  .template-row {
    flex-direction: column;
    gap: 16px;
  }

  .template-preview {
    height: 250px;
  }

  .template-iframe {
    width: 200%;
    height: 200%;
    transform: scale(0.5);
  }

  .radio-group {
    flex-direction: column;
    gap: 16px;
  }

  .days-selection {
    gap: 6px;
  }

  .days-selection .day-checkbox {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
}

/* Responsive adjustments for empty states */
@media (max-width: 768px) {
  .loading-categories,
  .empty-categories,
  .error-state {
    padding: 40px 16px;
  }

  .empty-categories .empty-state-icon,
  .error-state .error-icon {
    font-size: 48px;
  }

  .empty-categories h3,
  .error-state h3 {
    font-size: 20px;
  }

  .empty-categories p,
  .error-state p {
    font-size: 14px;
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .checkbox-row {
    flex-direction: column;
    gap: 1rem;
  }

  .large-popup {
    width: 95%;
    margin: 1rem;
  }
}

/* Mobile responsive - single column layout */
@media (max-width: 768px) {
  .variants-list,
  .category-variants-list,
  .extra-groups-list {
    grid-template-columns: 1fr;
    /* Single column on mobile */
  }

  .variant-checkbox,
  .extra-group-checkbox {
    padding: 1rem;
    /* Larger touch target on mobile */
    gap: 1rem;
  }

  .variant-checkbox input[type="checkbox"],
  .extra-group-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    /* Slightly larger checkboxes on mobile */
  }
}

/* Mobile border adjustments */
@media (max-width: 768px) {
  .variant-checkbox,
  .extra-group-checkbox {
    border-right: none;
    /* No right borders on mobile */
  }

  .variant-checkbox:last-child,
  .extra-group-checkbox:last-child {
    border-bottom: none;
    /* Only last item has no bottom border */
  }
}

/* Responsive design for categories */
@media (max-width: 1024px) {
  .shop-categories-grid {
    gap: 16px;
  }

  .category-card-image {
    width: 96px;
    height: 96px;
    margin: 10px;
  }

  .category-card-image .category-image {
    width: 96px;
    height: 96px;
  }

  .category-image-shimmer {
    width: 96px;
    height: 96px;
  }

  .category-card-content {
    padding: 14px 16px;
  }

  .category-card-header h3 {
    font-size: 15px;
  }
}

@media (max-width: 768px) {
  .shop-categories-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 16px;
  }

  .category-card {
    height: 110px;
  }

  .category-card-image {
    width: 94px;
    height: 94px;
    margin: 8px;
  }

  .category-card-image .category-image {
    width: 94px;
    height: 94px;
  }

  .category-image-shimmer {
    width: 94px;
    height: 94px;
  }

  .category-card-content {
    padding: 12px 16px;
  }

  .category-card-header {
    margin-bottom: 6px;
    gap: 10px;
  }

  .category-card-header h3 {
    font-size: 15px;
  }

  .category-badge {
    padding: 2px 6px;
    font-size: 10px;
  }

  .category-description {
    font-size: 12px;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .category-actions .btn-danger {
    padding: 5px;
    font-size: 12px;
    min-width: 28px;
    height: 28px;
  }
}

@media (max-width: 480px) {
  .category-card {
    flex-direction: column;
    height: auto;
    min-height: 180px;
  }

  .category-card-image {
    width: 80px;
    height: 80px;
    margin: 12px auto 0;
    align-self: center;
  }

  .category-card-image .category-image {
    width: 80px;
    height: 80px;
  }

  .category-image-shimmer {
    width: 80px;
    height: 80px;
  }

  .category-card-content {
    padding: 12px;
  }

  .category-description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .pricing-card-header {
    padding: 0.75rem 1rem;
  }

  .pricing-matrix {
    padding: 1rem;
  }

  .pricing-table {
    min-width: 500px;
    /* Reduce minimum width on mobile */
  }

  .pricing-table th,
  .pricing-table td {
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  /* Adjust column widths for mobile */
  .pricing-table th:first-child,
  .pricing-table td:first-child {
    min-width: 150px;
    max-width: 200px;
  }

  .pricing-table th:not(:first-child),
  .pricing-table td:not(:first-child) {
    min-width: 100px;
  }

  .price-input {
    min-width: 70px;
    max-width: 85px;
    padding: 0.4rem;
    font-size: 0.85rem;
  }

  .extra-item-row td:first-child {
    padding-left: 1.5rem;
  }
}

/* Responsive grid for tags and extra groups */
@media (max-width: 768px) {
  .product-extra-groups-list,
  .product-tags-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .product-extra-groups-list,
  .product-tags-list {
    grid-template-columns: 1fr;
  }
}

/* Responsive tax switch */
@media (max-width: 480px) {
  .tax-switch-container {
    gap: 0.5rem;
  }
}

/* Responsive design for products table */
@media (max-width: 768px) {
  .products-table-inner {
    font-size: 14px;
  }

  .products-table-inner th,
  .products-table-inner td {
    padding: 12px 8px;
  }

  .product-name-cell strong {
    font-size: 14px;
  }

  .product-description {
    font-size: 12px;
  }

  .product-actions-table {
    gap: 4px;
  }

  .product-actions-table .btn-icon,
  .product-actions-table .btn-danger {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
}
