/* ========================================
   MOBILE STYLES FOR PRODUCT.CSS
   Max-width: 800px
   ======================================== */

@media (max-width: 800px) {
    /* ========================================
       PREVENT HORIZONTAL SCROLL
       ======================================== */
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* ========================================
       CONTAINER
       ======================================== */
    .product-detail-container {
        padding-bottom: 30px;
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* ========================================
       BREADCRUMB
       ======================================== */
    .product-breadcrumb {
        padding: 10px 0;
        margin-bottom: 12px;
    }

    .breadcrumb {
        font-size: 12px;
        gap: 6px;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .breadcrumb::-webkit-scrollbar {
        display: none;
    }

    .breadcrumb li::after {
        margin-left: 6px;
    }

    /* ========================================
       PRODUCT MAIN - SINGLE COLUMN
       ======================================== */
    .product-main {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 10px;
        margin-bottom: 10px;
        border-radius: 2px;
        overflow-x: hidden;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* ========================================
       PRODUCT IMAGES
       ======================================== */
    .product-images {
        position: relative;
        top: 0;
        margin-bottom: 12px;
        max-width: 100%;
        overflow: hidden;
    }

    .main-image-container {
        border-radius: 2px;
        margin-bottom: 10px;
        /* Batasi tinggi maksimal di mobile */
        max-height: 375px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .main-image {
        width: 100%;
        height: 100%;
        object-fit: contain; /* Changed from cover to contain */
        max-width: 100%;
    }

    /* Thumbnail Navigation - More compact */
    .image-thumbnails-wrapper {
        gap: 4px;
        margin-top: 8px;
        max-width: 100%;
        overflow: hidden;
    }

    .thumbnail-nav {
        width: 28px;
        height: 50px;
        border-radius: 2px;
        flex-shrink: 0;
    }

    .thumbnail-nav i {
        font-size: 13px;
    }

    .image-thumbnails {
        gap: 4px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .image-thumbnails::-webkit-scrollbar {
        display: none;
    }

    .thumbnail {
        min-width: 50px;
        width: 50px;
        height: 50px;
        border-radius: 2px;
        flex-shrink: 0;
    }

    /* ========================================
       PRODUCT INFO
       ======================================== */
    .product-info {
        padding: 0;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .product-info > * {
        max-width: 100%;
        box-sizing: border-box;
    }

    .product-name {
        font-size: 18px;
        margin: 0 0 14px;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* ========================================
       PRICE SECTION
       ======================================== */
    .product-price-section {
        padding: 14px;
        margin-bottom: 14px;
        border-radius: 3px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .product-price {
        font-size: 24px;
    }

    .original-price {
        font-size: 14px;
    }

    .discount-badge {
        font-size: 11px;
        padding: 2px 6px;
    }

    /* ========================================
       WHOLESALE INFO
       ======================================== */
    .product-wholesale {
        padding: 12px 0;
        margin-bottom: 12px;
        flex-direction: column;
        gap: 8px;
    }

    .wholesale-label {
        min-width: auto;
        font-size: 13px;
    }

    .wholesale-value {
        font-size: 13px;
    }

    .wholesale-detail {
        font-size: 12px;
    }

    /* ========================================
       SHIPPING INFO
       ======================================== */
    .product-shipping {
        padding: 12px 0;
        margin-bottom: 12px;
        flex-direction: column;
        gap: 8px;
    }

    .shipping-label {
        min-width: auto;
        font-size: 13px;
    }

    .shipping-guarantee {
        margin-bottom: 6px;
        font-size: 13px;
    }

    .shipping-guarantee i {
        font-size: 14px;
    }

    .shipping-voucher {
        font-size: 12px;
    }

    /* ========================================
       GUARANTEE BADGE
       ======================================== */
    .product-guarantee {
        padding: 12px 0;
        margin-bottom: 16px;
        flex-direction: column;
        gap: 8px;
    }

    .guarantee-label {
        min-width: auto;
        font-size: 13px;
    }

    .guarantee-tag {
        padding: 4px 10px;
        font-size: 12px;
    }

    .guarantee-tag i {
        font-size: 11px;
    }

    /* ========================================
       VARIANTS - MOBILE OPTIMIZED
       ======================================== */
    .product-variants {
        margin-bottom: 20px;
        max-width: 100%;
        overflow: hidden;
    }

    .variant-header {
        margin-bottom: 10px;
    }

    .variant-label {
        font-size: 13px;
    }

    .variant-stock {
        font-size: 13px;
    }

    /* Variant container - Reduce max height for mobile */
    .variant-options-container {
        max-width: 100%;
        overflow-x: hidden;
    }

    .variant-options-container.scrollable {
        max-height: 200px;
    }

    /* Variant options - Maintain wrap layout */
    .variant-options {
        gap: 6px;
        max-width: 100%;
    }

    /* Variant buttons - Smaller for mobile */
    .variant-btn {
        padding: 7px 10px;
        font-size: 13px;
        gap: 8px;
        border-radius: 3px;
        max-width: 100%;
        word-wrap: break-word;
    }

    /* Mini preview image - Smaller */
    .variant-image-preview {
        width: 28px;
        height: 28px;
        border-radius: 2px;
        flex-shrink: 0;
    }

    .variant-stock-badge {
        font-size: 10px;
        padding: 2px 5px;
    }

    /* ========================================
       QUANTITY SELECTOR - COMPACT
       ======================================== */
    .product-quantity {
        margin-bottom: 16px;
    }

    .quantity-label {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .quantity-content {
        flex-direction: column;
        gap: 10px;
    }

    .quantity-selector {
        width: auto;
    }

    .quantity-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .quantity-input {
        width: 50px;
        height: 32px;
        font-size: 14px;
    }

    .quantity-stock {
        font-size: 12px;
    }

    /* ========================================
       ACTION BUTTONS - FULL WIDTH
       ======================================== */
    .product-actions {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 16px;
    }

    .btn-add-cart,
    .btn-buy-now {
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 3px;
    }

    .btn-add-cart i,
    .btn-buy-now i {
        font-size: 14px;
    }

    /* ========================================
       PRODUCT TABS
       ======================================== */
    .product-tabs {
        border-radius: 2px;
        margin-bottom: 12px;
        max-width: 100%;
        overflow: hidden;
    }

    .tab-headers {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        max-width: 100%;
    }

    .tab-headers::-webkit-scrollbar {
        display: none;
    }

    .tab-header {
        padding: 12px 16px;
        font-size: 14px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .tab-content {
        padding: 16px;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    /* ========================================
       PRODUCT DESCRIPTION
       ======================================== */
    .product-description {
        max-width: 100%;
        overflow-x: hidden;
    }

    .product-description h3 {
        font-size: 16px;
        margin: 0 0 12px;
        word-wrap: break-word;
    }

    .product-description p {
        font-size: 13px;
        line-height: 1.7;
        margin-bottom: 16px;
        word-wrap: break-word;
    }

    .product-description ul {
        padding-left: 16px;
        max-width: 100%;
    }

    .product-description li {
        font-size: 13px;
        line-height: 1.8;
        word-wrap: break-word;
    }

    /* ========================================
       PRODUCT SPECS
       ======================================== */
    .spec-item {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 12px 14px;
    }

    .spec-label {
        font-size: 13px;
        font-weight: 500;
    }

    .spec-value {
        font-size: 13px;
    }

    /* ========================================
       WHOLESALE MODAL
       ======================================== */
    .wholesale-modal-content {
        width: 95%;
        max-height: 85vh;
        border-radius: 6px;
    }

    .wholesale-modal-header {
        padding: 16px 18px;
    }

    .wholesale-modal-header h3 {
        font-size: 16px;
    }

    .wholesale-modal-close {
        width: 28px;
        height: 28px;
        font-size: 20px;
    }

    .wholesale-modal-body {
        padding: 18px;
    }

    /* Wholesale Table - Scrollable horizontally */
    .wholesale-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 12px;
    }

    .wholesale-table {
        min-width: 400px;
    }

    .wholesale-table th,
    .wholesale-table td {
        padding: 10px 12px;
        font-size: 12px;
    }

    .wholesale-table th {
        font-size: 11px;
    }

    .wholesale-note {
        padding: 10px 12px;
        font-size: 12px;
    }

    .wholesale-modal-footer {
        padding: 14px 18px;
    }

    .btn-close-modal {
        padding: 9px 20px;
        font-size: 13px;
    }
}

/* ========================================
   EXTRA SMALL DEVICES (< 480px)
   ======================================== */
@media (max-width: 480px) {
    .product-main {
        padding: 8px;
    }

    .product-images {
        margin-bottom: 10px;
    }

    /* Batasi tinggi main image lebih ketat di small screen */
    .main-image-container {
        max-height: 300px;
    }

    .product-name {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .product-price-section {
        padding: 10px;
        margin-bottom: 10px;
    }

    .product-price {
        font-size: 20px;
    }

    .original-price {
        font-size: 12px;
    }

    /* Image thumbnails - More compact */
    .image-thumbnails-wrapper {
        gap: 3px;
        margin-top: 6px;
    }

    .thumbnail {
        min-width: 45px;
        width: 45px;
        height: 45px;
    }

    .thumbnail-nav {
        width: 26px;
        height: 45px;
    }

    .thumbnail-nav i {
        font-size: 11px;
    }

    /* Variants - More compact */
    .variant-btn {
        padding: 6px 8px;
        font-size: 12px;
        gap: 6px;
    }

    .variant-image-preview {
        width: 24px;
        height: 24px;
    }

    /* Quantity selector */
    .quantity-btn {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .quantity-input {
        width: 45px;
        height: 30px;
        font-size: 13px;
    }

    /* Action buttons */
    .btn-add-cart,
    .btn-buy-now {
        padding: 10px 16px;
        font-size: 13px;
    }

    /* Tabs */
    .tab-header {
        padding: 10px 12px;
        font-size: 13px;
    }

    .tab-content {
        padding: 12px;
    }

    /* Description */
    .product-description h3 {
        font-size: 15px;
    }

    .product-description p,
    .product-description li {
        font-size: 12px;
    }

    /* Specs */
    .spec-item {
        padding: 10px;
    }

    .spec-label,
    .spec-value {
        font-size: 12px;
    }

    /* Wholesale Modal */
    .wholesale-modal-content {
        width: 96%;
    }

    .wholesale-modal-header,
    .wholesale-modal-body,
    .wholesale-modal-footer {
        padding: 12px;
    }

    .wholesale-modal-header h3 {
        font-size: 15px;
    }

    .wholesale-table {
        min-width: 350px;
    }

    .wholesale-table th,
    .wholesale-table td {
        padding: 8px 10px;
        font-size: 11px;
    }

    .wholesale-note {
        font-size: 11px;
        padding: 8px 10px;
    }
}

/* ========================================
   TOUCH-FRIENDLY ENHANCEMENTS
   ======================================== */
@media (max-width: 800px) {
    /* Ensure all clickable elements are at least 44x44px */
    .variant-btn {
        min-height: 40px; /* Slightly reduced but still touch-friendly */
    }

    .quantity-btn {
        min-width: 40px;
        min-height: 40px;
    }

    .btn-add-cart,
    .btn-buy-now {
        min-height: 44px;
    }

    /* Improve tap targets for links */
    .breadcrumb a,
    .wholesale-detail {
        padding: 6px 4px;
    }

    /* Modal close button */
    .wholesale-modal-close {
        min-width: 44px;
        min-height: 44px;
    }

    /* Tab headers */
    .tab-header {
        min-height: 44px;
    }

    /* Thumbnail navigation */
    .thumbnail-nav {
        min-height: 44px;
    }
}

/* ========================================
   IPHONE 6/7/8 SIZE (375px width)
   ======================================== */
@media (max-width: 375px) {
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    .product-detail-container {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    /* Extra compact untuk layar sangat kecil */
    .product-main {
        padding: 6px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .product-images {
        max-width: 100%;
        overflow: hidden;
    }

    .main-image-container {
        max-height: 280px;
        margin-bottom: 8px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .product-info {
        max-width: 100%;
        overflow-x: hidden;
    }

    .product-name {
        font-size: 15px;
        margin-bottom: 8px;
        word-wrap: break-word;
    }

    .product-price-section {
        padding: 8px;
        margin-bottom: 8px;
        max-width: 100%;
    }

    .product-price {
        font-size: 18px;
    }

    /* Thumbnails ultra compact */
    .image-thumbnails-wrapper {
        gap: 2px;
        max-width: 100%;
    }

    .image-thumbnails {
        gap: 2px;
        overflow-x: auto;
    }

    .thumbnail {
        min-width: 42px;
        width: 42px;
        height: 42px;
        flex-shrink: 0;
    }

    .thumbnail-nav {
        width: 24px;
        height: 42px;
        flex-shrink: 0;
    }

    /* Variants */
    .variant-btn {
        padding: 5px 7px;
        font-size: 11px;
    }

    .variant-image-preview {
        width: 22px;
        height: 22px;
    }

    /* Reduce all spacing */
    .product-wholesale,
    .product-shipping,
    .product-guarantee {
        padding: 10px 0;
        margin-bottom: 10px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .product-quantity {
        margin-bottom: 12px;
    }

    .product-actions {
        gap: 8px;
        margin-bottom: 12px;
    }

    .btn-add-cart,
    .btn-buy-now {
        padding: 9px 14px;
        font-size: 12px;
    }
}

/* ========================================
   MOBILE STYLES FOR ORDER_HISTORY.CSS
   Improved: No scroll tabs, better spacing
   Max-width: 800px
   ======================================== */

@media (max-width: 800px) {
    /* ========================================
       PREVENT HORIZONTAL SCROLL
       ======================================== */
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* ========================================
       CONTAINER
       ======================================== */
    .order-history-container {
        padding: 15px 0;
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* ========================================
       CONTENT LAYOUT - SINGLE COLUMN
       ======================================== */
    .order-history-content {
        grid-template-columns: 1fr;
        gap: 12px;
        max-width: 100%;
        padding: 0 10px;
    }

    /* ========================================
       SIDEBAR - COMPACT HORIZONTAL
       ======================================== */
    .order-sidebar {
        position: static;
        border-radius: 4px;
        max-width: 100%;
        overflow: hidden;
    }

    .sidebar-header {
        padding: 15px;
        gap: 10px;
    }

    .user-avatar {
        font-size: 40px;
    }

    .user-name {
        font-size: 13px;
    }

    .sidebar-menu {
        padding: 0;
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        border-top: 1px solid #efefef;
    }

    .sidebar-menu::-webkit-scrollbar {
        display: none;
    }

    .menu-item {
        flex: 0 0 auto;
        padding: 12px 16px;
        white-space: nowrap;
        font-size: 13px;
        border-right: none;
        border-bottom: 2px solid transparent;
    }

    .menu-item.active {
        border-right: none;
        border-bottom-color: #ee4d2d;
        background: white;
    }

    /* ========================================
       MAIN CONTENT
       ======================================== */
    .order-main {
        border-radius: 4px;
        max-width: 100%;
        overflow: hidden;
    }

    /* ========================================
       SEARCH BAR
       ======================================== */
    .order-search {
        padding: 12px;
        gap: 8px;
        flex-wrap: nowrap;
        max-width: 100%;
    }

    .search-input {
        padding: 10px 12px;
        font-size: 13px;
        min-width: 0;
        flex: 1;
    }

    /* ========================================
       TABS - 7 TABS WRAP (NO SCROLL!)
       ======================================== */
    .order-tabs {
        display: flex;
        flex-wrap: wrap;
        border-bottom: 2px solid #f5f5f5;
        overflow-x: visible !important;
        overflow-y: visible !important;
    }

    /* Hide scrollbar completely */
    .order-tabs::-webkit-scrollbar {
        display: none !important;
    }

    .tab-btn {
        flex: 0 0 auto;
        width: calc(50% - 1px); /* 2 tabs per row */
        padding: 11px 8px;
        font-size: 11px;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        border-right: 1px solid #f5f5f5;
        border-bottom: 2px solid transparent;
        margin-bottom: -2px;
    }

    /* Remove right border on even tabs */
    .tab-btn:nth-child(2n) {
        border-right: none;
    }

    /* Last tab takes full width if odd number */
    .tab-btn:last-child:nth-child(odd) {
        width: 100%;
        border-right: none;
    }

    .tab-btn.active {
        border-bottom-color: #ee4d2d;
        background: white;
        font-weight: 600;
    }

    /* ========================================
       ORDERS LIST - IMPROVED SPACING
       ======================================== */
    .orders-list {
        min-height: 300px;
        padding: 12px 0;
    }

    .loading-orders,
    .empty-orders {
        padding: 50px 15px;
    }

    .loading-orders i,
    .empty-orders i {
        font-size: 40px;
        margin-bottom: 12px;
    }

    /* ========================================
       ORDER ITEM - BETTER SPACING & BORDERS
       ======================================== */
    .order-item {
        max-width: 100%;
        overflow: hidden;
        margin: 0 10px 16px 10px !important;
        border: 1px solid #e0e0e0;
        border-radius: 6px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    }

    .order-item:last-child {
        margin-bottom: 12px !important;
    }

    .order-item:hover {
        box-shadow: 0 3px 6px rgba(0,0,0,0.12);
    }

    .order-header {
        padding: 12px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    }

    .order-info {
        width: 100%;
        gap: 6px;
    }

    .invoice-code,
    .order-date {
        font-size: 12px;
    }

    .invoice-code i,
    .order-date i {
        font-size: 13px;
    }

    .order-status {
        width: 100%;
        justify-content: flex-start;
    }

    .status-badge {
        padding: 5px 12px;
        font-size: 10px;
    }

    /* ========================================
       ORDER SUMMARY
       ======================================== */
    .order-summary {
        padding: 12px 15px;
        background: white;
    }

    .summary-row {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .summary-label i {
        font-size: 13px;
    }

    /* ========================================
       ORDER FOOTER
       ======================================== */
    .order-footer {
        padding: 12px 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        background: #fafafa;
    }

    .order-total {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 13px;
    }

    .order-total-label {
        margin-right: 0;
    }

    .order-total-value {
        font-size: 17px;
        font-weight: 700;
    }

    .order-actions {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .order-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 11px 16px;
        font-size: 13px;
    }

    /* ========================================
       ERROR MESSAGE
       ======================================== */
    .error-message {
        padding: 50px 15px;
    }

    .error-message i {
        font-size: 40px;
    }

    .retry-btn {
        font-size: 13px;
        padding: 9px 18px;
    }
}

/* ========================================
   EXTRA SMALL DEVICES (< 480px)
   ======================================== */
@media (max-width: 480px) {
    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    .order-history-container {
        padding: 12px 0;
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    .order-history-content {
        padding: 0 8px;
        gap: 10px;
    }

    /* Sidebar */
    .sidebar-header {
        padding: 12px;
    }

    .user-avatar {
        font-size: 36px;
    }

    .user-name {
        font-size: 12px;
    }

    .menu-item {
        padding: 10px 14px;
        font-size: 12px;
    }

    /* Search */
    .order-search {
        padding: 10px;
        gap: 6px;
    }

    .search-input {
        padding: 9px 10px;
        font-size: 12px;
    }

    /* Tabs - 2 per row, smaller size */
    .tab-btn {
        width: calc(50% - 1px);
        padding: 10px 6px;
        font-size: 10px;
    }

    /* Order Items - Even better spacing */
    .order-item {
        margin: 0 8px 14px 8px !important;
        border-radius: 5px;
    }

    .order-item:last-child {
        margin-bottom: 10px !important;
    }

    .order-header {
        padding: 10px 12px;
    }

    .invoice-code,
    .order-date {
        font-size: 11px;
    }

    .invoice-code i,
    .order-date i {
        font-size: 12px;
    }

    .status-badge {
        padding: 4px 10px;
        font-size: 9px;
    }

    .order-summary {
        padding: 10px 12px;
    }

    .summary-row {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .summary-label i {
        font-size: 12px;
    }

    .order-footer {
        padding: 10px 12px;
        gap: 10px;
    }

    .order-total {
        font-size: 12px;
    }

    .order-total-value {
        font-size: 16px;
    }

    .order-btn {
        padding: 10px 14px;
        font-size: 12px;
    }

    .loading-orders,
    .empty-orders,
    .error-message {
        padding: 40px 12px;
    }

    .loading-orders i,
    .empty-orders i,
    .error-message i {
        font-size: 36px;
    }

    .retry-btn {
        font-size: 12px;
        padding: 8px 16px;
    }
}

/* ========================================
   VERY SMALL DEVICES (≤ 375px)
   ======================================== */
@media (max-width: 375px) {
    .order-history-content {
        padding: 0 6px;
    }

    .sidebar-header {
        padding: 10px;
    }

    .user-avatar {
        font-size: 32px;
    }

    .menu-item {
        padding: 10px 12px;
        font-size: 11px;
    }

    .order-search {
        padding: 8px;
    }

    .search-input {
        padding: 8px 9px;
        font-size: 11px;
    }

    /* Tabs - still 2 per row but smaller */
    .tab-btn {
        width: calc(50% - 1px);
        padding: 9px 5px;
        font-size: 9px;
    }

    .order-item {
        margin: 0 6px 12px 6px !important;
    }

    .order-header {
        padding: 10px;
    }

    .invoice-code,
    .order-date {
        font-size: 10px;
    }

    .order-summary {
        padding: 10px;
    }

    .summary-row {
        font-size: 10px;
    }

    .order-footer {
        padding: 10px;
    }

    .order-total-value {
        font-size: 15px;
    }

    .order-btn {
        padding: 9px 12px;
        font-size: 11px;
    }
}

/* ========================================
   TOUCH-FRIENDLY ENHANCEMENTS
   ======================================== */
@media (max-width: 800px) {
    /* Ensure all clickable elements are touch-friendly */
    .menu-item {
        min-height: 44px;
    }

    .tab-btn {
        min-height: 42px;
    }

    .order-btn {
        min-height: 44px;
    }

    .retry-btn {
        min-height: 44px;
        min-width: 120px;
    }
}

/* ========================================
   FIX SPECIFIC OVERFLOW ISSUES
   ======================================== */
@media (max-width: 800px) {

    /* Force no overflow on critical elements */
    .order-main,
    .order-item,
    .order-header,
    .order-summary,
    .order-footer,
    .order-search {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Tabs container - absolutely no scroll */
    .order-tabs {
        max-width: 100%;
        overflow: visible !important;
    }

    /* Text elements should wrap */
    .invoice-code,
    .order-date,
    .summary-label,
    .summary-value {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Flex containers should not overflow */
    .order-info,
    .order-status,
    .order-actions,
    .summary-row {
        max-width: 100%;
        flex-wrap: wrap;
    }
}

/* ========================================
   LANDSCAPE ORIENTATION ADJUSTMENTS
   ======================================== */
@media (max-width: 800px) and (orientation: landscape) {
    .order-tabs {
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    /* In landscape, fit more tabs per row */
    .tab-btn {
        width: calc(33.33% - 1px); /* 3 tabs per row in landscape */
    }

    .tab-btn:nth-child(3n) {
        border-right: none;
    }

    /* Last tab adjustment for 7 tabs (3-3-1 layout) */
    .tab-btn:last-child {
        width: 100%;
    }
}

/* ========================================
   BETTER VISUAL SEPARATION
   ======================================== */
@media (max-width: 800px) {
    /* Add subtle divider between orders */
    .order-item::after {
        content: '';
        display: block;
        height: 1px;
        background: transparent;
    }

    /* Extra spacing for first and last items */
    .orders-list .order-item:first-child {
        margin-top: 4px;
    }

    .orders-list .order-item:last-child {
        margin-bottom: 16px !important;
    }
}