/* --- 1. GLOBAL CORE & DESKTOP CENTERING --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: #fcf8f9;
    color: #333;
    line-height: 1.5;
    display: flex;
    justify-content: center;
}

.app {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background-color: #ffffff; /* Marketplace floor is white */
    padding: 0;
    display: flex;
    flex-direction: column; /* Stacks children vertically */
    height: 100vh;          /* Locks to screen height */
    overflow: hidden;       /* Prevents the whole page from scrolling */
    position: relative;
}

main.products {
    flex: 1;                /* Forces the main area to fill the screen */
    overflow-y: auto;       /* Enables the scrollbar here */
    display: flex;
    flex-direction: column;
}

/* This targets the navigation area containing the back link */
nav {
    flex-shrink: 0; /* Prevents the header from squishing */
    position: sticky;
    top: 0;
    z-index: 100; /* Keeps it above the scrolling list */
    background-color: #ffe4e9; /* Light pink header */
    padding: 10px 15px;
    border-bottom: 1px solid #e57373;  
    box-shadow: 0 2px 5px rgb(0,0,0,0.05);
}

#cartTopTitle {
    flex-shrink: 0;
    margin: 0;
    padding: 10px 15px;
    background-color: #ffe4e9;
    z-index: 19;
}

/* --- THE CART FLOOR OVERRIDE --- */
.cart-page .app {
    background-color: #ffe4e9 !important;
}

/* --- 2. PRODUCTS PAGE (mp.html) --- */
/* body:not(.cart-page) {
    overflow-y: auto;
} */

#productList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    padding: 15px;
   }

.card {
    background: #fff;
    border-radius: 15px;
    padding: 12px;
    border: 1px solid #f0e4e8;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.card img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
}

.add-btn {
    background: #ffb7c5;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

/* --- 3. CART PAGE & SCROLL LOCK (cart.html) --- */
#cart {
    background: transparent !important; /* Let the pink show through */
    padding-bottom: 20px;
}

.cart-page {
    height: 100vh;
    overflow: hidden; /* Locks the background */
}

.cart-items {
    flex: 1; /* Forces this section to take all leftover space */
    overflow-y: auto; /* Enables scrolling for items only */
    display: flex;
    flex-direction: column;
    padding: 10px;
    background-color: transparent !important; /* Shows the pink floor */
    /* background-color: #ffe4e9; /* Keeps pink tray theme */
    border-radius: 25px 25px 0 0;
    border: 1px solid #fce4ec;
    box-shadow: inset 0 10px 20px rgba(255, 183, 197, 0.3);
    border-top: 1px solid #fce4ec;
}

/* Make the tray and list transparent so the pink floor shows through */
.cart-items, #cart {
    background-color: transparent !important;
}   
/* --- 4. THE BUTTON PROTECTION SYSTEM --- */
.cart-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #ffffff;
    border-radius: 18px;
    margin-bottom: 15px;
    gap: 12px;
    /* Stronger shadow for the 'floating' effect */
    box-shadow: 0 8px 15px rgba(255, 143, 163, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8); 
}

.item-info {
    flex: 1;
    min-width: 0; /* Allows name to truncate instead of squeezing buttons */
}

.item-info h4 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0; /* Prevents buttons from being squeezed */
}

/* --- 5. COMPONENT STYLES --- */
/* Quantity Buttons Base */
.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Specific Pastel Colors */
.qty-btn.minus { 
    background-color: #ffdfd3 !important; 
    color: #e57373 !important; 
}

.qty-btn.plus { 
    background-color: #d4f0f0 !important; 
    color: #4db6ac !important; 
}

/* Delete Button */
.remove-btn {
    background-color: #f5f5f5;
    color: #bbb;
    border: none;
    padding: 5px 12px;
    border-radius: 10px;
    font-weight: bold;
}

.cart-footer {
    flex-shrink: 0;         /* Prevents the buyer box from squishing */
    background-color: #ffffff;
    padding: 15px 0;
    border-top: 2px solid #ffccd5;
    z-index: 10;            /* Keeps it above the scrolling items */
}

.empty-state-container {
    margin: auto;           /* Centers the content vertically and horizontally */
    text-align: center;
    padding: 40px 20px;
}

.empty-state-container p {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #d63384;        /* A nice deep pink for the text */
}

.buyer-box {
    background: #fff;
    border: 2px solid #f8ecee;
    border-radius: 20px;
    padding: 15px;
}
/* --- Verified State for Buyer Information --- */
.buyer-box.verified {
    border-color: #4db6ac !important; /* Pastel Teal/Green border */
    box-shadow: 0 0 15px rgba(77, 182, 172, 0.3);
    position: relative;
    transition: all 0.4s ease;
}

.buyer-box.verified::after {
    content: '✓ Verified Customer';
    position: absolute;
    top: -12px;
    right: 20px;
    background: #4db6ac;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 10px;
    border-radius: 10px;
    text-transform: uppercase;
}

.btn-primary {
    /* Uses the teal from Verified badge for consistency */
    background: #4db6ac !important; 
    color: #ffffff;
    padding: 16px;
    border: none;
    border-radius: 30px;
    width: 100%;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    
    /* Soft, layered shadow for depth */
    box-shadow: 0 4px 15px rgba(77, 182, 172, 0.4);
    
    /* Smooth pop effect when clicking */
    transition: all 0.3s ease;
}
.btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(77, 182, 172, 0.3);
}
.btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 6px 20px rgba(77, 182, 172, 0.5);
}

/* Floating Action Button */
.cart-fab {
    position: absolute;
    bottom: 20px;
    right: 10px;
    width: 60px;
    height: 60px;
    /* Change to a semi-transparent dark or glass effect */
    background: rgba(51, 51, 51, 0.9); 
    backdrop-filter: blur(8px); /* Blurs products behind the button */
    
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 1000;
    
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;

    /* Subtle pulse glow for the cart button */
    box-shadow: 0 0 15px rgba(255, 183, 197, 0.4);
    animation: fabEntrance 0.5s ease-out;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(255, 143, 163, 0.5); /* Pinkish glow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
/* On wider screens (Desktop), we can move it even further out */
/* @media (min-width: 700px) {
    .cart-fab {
        right: -30px;
    }
}*/

.cart-fab:active {
    transform: scale(0.9); /* Squeezes slightly when clicked */
}

/* --- 7. ANIMATIONS & GLOWS --- */
.cart-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(255, 183, 197, 0.7);
}

@keyframes fabEntrance {
    from { transform: scale(0) rotate(-45deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

#cartCount {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff8fa3;
    color: white;
    font-size: 12px;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* Ensure the body of the cart page is transparent to show the .app pink */
.cart-page, .cart-page body {
    background-color: transparent !important;
}

/* Clear the white background from the container holding the items */
.cart-items {
    background-color: transparent !important;
    flex: 1;
}

/* Clear the white background from the list itself */
#cart {
    background-color: transparent !important;
}

/* KEEP the white on the cards so they pop against the pink */
.cart-row {
    background-color: #ffffff !important;
    border-radius: 18px;
    margin-bottom: 12px;
}

/* Custom Pink Scrollbar */
.cart-items::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track {
    background: transparent;
}

.cart-items::-webkit-scrollbar-thumb {
    background: #ffc1cc;
    border-radius: 10px;
}

/* --- TRACK ORDER PAGE --- */

.track-page {
    height: 100vh;
    overflow: hidden;
    background-color: #fcf8f9;
}

.track-app {
    background-color: #ffe4e9;
}

.track-header {
    flex-shrink: 0;
    background-color: #ffe4e9;
    border-bottom: 1px solid #e57373;
    padding: 14px 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.track-header h2 {
    color: #d63384;
    font-size: 1.35rem;
    margin-top: 6px;
}

.back-link {
    color: #d63384;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
}

.track-main {
    flex: 1;
    overflow-y: auto;
    padding: 18px 15px 30px;
}

.track-card,
.order-result-card {
    background: #ffffff;
    border: 1px solid #f0e4e8;
    border-radius: 20px;
    padding: 18px;
    box-shadow: 0 8px 15px rgba(255, 143, 163, 0.15);
    margin-bottom: 18px;
}

.track-card h1 {
    color: #333;
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.track-subtitle {
    color: #777;
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.track-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.track-form input {
    flex: 1;
    border: 1.5px solid #f0c8d2;
    border-radius: 16px;
    padding: 13px 14px;
    font-size: 1rem;
    outline: none;
    background: #fff;
}

.track-form input:focus {
    border-color: #ff8fa3;
    box-shadow: 0 0 0 3px rgba(255, 143, 163, 0.18);
}

.track-form .btn-primary {
    width: auto;
    padding: 13px 20px;
    border-radius: 18px;
    white-space: nowrap;
}

.order-result-card h3 {
    color: #d63384;
    margin-bottom: 14px;
}

.track-summary-table,
.track-items-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin-top: 12px;
    border-radius: 14px;
    overflow: hidden;
}

.track-summary-table th,
.track-summary-table td,
.track-items-table th,
.track-items-table td {
    border-bottom: 1px solid #f0e4e8;
    padding: 10px;
    text-align: left;
    font-size: 0.9rem;
}

.track-summary-table th,
.track-items-table th {
    background: #fff5f7;
    color: #d63384;
    font-weight: 700;
}

.track-items-table tbody tr:nth-child(even) {
    background: #fffafa;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    text-transform: capitalize;
    background: #e5e7eb;
    font-size: 0.8rem;
}

.status-badge.pending {
    color: #92400e;
    background: #fef3c7;
}

.status-badge.processing {
    color: #1d4ed8;
    background: #dbeafe;
}

.status-badge.shipped {
    color: #6d28d9;
    background: #ede9fe;
}

.status-badge.completed {
    color: #047857;
    background: #d1fae5;
}

.status-badge.cancelled {
    color: #b91c1c;
    background: #fee2e2;
}

.track-message {
    background: #ffffff;
    border: 1px solid #f0e4e8;
    border-radius: 16px;
    padding: 16px;
    color: #777;
    box-shadow: 0 8px 15px rgba(255, 143, 163, 0.12);
}

/* --- TRACK PAGE SCROLL LOCK REFINEMENT --- */

html,
body.track-page {
    height: 100%;
    overflow: hidden;
}

.track-page .app {
    height: 100vh;
    overflow: hidden;
}

.track-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.track-card {
    flex-shrink: 0;
}

#result {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

/* Optional: nice pink scrollbar for result area */
#result::-webkit-scrollbar {
    width: 6px;
}

#result::-webkit-scrollbar-track {
    background: transparent;
}

#result::-webkit-scrollbar-thumb {
    background: #ffc1cc;
    border-radius: 10px;
}

/* -- group orders by seller -- */
.track-page .seller-group-row td {
  padding: 16px 16px 8px;
  background: #ffffff;
  border-bottom: none;
}

.track-page .seller-group-card {
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff7fa;
  border: 1px solid #f1d5e1;
}

.track-page .seller-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #333;
}

.track-page .seller-group-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #d63384;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.track-page .seller-group-header strong {
  font-size: 0.95rem;
}

.track-page .seller-group-card .seller-contact-box {
  margin-top: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.track-page .seller-group-card .seller-contact-title {
  display: none;
}

.track-page .track-item-row td {
  border-bottom: 1px solid #ead6de;
}

/* Track page seller contact buttons */
.track-page .seller-contact-box {
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff7fa;
  border: 1px solid #f1d5e1;
}

.track-page .seller-contact-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #444;
  margin-bottom: 10px;
}

.track-page .seller-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.track-page .seller-contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 9px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  background: #ffffff;
  color: #22b8b0;
  border: 1px solid #22b8b0;
  transition: all 0.2s ease;
}

.track-page .seller-contact-btn:hover {
  background: #22b8b0;
  color: #ffffff;
}

.track-page .seller-contact-row td {
  padding-top: 0;
  padding-bottom: 16px;
  background: #ffffff;
  border-bottom: 1px solid #ead6de;
}

.track-page .seller-contact-cell {
  padding-left: 16px;
  padding-right: 16px;
}

/*--- Product reviews section ---*/

.review-form-box {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #f4b6c8;
  border-radius: 18px;
  background: #fff7fa;
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.review-form-box h4 {
  margin: 0;
  color: #333;
  font-size: 1rem;
}

.review-form-box label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: #444;
}

.review-form-box select,
.review-form-box textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #f1b6c7;
  border-radius: 12px;
  font: inherit;
  background: white;
}

.review-form-box textarea {
  resize: vertical;
  min-height: 90px;
}

.review-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.review-form-actions button {
  padding: 9px 14px;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  cursor: pointer;
}

#submitReviewBtn {
  background: #ff9fbd;
  color: white;
}

#cancelReviewBtn {
  background: #f3f4f6;
  color: #333;
}

.review-submitted-note,
.review-success-message {
  display: inline-block;
  margin-top: 8px;
  color: #0f766e;
  font-weight: 700;
}

.product-rating {
  margin: 6px 0 10px;
  font-size: 0.85rem;
}

.rating-stars {
  color: #facc15;
  letter-spacing: 1px;
  font-weight: 700;
}

.rating-summary {
  color: #666;
  margin-left: 4px;
}

.rating-empty {
  color: #888;
  font-size: 0.82rem;
}

/* --- Validation Styles --- */

.invalid-field {
    /* Standardizes the border across inputs and selects */
    border: 1.5px solid #e57373 !important; 
    
    /* Removes the blue/orange 'focus' glow browsers add */
    outline: none !important;
    box-shadow: none !important;
    
    /* Ensures the background doesn't shift when the border appears */
    box-sizing: border-box;
}

/* Specific fix for the Birth Month dropdown */
select.invalid-field {
    /* Prevents the OS from forcing its own styling on the red border */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    
    /* If you use appearance: none, you might need a custom arrow */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

/* --- MOBILE NATIVE LAYOUT PASS ---
   Desktop/tablet rules above remain the baseline. These overrides only affect phones. */
@media (max-width: 600px) {
  /* Global mobile shell: allow normal phone scrolling */
  html,
  body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
  }

  body {
    display: block;
    justify-content: initial;
    background-color: #ffe4e9;
  }

  .app {
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  main.products {
    flex: initial;
    min-height: 0;
    height: auto;
    overflow: visible;
    display: block;
  }

  nav {
    padding: 14px 16px;
  }

  h1 {
    font-size: 1.75rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.45rem;
    line-height: 1.25;
  }

  p,
  input,
  select,
  textarea,
  button {
    font-size: 1rem;
  }

  /* Product page: phone shop layout */
  #productList {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
  }

  .card {
    padding: 12px;
    border-radius: 16px;
  }

  .card img {
    height: 150px;
  }

  .card h3,
  .card h4,
  .card p {
    overflow-wrap: anywhere;
  }

  .add-btn {
    min-height: 44px;
    font-size: 0.95rem;
  }

  .cart-fab {
    position: fixed;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom));
  }

  /* Cart page: natural mobile checkout flow */
  .cart-page {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
    background-color: #ffe4e9;
  }

  .cart-page .app {
    height: auto;
    min-height: 100dvh;
    max-height: none;
    overflow: visible;
    background-color: #ffe4e9 !important;
  }

  #cartTopTitle {
    padding: 16px;
  }

  #cart {
    padding-bottom: 12px;
  }

  .cart-items {
    flex: initial;
    min-height: 0;
    max-height: none;
    height: auto;
    overflow: visible;
    padding: 12px;
    border-radius: 24px 24px 0 0;
  }

  .cart-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
    padding: 14px;
  }

  .item-info {
    width: 100%;
    min-width: 0;
  }

  .item-info h4 {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    overflow-wrap: anywhere;
    line-height: 1.25;
  }

  .cart-controls {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .qty-btn,
  .remove-btn {
    min-width: 44px;
    min-height: 44px;
    border-radius: 12px;
    font-size: 1rem;
  }

  .cart-footer {
    flex-shrink: initial;
    background-color: transparent;
    padding: 14px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    border-top: none;
    overflow: visible;
  }

  .buyer-box {
    padding: 16px;
    border-radius: 20px;
  }

  .buyer-box h2 {
    margin-bottom: 10px;
  }

  .buyer-box input,
  .buyer-box select,
  .buyer-box textarea {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    font-size: 16px;
    padding: 10px 12px;
    margin-bottom: 8px;
  }

  .buyer-box textarea {
    min-height: 90px;
  }

  .btn-primary {
    min-height: 48px;
    font-size: 1rem;
    margin-top: 12px;
  }

  /* Track page: natural scroll, larger text, mobile cards */
  html,
  body.track-page {
    height: auto;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .track-page {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
  }

  .track-page .app {
    height: auto;
    min-height: 100dvh;
    max-height: none;
    overflow: visible;
  }

  .track-header {
    padding: 18px 18px;
  }

  .back-link {
    font-size: 1rem;
  }

  .track-header h2 {
    font-size: 1.55rem;
    margin-top: 8px;
  }

  .track-main {
    display: block;
    flex: initial;
    overflow: visible;
    padding: 20px 12px 30px;
  }

  .track-card,
  .order-result-card {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding: 22px;
    border-radius: 22px;
  }

  .track-card h1 {
    font-size: 1.75rem;
    line-height: 1.2;
  }

  .track-subtitle {
    font-size: 1.05rem;
    line-height: 1.45;
  }

  .track-form input {
    min-width: 0;
    font-size: 1.05rem;
    padding: 15px 16px;
    min-height: 54px;
  }

  .track-form .btn-primary {
    font-size: 1rem;
    padding: 15px 20px;
    min-height: 54px;
  }

  #result {
    flex: initial;
    overflow: visible;
    padding-bottom: 20px;
  }

  .order-result-card h3,
  .order-result-card p,
  .order-result-card div {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .track-summary-table,
  .track-summary-table tbody,
  .track-summary-table tr,
  .track-summary-table th,
  .track-summary-table td {
    display: block;
    width: 100%;
  }

  .track-summary-table {
    border-radius: 16px;
  }

  .track-summary-table tr {
    padding: 12px 0;
    border-bottom: 1px solid #f0e4e8;
  }

  .track-summary-table th {
    background: transparent;
    border-bottom: none;
    padding: 0 0 4px;
    font-size: 0.85rem;
    color: #d63384;
  }

  .track-summary-table td {
    border-bottom: none;
    padding: 0;
    font-size: 1rem;
  }

  .track-items-table,
  .track-items-table thead,
  .track-items-table tbody,
  .track-items-table tr,
  .track-items-table th,
  .track-items-table td {
    display: block;
    width: 100%;
  }

  .track-items-table {
    background: transparent;
    border-radius: 0;
  }

  .track-items-table thead {
    display: none;
  }

  .track-items-table tbody tr,
  .track-page .track-item-row {
    background: #fff7fa;
    border: 1px solid #f1d5e1;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
  }

  .track-items-table tbody tr:nth-child(even) {
    background: #fff7fa;
  }

  .track-items-table td {
    border: none;
    padding: 4px 0;
    font-size: 1rem;
    overflow-wrap: anywhere;
  }

  .track-items-table td:nth-child(1) {
    display: none;
  }

  .track-items-table td:nth-child(2)::before {
    content: "Product: ";
    font-weight: 700;
    color: #d63384;
  }

  .track-items-table td:nth-child(3)::before {
    content: "Qty: ";
    font-weight: 700;
    color: #d63384;
  }

  .track-items-table td:nth-child(4)::before {
    content: "Price: ";
    font-weight: 700;
    color: #d63384;
  }

  .track-items-table td:nth-child(5)::before {
    content: "Subtotal: ";
    font-weight: 700;
    color: #d63384;
  }

  .track-page .seller-contact-row td,
  .track-page .seller-contact-cell {
    display: block;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .track-page .seller-contact-box {
    margin-top: 12px;
  }

  .track-page .seller-contact-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .track-page .seller-contact-btn {
    min-width: 0;
    width: 100%;
    min-height: 44px;
  }

  .review-form-box {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 430px) {
  .track-form {
    flex-direction: column;
    align-items: stretch;
  }

  .track-form input,
  .track-form .btn-primary {
    width: 100%;
  }
}

@media (max-width: 360px) {
  #productList {
    grid-template-columns: 1fr;
  }

  .track-page .seller-contact-actions {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   BUYER APP - MOBILE LANDSCAPE FIXES ONLY
   Applies to phones/tablets in landscape.
   Does not affect normal desktop or portrait.
========================================= */

@media (max-width: 920px) and (orientation: landscape) {
  html,
  body {
    height: auto !important;
    min-height: 100% !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body {
    position: static !important;
  }

  main,
  .main,
  .app,
  .app-shell,
  .page,
  .page-wrap,
  .container,
  .cart-page,
  .cart-container,
  .checkout-page,
  .checkout-container,
  .track-page,
  .track-container,
  .track-wrapper,
  .order-page {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
  }
}

/* BUYER APP - MOBILE LANDSCAPE CART FAB FIX */
@media (max-width: 920px) and (orientation: landscape) {
  .cart-fab,
  #cartFab,
  .floating-cart,
  .cart-floating-btn,
  .cart-button-floating {
    position: fixed !important;
    right: max(14px, env(safe-area-inset-right)) !important;
    bottom: max(18px, env(safe-area-inset-bottom)) !important;
    z-index: 9999 !important;

    width: 54px !important;
    height: 54px !important;
    min-width: 54px !important;
    min-height: 54px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    transform: none !important;
  }
}

/* =========================================
   BUYER APP - MOBILE LANDSCAPE KEYBOARD FIX
   Light version: avoids huge blank spaces.
========================================= */

@media (max-width: 920px) and (orientation: landscape) {
  input,
  select,
  textarea {
    font-size: 16px !important;
    scroll-margin-top: 80px !important;
    scroll-margin-bottom: 32px !important;
  }

  .cart-page,
  .cart-container,
  .checkout-page,
  .checkout-container,
  .track-page,
  .track-container {
    padding-bottom: 32px !important;
  }
}

/* BUYER APP - REVIEW FORM LANDSCAPE FIX */
@media (max-width: 920px) and (orientation: landscape) {
  .review-form,
  #reviewForm,
  .review-card,
  .review-box {
    max-height: none !important;
    overflow: visible !important;
    padding: 14px !important;
    margin-bottom: 32px !important;
  }

  .review-form textarea,
  #reviewForm textarea,
  .review-card textarea,
  .review-box textarea {
    min-height: 70px !important;
    max-height: 90px !important;
    font-size: 16px !important;
    resize: vertical;
  }

  .review-form input,
  .review-form select,
  .review-form textarea,
  #reviewForm input,
  #reviewForm select,
  #reviewForm textarea {
    font-size: 16px !important;
  }

  .review-actions,
  .review-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .review-actions button,
  .review-buttons button {
    flex: 1 1 120px !important;
    min-width: 0 !important;
    padding: 9px 12px !important;
  }
}

@media (max-width: 920px) and (orientation: landscape) {
  .review-form h3,
  #reviewForm h3,
  .review-card h3,
  .review-box h3 {
    font-size: 1.1rem !important;
    margin-bottom: 8px !important;
  }

  .review-form p,
  #reviewForm p,
  .review-card p,
  .review-box p {
    font-size: 0.9rem !important;
    margin-bottom: 8px !important;
  }
}