

/* Mobile: input + button side-by-side */
@media (max-width: 768px){
  .category-controls{
    display:flex;
    align-items:center;
    gap: 10px;
  }

  .category-controls .search-box{
    flex: 1 1 auto;        /* grow to fill */
  }
  .category-controls .search-box input{
    width: 100%;
    height: 44px;          /* comfy tap target */
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    min-width: 280px;      /* prevent shrinking too far on wider phones */
  }

  #bulk-delete-btn.btn-red{
    flex: 0 0 auto;        /* keep natural width */
    height: 35px;
    padding: 0 12px;
    border-radius: 10px;
    white-space: nowrap;   /* prevent wrapping on tiny screens */
  }
}

/* Optional: ultra-narrow phones – let items wrap if needed */
@media (max-width: 360px){
  .category-controls{ flex-wrap: wrap; }
  #bulk-delete-btn.btn-red{ width: 100%; }
}


@media (min-width: 769px){
  .category-controls{ display: grid; grid-template-columns: 1fr auto; gap: 16px; }
}






/* Mobile: 2-up product cards with overlay actions */
@media (max-width: 768px){
  .product-cards{
    display:grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap:12px;
    padding-top:8px;
  }
  .product-card{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 1px 2px rgba(0,0,0,.04);
  }
  .product-card .thumb{
    position:relative;
    aspect-ratio: 1 / 1;
    background:#f3f4f6;
  }
  .product-card .thumb img{
    width:100%; height:100%; object-fit:cover; display:block;
  }
  .product-card .actions{
    position:absolute; right:8px; bottom:8px;
    display:flex; gap:6px; flex-wrap:wrap;
  }
  .product-card .icon-btn{
    width:36px; height:36px; display:grid; place-items:center;
    border:1px solid #e5e7eb; border-radius:10px; background:#fff;
    font-size:16px; line-height:1;
  }
  .product-card .body{
    padding:10px 12px; display:grid; gap:6px;
  }
  .product-card .name{ font-weight:700; font-size:14px; line-height:1.25; }
  .product-card .meta{ display:flex; align-items:center; gap:8px; }
  .product-card .price{ font-weight:700; }
  .product-card .status{ font-size:12px; color:#6b7280; }
  .empty-state{ padding:12px; color:#6b7280; text-align:center; }
}

/* Ultra-small phones: single column */
@media (max-width: 380px){
  .product-cards{ grid-template-columns: 1fr; }
}







/* Mobile cards (2 per row) */
@media (max-width: 768px){
  .product-cards{
    display:grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap:12px;
    padding-top:8px;
  }
  .product-card{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 1px 2px rgba(0,0,0,.04);
  }
  .product-card .thumb{ position:relative; aspect-ratio:1 / 1; background:#f3f4f6; overflow:hidden; }
  .product-card .thumb img{ width:100%; height:100%; object-fit:cover; display:block; }

  /* Vertical icon grid on image: 3 per column, wraps to new column */
  .product-card .actions{
    position:absolute; top:8px; right:8px;
    display:grid;
    grid-template-rows: repeat(3, 36px);
    grid-auto-flow: column;
    grid-auto-columns: min-content;
    gap:6px;
    align-content:start;
    justify-items:stretch;
    max-width: calc(100% - 16px);
    pointer-events:auto;
  }
  .product-card .icon-btn{
    width:36px; height:36px; display:grid; place-items:center;
    border:1px solid #e5e7eb; border-radius:10px; background:#fff;
    font-size:0; /* hide any accidental text */
  }
  .product-card .icon-btn i{ font-size:16px; }

  /* Center text below */
  .product-card .body{ text-align:center; display:grid; gap:6px; padding:10px 12px; }
  .product-card .name{ font-weight:700; font-size:14px; line-height:1.25; }
  .product-card .meta{ display:inline-grid; justify-items:center; gap:4px; }
  .product-card .status{ font-size:12px; color:#6b7280; }
  .product-card .price{ font-weight:700; }

  .empty-state{ padding:12px; color:#6b7280; text-align:center; }
}

/* Ultra-small phones: compact buttons */
@media (max-width: 380px){
  .product-card .actions{ grid-template-rows: repeat(3, 32px); gap:5px; }
  .product-card .icon-btn{ width:32px; height:32px; }
  .product-card .icon-btn i{ font-size:15px; }
}



.btn-toggle i,
.btn-feature i,
.btn-manage i,
.btn-delete i,
.btn-preview i {
  font-size: 16px !important;
  line-height: 1;
  display: inline-block;
}







/* Mobile card grid */
@media (max-width: 768px){
  .product-cards{
    display:grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap:12px;
    padding-top:8px;
  }
  .product-card{ background:#fff; border:1px solid #e5e7eb; border-radius:12px; overflow:hidden; box-shadow:0 1px 2px rgba(0,0,0,.04); }
  .product-card .thumb{ position:relative; aspect-ratio:1/1; background:#f3f4f6; overflow:hidden; }
  .product-card .thumb img{ width:100%; height:100%; object-fit:cover; display:block; }

  /* Icon rail: 3 per column, wraps to a new column INSIDE the image */
  .product-card .actions{
    position:absolute; top:8px; right:8px;
    display:grid; grid-template-rows: repeat(3, 36px);
    grid-auto-flow: column; grid-auto-columns: min-content;
    gap:5px; align-content:start; justify-items:stretch; z-index:2;
    max-width: calc(100% - 16px);
  }
  .product-card .icon-btn{
    all: unset;
    display:flex; align-items:center; justify-content:center;
    width:25px; height:25px; background:#fff; color:#111827;
    border:1px solid #e5e7eb; border-radius:10px; box-shadow:0 1px 2px rgba(0,0,0,.04);
    cursor:pointer; font-size:0;
  }
  .product-card .icon-btn i{ font-size:16px; line-height:1; display:block; }

  /* Center text under image */
  .product-card .body{ text-align:center; display:grid; gap:6px; padding:10px 12px; }
  .product-card .name{ font-weight:700; font-size:14px; line-height:1.25; }
  .product-card .meta{ display:inline-grid; justify-items:center; gap:4px; }
  .product-card .status{ font-size:12px; color:#6b7280; }
  .product-card .price{ font-weight:700; }

  /* Optional state colors */
  .product-card .btn-delete i{ color:#ef4444; }
  .product-card .btn-manage i{ color:#4f46e5; }
  .product-card .btn-preview i{ color:#111827; }
  .product-card .btn-toggle.is-on i{ color:#10b981; }
  .product-card .btn-toggle.is-off i{ color:#9ca3af; }
  .product-card .btn-feature.is-featured{ background:#fff7ed; border-color:#fed7aa; }
  .product-card .btn-feature.is-featured i{ color:#f59e0b; }
}

/* Ultra-small phones */
@media (max-width: 380px){
  .product-card .actions{ grid-template-rows: repeat(3, 32px); gap:5px; }
  .product-card .icon-btn{ width:32px; height:32px; }
  .product-card .icon-btn i{ font-size:15px; }
}




/* make FA icons show even if parent sets font-size:0 */
.btn-toggle i,
.icon-btn i,
.tbl-actions .btn i,
.btn i {
  font-size: 16px !important;
  line-height: 1;
  display: inline-block;
}








/* ===== Coupon filter: mobile-first, centered ===== */

.coupon-filter-form{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;   /* center all items */
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0 auto;
  padding: 6px 0;
}

.coupon-filter-form .coupon-search-input{
  flex: 1 1 100%;
  max-width: 540px;          /* keeps it neat on tablets */
  height: 44px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.coupon-filter-form .btn{
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  white-space: nowrap;
}

/* Optional: make buttons same width for symmetry on tiny phones */
@media (max-width: 420px){
  .coupon-filter-form .btn{
    flex: 0 0 140px;         /* both buttons equal width */
    text-align: center;
  }
}

/* Tablet+ : inline row (input + buttons) still centered */
@media (min-width: 768px){
  .coupon-filter-form{
    flex-wrap: nowrap;
  }
  .coupon-filter-form .coupon-search-input{
    flex: 0 1 420px;         /* comfortable input width */
  }
}






/* ===== Deals filter: mobile-first, centered ===== */

.deal-filter-form{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;      /* center all items */
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0 auto;
  padding: 6px 0;
}

.deal-filter-form .deal-search-input{
  flex: 1 1 100%;
  max-width: 540px;             /* caps width on tablets */
  height: 44px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

/* Buttons */
.deal-filter-form .btn{
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  white-space: nowrap;
}

/* Tiny phones: make buttons equal width for a tidy row */
@media (max-width: 420px){
  .deal-filter-form .btn{
    flex: 1 1 140px;            /* two buttons share the line */
    text-align: center;
  }
}

/* Tablet+ : keep items in one centered row */
@media (min-width: 768px){
  .deal-filter-form{
    flex-wrap: nowrap;
  }
  .deal-filter-form .deal-search-input{
    flex: 0 1 420px;
  }
}










/* ================================
   Customers table — Mobile dropdown
   Header = Name + Username only
   ================================ */
@media (max-width: 768px){

  /* Hide table head for compact cards */
  .customer-table thead { display: none; }

  /* Each row becomes a card-like block */
  .customer-table tbody tr{
    display: block;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    margin: 10px 0;
    background: #fff;
    overflow: hidden;
  }

  /* Base cell look */
  .customer-table tbody td{
    display: block;
    padding: 10px 12px;
    border: 0;
    white-space: normal;
  }

  /* ---------- Header content (visible) ---------- */
  /* 3: Name (big) */
  .customer-table tbody tr > td:nth-child(3){
    font-weight: 700;
    font-size: 15px;
    line-height: 1.3;
  }

  /* 4: Username (muted, under name) */
  .customer-table tbody tr > td:nth-child(4){
    color: #6b7280;
    font-size: 13px;
    margin-top: 2px;
  }

  /* Center the header block if you prefer centered look */
  .customer-table tbody tr > td:nth-child(3),
  .customer-table tbody tr > td:nth-child(4){
    text-align: center;
  }

  /* Add a subtle divider before dropdown content */
  .customer-table tbody tr::after{
    content: "";
    display: block;
    height: 1px;
    background: #f0f0f0;
    margin: 6px 12px 0;
  }




  @media (max-width: 768px){
  /* Stop using :active / :focus-within for expand */
  .customer-table tbody tr > td:nth-child(1),
  .customer-table tbody tr > td:nth-child(2),
  .customer-table tbody tr > td:nth-child(5),
  .customer-table tbody tr > td:nth-child(6),
  .customer-table tbody tr > td:nth-child(7),
  .customer-table tbody tr > td:nth-child(8),
  .customer-table tbody tr > td:nth-child(9){
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    transition: max-height .25s ease, opacity .2s ease, padding .2s ease;
  }

  /* Persist open when .row-open is present */
  .customer-table tbody tr.row-open > td:nth-child(1),
  .customer-table tbody tr.row-open > td:nth-child(2),
  .customer-table tbody tr.row-open > td:nth-child(5),
  .customer-table tbody tr.row-open > td:nth-child(6),
  .customer-table tbody tr.row-open > td:nth-child(7),
  .customer-table tbody tr.row-open > td:nth-child(8),
  .customer-table tbody tr.row-open > td:nth-child(9){
    max-height: 220px;     /* roomy enough */
    opacity: 1;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  /* Make the whole row obviously tappable: add a chevron */
  .customer-table tbody tr{ position: relative; }
  .customer-table tbody tr::before{
    content: "▾";
    position: absolute;
    right: 12px;
    top: 10px;
    font-size: 16px;
    color: #9ca3af;
    transition: transform .2s ease, color .2s ease;
    pointer-events: none;
  }
  .customer-table tbody tr.row-open::before{
    transform: rotate(180deg);
    color: #6b7280;
  }

  /* Keep only Name + Username visible in the header (as before) */
  .customer-table thead{ display:none; }
  .customer-table tbody tr{
    display:block; border:1px solid #e6e6e6; border-radius:10px; margin:10px 0; background:#fff; overflow:hidden;
  }
  .customer-table tbody td{ display:block; padding:10px 12px; border:0; white-space:normal; }

  .customer-table tbody tr > td:nth-child(3){ /* Name */
    font-weight:700; font-size:15px; line-height:1.3; text-align:center;
    padding-right:34px; /* room for chevron */
  }
  .customer-table tbody tr > td:nth-child(4){ /* Username */
    color:#6b7280; font-size:13px; text-align:center; margin-top:2px;
    padding-right:34px;
  }

  /* Labels for dropdown fields */
  .customer-table tbody tr > td:nth-child(1)::before{ content:"ID"; }
  .customer-table tbody tr > td:nth-child(2)::before{ content:"Joined"; }
  .customer-table tbody tr > td:nth-child(5)::before{ content:"Email"; }
  .customer-table tbody tr > td:nth-child(6)::before{ content:"Phone"; }
  .customer-table tbody tr > td:nth-child(7)::before{ content:"Status"; }
  .customer-table tbody tr > td:nth-child(8)::before{ content:"Verified"; }
  .customer-table tbody tr > td:nth-child(9)::before{ content:"Actions"; }

  .customer-table tbody tr > td:nth-child(1)::before,
  .customer-table tbody tr > td:nth-child(2)::before,
  .customer-table tbody tr > td:nth-child(5)::before,
  .customer-table tbody tr > td:nth-child(6)::before,
  .customer-table tbody tr > td:nth-child(7)::before,
  .customer-table tbody tr > td:nth-child(8)::before,
  .customer-table tbody tr > td:nth-child(9)::before{
    display:block; font-size:12px; font-weight:600; color:#6b7280; margin-bottom:4px;
  }

  /* Actions centered when revealed */
  .customer-table tbody tr > td:nth-child(9){ text-align:center; }
  .customer-table tbody tr > td:nth-child(9) .btn{
    margin: 0 4px 6px; padding: 6px 10px; font-size:12px; border-radius:8px;
  }

  /* Filter bar centered on mobile */
  .customer-filter-form{ justify-content:center; margin-top: -40px;}
  #customerSearchInput{ flex:1 1 100%; max-width:560px; height:44px; }
  .customer-filter-form .btn{ height:30px; width: 100%; flex-basis: max-content;}

  .customer-box-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding-top: 14px;
  }

  .pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-bottom: 15px;
}

.btn-pagination {
  padding: 6px 12px;
  font-size: 0.9rem;
  border: none;
  background-color: #007bff;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-pagination:hover {
  background-color: #0056b3;
}

}








/* ===== Orders: stats grid → 2 per row on mobile ===== */
@media (max-width: 768px){
  .statbox-olsm{
    padding: 12px;
  }

  .statbox-grid-olsm{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 per row */
    gap: 12px;
  }

  .metric-card-olsm{
    padding: 12px;
    min-height: 88px;               /* keeps cards visually even */
    border-radius: 10px;
  }

  .metric-icon-olsm{
    margin-right: 10px;
    padding: 0.55rem;               /* slightly smaller circle */
  }

  .metric-icon-olsm i{
    width: 18px; height: 18px;      /* feather icons scale down a touch */
  }

  .metric-label-olsm{
    font-size: 13px;
    margin-bottom: 2px;
  }

  .metric-value-olsm{
    font-size: 1.2rem;
  }
}

/* Ultra-small phones: fall back to 1 per row */
@media (max-width: 380px){
  .statbox-grid-olsm{
    grid-template-columns: 1fr;
  }
}



/* ===== FORCE 2-per-row metrics on mobile ===== */
@media (max-width: 768px){
  .order-card-olsm .statbox-olsm .statbox-grid-olsm{
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important; /* <-- 2 columns */
    gap: 12px !important;
  }

  /* make sure nothing inside forces a wider column */
  .order-card-olsm .metric-card-olsm{
    min-width: 0 !important;
    padding: 12px;
    border-radius: 10px;
  }
  .order-card-olsm .metric-card-olsm > *{ min-width: 0; }
  .order-card-olsm .metric-label-olsm,
  .order-card-olsm .metric-value-olsm{ overflow-wrap: anywhere; font-size: x-small;}

  .order-card-olsm .metric-icon-olsm{ margin-right: 10px; padding: .55rem; }
  .order-card-olsm .metric-icon-olsm i{ width: 18px; height: 18px; }
}


/* ===== Inputs/Selects: 2 per row on mobile ===== */
@media (max-width: 768px){
  .order-card-olsm .order-filters-olsm .input-olsm,
  .order-card-olsm .order-filters-olsm .select-olsm{
    width: auto !important;                 /* override fixed 325px */
    flex: 1 1 calc(50% - 10px) !important;  /* two per row (gap is 10px) */
    min-width: 0;                            /* prevent overflow */
  }
}

/* Ultra-small phones: 1 per row */
@media (max-width: 380px){
  .order-card-olsm .order-filters-olsm .input-olsm,
  .order-card-olsm .order-filters-olsm .select-olsm{
    flex: 1 1 100% !important;
  }


  .input-olsm {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    flex: 1 1 160px;
    width: 325px;
  }


}










/* ===== Cart page — mobile layout ===== */
@media (max-width: 768px){
  .cart-wrapper-cust{ padding:12px; }

  /* Header: stack title + button row */
  .cart-wrapper-cust .cart-header-cust{
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px;
  }
  .cart-wrapper-cust .cart-title-cust{
    font-size: 18px;
    text-align: center;
    margin: 0;
  }
  .cart-wrapper-cust .cart-header-cust .d-flex.gap-2{
    gap: 10px !important;
    /* flex-wrap: wrap; */
    justify-content: center;
  }
  /* If you prefer horizontal scroll for many buttons, uncomment:
  .cart-wrapper-cust .cart-header-cust .d-flex.gap-2{
    flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px;
  }
  .cart-wrapper-cust .cart-header-cust .d-flex.gap-2 > *{ flex: 0 0 auto; }
  */

  .cart-wrapper-cust .btn-cust{
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px;
  }

  /* Metrics: 2 per row */
  .cart-wrapper-cust .cart-metrics-cust{ padding: 8px 0; }
  .cart-wrapper-cust .cart-grid-cust{
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 12px !important;
  }
  .cart-wrapper-cust .cart-card-cust{
    display: flex; align-items: center;
    gap: 0px;
    padding: 12px;
    border: 1px solid #e5e7eb; border-radius: 12px; background:#fff;
    min-height: 88px;
  }
  .cart-wrapper-cust .cart-icon-cust{
    background:#f2f4f8; border-radius: 50%; padding: 0px; display:flex; align-items:center; justify-content:center;
  }
  .cart-wrapper-cust .cart-icon-cust i{ width:18px; height:18px; }

  .cart-wrapper-cust .cart-label-cust{ font-size:13px; margin-bottom:2px; color:#666; }
  .cart-wrapper-cust .cart-value-cust{ font-size:0.9rem; font-weight:600; color:#222; }

  /* Filters: 2 controls per row; centered */
  .cart-wrapper-cust .cart-filters-cust{
    display:flex; flex-wrap: wrap; gap:10px; justify-content:center; margin-top: 8px;
  }
  .cart-wrapper-cust .cart-filters-cust .input-cust,
  .cart-wrapper-cust .cart-filters-cust .select-cust,
  .cart-wrapper-cust .cart-filters-cust .btn-cust{
    width: auto !important;
    flex: 1 1 calc(50% - 10px) !important;  /* 2 per row */
    min-width: 0; height: 44px;
    border-radius: 10px;
  }
  .cart-wrapper-cust .filter-btn-cust,
  .cart-wrapper-cust .reset-btn-cust{ text-align:center; }

  /* Tight icon alignment inside Download button */
  .cart-wrapper-cust .download-btn-cust i{ margin-right:6px; }

  /* Make long placeholders/text wrap and not push layout */
  .cart-wrapper-cust .cart-card-cust > *{ min-width:0; }
  .cart-wrapper-cust .cart-meta-cust{ min-width:0; }
}

/* Ultra-small phones: 1 per row for metrics & filters */
@media (max-width: 380px){
  .cart-wrapper-cust .cart-grid-cust{
    grid-template-columns: 1fr !important;
  }
  .cart-wrapper-cust .cart-filters-cust .input-cust,
  .cart-wrapper-cust .cart-filters-cust .select-cust,
  .cart-wrapper-cust .cart-filters-cust .btn-cust{
    flex: 1 1 100% !important;
  }
}




/* ===== Cart table → mobile cards (no markup change) ===== */
@media (max-width: 768px){
  .cart-table-wrap-cust{ overflow: visible; border: 0; }

  /* Hide header */
  .cart-table-cust thead{ display:none; }

  /* Card rows */
  .cart-table-cust tbody tr{
    display: grid;
    gap: 8px;
    padding: 12px;
    margin: 10px 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    grid-template-columns: 1fr auto; /* text | small meta */
    grid-template-areas:
      "product product"
      "email   email"
      "qty     price"
      "total   status"
      "id      id"
      "actions actions";
  }

  /* Reset table cells to flexible blocks */
  .cart-table-cust tbody td{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  /* Map columns to areas:
     1: ID, 2: PRODUCT, 3: EMAIL, 4: QTY, 5: PRICE, 6: TOTAL, 7: STATUS, 8: ACTION
  */
  .cart-table-cust tbody td:nth-child(1){ grid-area: id;     color:#6b7280; font-size:12px; justify-content:flex-end; }
  .cart-table-cust tbody td:nth-child(2){ grid-area: product; font-weight:700; font-size:15px; line-height:1.3; }
  .cart-table-cust tbody td:nth-child(3){ grid-area: email;   word-break: break-all; color:#374151; }
  .cart-table-cust tbody td:nth-child(4){ grid-area: qty; }
  .cart-table-cust tbody td:nth-child(5){ grid-area: price; font-weight:600; }
  .cart-table-cust tbody td:nth-child(6){ grid-area: total; font-weight:700; }
  .cart-table-cust tbody td:nth-child(7){ grid-area: status; justify-content:flex-end; }
  .cart-table-cust tbody td:nth-child(8){ grid-area: actions; justify-content:flex-end; gap:6px; flex-wrap:wrap; }

  /* Inline labels for clarity (no HTML change) */
  .cart-table-cust tbody td:nth-child(1)::before{ content:"ID";        margin-right:6px; color:#9ca3af; font-weight:600; }
  .cart-table-cust tbody td:nth-child(3)::before{ content:"Email";     color:#6b7280; font-weight:600; }
  .cart-table-cust tbody td:nth-child(4)::before{ content:"Quantity";  color:#6b7280; font-weight:600; }
  .cart-table-cust tbody td:nth-child(5)::before{ content:"Price";     color:#6b7280; font-weight:600; }
  .cart-table-cust tbody td:nth-child(6)::before{ content:"Total";     color:#6b7280; font-weight:600; }
  .cart-table-cust tbody td:nth-child(7)::before{ content:"Status";    color:#6b7280; font-weight:600; margin-right:6px; }

  /* Product title: center and allow wrap */
  .cart-table-cust tbody td:nth-child(2){
    text-align:center; display:block;
  }

  /* Actions row: buttons tidy + responsive */
  .cart-table-cust tbody td:nth-child(8) .btn,
  .cart-table-cust tbody td:nth-child(8) .btn-cust{
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
  }

  /* Pills look good on mobile */
  .status-pill-olsm,
  .payment-pill-olsm{
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
  }
}

/* Ultra-small phones: tighten and avoid overflow */
@media (max-width: 380px){
  .cart-table-cust tbody tr{ gap:6px; padding:10px; }
  .cart-table-cust tbody td:nth-child(2){ font-size:14px; }
  .cart-table-cust tbody td:nth-child(3){ word-break:anywhere; }
}








/* ===== Shipping Manager — Mobile layout ===== */
@media (max-width: 768px){
  /* Card padding */
  .shipping-box { padding: 12px; }

  /* Header stacks, buttons wrap & center */
  .shipping-box-header{
    display:flex; flex-direction:column; align-items:stretch; gap:10px;
  }
  .shipping-box-title{ font-size:18px; text-align:center; margin:0 !important; }
  .shipping-btn-set{
    display:flex; flex-wrap:wrap; gap:8px; justify-content:center;
  }
  .shipping-btn-set .btn{ border-radius:10px; }

  /* Filter form: centered, 2 per row */
  .shipping-filter-form{
    display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-bottom:16px;
  }
  .shipping-filter-form #shippingSearchInput,
  .shipping-filter-form .btn{
    width:auto !important;
    height:44px;
    border-radius:10px;
    /* flex:1 1 calc(50% - 10px);     two per row */
    min-width:0;
  }

  /* Table → Card rows */
  .shipping-table-wrapper{ margin-top:12px !important; overflow:visible; border:0; }
  .shipping-table thead{ display:none; }

  .shipping-table tbody tr{
    display:grid;
    gap:8px;
    padding:12px;
    margin:10px 0;
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:12px;
    box-shadow:0 1px 2px rgba(0,0,0,.04);
    grid-template-columns:1fr 1fr;
    grid-template-areas:
      "route   route"
      "country state"
      "eta     price"
      "status  id"
      "actions actions";
  }
  .shipping-table tbody td{
    display:block;
    padding:0; border:0; white-space:normal;
  }

  /* Map columns (1:ID, 2:Country, 3:State, 4:Route, 5:ETA, 6:Price, 7:Status, 8:Actions) */
  .shipping-table tbody td:nth-child(4){ grid-area: route;  font-weight:700; font-size:15px; }
  .shipping-table tbody td:nth-child(2){ grid-area: country; }
  .shipping-table tbody td:nth-child(3){ grid-area: state; }
  .shipping-table tbody td:nth-child(5){ grid-area: eta; }
  .shipping-table tbody td:nth-child(6){ grid-area: price; font-weight:600; }
  .shipping-table tbody td:nth-child(7){ grid-area: status; }
  .shipping-table tbody td:nth-child(1){ grid-area: id; color:#6b7280; font-size:12px; text-align:right; }
  .shipping-table tbody td:nth-child(8){ grid-area: actions; display:flex; justify-content:flex-end; gap:6px; flex-wrap:wrap; }

  /* Field labels via ::before (no HTML changes) */
  .shipping-table tbody td:nth-child(1)::before{ content:"ID";        display:block; color:#9ca3af; font-size:12px; font-weight:600; margin-bottom:2px; }
  .shipping-table tbody td:nth-child(2)::before{ content:"Country";   display:block; color:#6b7280; font-size:12px; font-weight:600; margin-bottom:2px; }
  .shipping-table tbody td:nth-child(3)::before{ content:"State";     display:block; color:#6b7280; font-size:12px; font-weight:600; margin-bottom:2px; }
  .shipping-table tbody td:nth-child(4)::before{ content:"Route";     display:block; color:#6b7280; font-size:12px; font-weight:600; margin-bottom:4px; }
  .shipping-table tbody td:nth-child(5)::before{ content:"ETA";       display:block; color:#6b7280; font-size:12px; font-weight:600; margin-bottom:2px; }
  .shipping-table tbody td:nth-child(6)::before{ content:"Price";     display:block; color:#6b7280; font-size:12px; font-weight:600; margin-bottom:2px; }
  .shipping-table tbody td:nth-child(7)::before{ content:"Status";    display:block; color:#6b7280; font-size:12px; font-weight:600; margin-bottom:2px; }
  .shipping-table tbody td:nth-child(8)::before{ content:"Actions";   display:block; color:#6b7280; font-size:12px; font-weight:600; margin-bottom:6px; }

  /* Pills tidy on mobile */
  .status-pill-olsm,
  .payment-pill-olsm{
    border-radius:999px; padding:4px 10px; font-size:12px;
  }

  /* Pagination already centered; just tighten */
  #shipping-pagination-controls{ margin-top:16px; }
}

/* Ultra-small phones: single column layout */
@media (max-width: 380px){
  .shipping-filter-form #shippingSearchInput,
  .shipping-filter-form .btn{
    flex:1 1 100%;
  }

  .shipping-table tbody tr{
    grid-template-columns:1fr;
    grid-template-areas:
      "route"
      "country"
      "state"
      "eta"
      "price"
      "status"
      "id"
      "actions";
  }
}






/* ===== Shipping Route Modal — Mobile ===== */
@media (max-width: 768px){
  /* Use full viewport height and avoid vertical centering gaps */
  .shipping-modal{
    padding: 0;                 /* remove outer gap */
    align-items: stretch;       /* stretch to full height */
  }

  .shipping-modal-content{
    width: 100% !important;
    max-width: none !important;
    height: 60svh;             /* safe viewport units for mobile */
    margin: 0 !important;       /* override margin-left/top from desktop */
    border-radius: 0;           /* edge-to-edge sheet style */
    padding: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: none;           /* mobile sheet look */
  }

  /* Title spacing (keep room for the close button) */
  .shipping-modal-content h4{
    font-size: 18px;
    margin: 4px 40px 12px 0;    /* leave space at right for the ✕ */
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
  }

  /* Bigger, easier close target */
  .shipping-close{
    top: 10px;
    right: 12px;
    font-size: 26px;
    padding: 6px;
    line-height: 1;
  }

  /* Form becomes the scrollable area */
  #shippingRouteForm{
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;                 /* scroll content */
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;           /* breathing room above sticky btn */
  }

  #shippingRouteForm label{
    margin: 0;
    font-size: 13px;
    color: #6b7280;
  }

  #shippingRouteForm input,
  #shippingRouteForm select{
    width: 100%;
    height: 44px;                   /* touch-friendly */
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    box-sizing: border-box;
  }

  /* Keep the submit button visible (sticks to bottom within modal) */
  #shippingRouteForm button[type="submit"]{
    height: 44px;
    border-radius: 10px;
    font-size: 16px;
    margin-top: 8px;
    position: sticky;
    bottom: 0;                      /* sticks at bottom of scroll area */
  }
}

/* Ultra-small phones: slightly tighter paddings */
@media (max-width: 380px){
  .shipping-modal-content{ padding: 14px; }
  .shipping-modal-content h4{ font-size: 17px; margin-right: 36px; }
  #shippingRouteForm input,
  #shippingRouteForm select{ height: 42px; }
  #shippingRouteForm button[type="submit"]{ height: 42px; }
}







/* ===== Admins — Mobile layout (≤768px) ===== */
@media (max-width: 768px){

  /* Card container padding */
  .admin-box{ padding: 12px; }

  /* Header stacks; buttons wrap and center */
  .admin-box-header{
    display:flex; flex-direction:column; align-items:stretch; gap:10px;
  }
  .admin-box-title{ font-size:18px; text-align:center; margin:0 !important; }
  .admin-btn-set{ display:flex; flex-wrap:wrap; gap:8px; justify-content:center; }
  .admin-btn-set .btn{border-radius:10px; }

  /* Filter form centered, 2-per-row */
  .admin-filter-form{
    display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-bottom: 12px;
  }
  #adminSearchInput,
  .admin-filter-form .btn{
    width:auto !important; height:44px; border-radius:10px;
    flex:1 1 calc(46% - 9px); min-width:0; margin-bottom: -10px;
  }

  /* Table → card rows */
  .admin-table-wrapper{ overflow: visible; border:0; }
  .admin-table thead{ display:none; }

  .admin-table tbody tr{
    display:block;
    border:1px solid #e5e7eb;
    border-radius:12px;
    margin:10px 0;
    background:#fff;
    overflow:hidden;
    position:relative;
  }

  /* Base cell */
  .admin-table tbody td{
    display:block;
    padding:10px 12px;
    border:0;
    white-space:normal;
  }

  /* ===== Header (visible): Name + Username only ===== */
  /* 3: Name (big) */
  .admin-table tbody tr > td:nth-child(3){
    font-weight:700; font-size:15px; line-height:1.3;
    text-align:center; padding-right:34px; /* room for chevron */
  }
  /* 4: Username (muted under name) */
  .admin-table tbody tr > td:nth-child(4){
    color:#6b7280; font-size:13px; text-align:center; margin-top:2px;
    padding-right:34px;
  }

  /* Chevron indicator (tap to view more content) */
  .admin-table tbody tr::before{
    content:"▾";
    position:absolute; right:12px; top:10px;
    font-size:16px; color:#9ca3af; transition:transform .2s ease, color .2s ease;
    pointer-events:none;
  }
  .admin-table tbody tr.row-open::before{ transform:rotate(180deg); color:#6b7280; }

  /* Divider before dropdown content */
  .admin-table tbody tr::after{
    content:""; display:block; height:1px; background:#f0f0f0; margin:6px 12px 0;
  }

  /* ===== Dropdown (hidden by default) =====
     Columns considered extra:
      1: ID, 2: Created, 5: Email, 6: Role, 7: Status, 8: Actions
  */
  .admin-table tbody tr > td:nth-child(1),
  .admin-table tbody tr > td:nth-child(2),
  .admin-table tbody tr > td:nth-child(5),
  .admin-table tbody tr > td:nth-child(6),
  .admin-table tbody tr > td:nth-child(7),
  .admin-table tbody tr > td:nth-child(8){
    max-height:0; opacity:0; padding-top:0; padding-bottom:0;
    overflow:hidden;
    transition:max-height .25s ease, opacity .2s ease, padding .2s ease;
  }

  /* Labels via ::before (no markup changes) */
  .admin-table tbody tr > td:nth-child(1)::before{ content:"ID";        display:block; font:600 12px/1 Inter,system-ui; color:#6b7280; margin-bottom:4px; }
  .admin-table tbody tr > td:nth-child(2)::before{ content:"Created";   display:block; font:600 12px/1 Inter,system-ui; color:#6b7280; margin-bottom:4px; }
  .admin-table tbody tr > td:nth-child(5)::before{ content:"Email";     display:block; font:600 12px/1 Inter,system-ui; color:#6b7280; margin-bottom:4px; word-break:anywhere; }
  .admin-table tbody tr > td:nth-child(6)::before{ content:"Role";      display:block; font:600 12px/1 Inter,system-ui; color:#6b7280; margin-bottom:4px; }
  .admin-table tbody tr > td:nth-child(7)::before{ content:"Status";    display:block; font:600 12px/1 Inter,system-ui; color:#6b7280; margin-bottom:4px; }
  .admin-table tbody tr > td:nth-child(8)::before{ content:"Actions";   display:block; font:600 12px/1 Inter,system-ui; color:#6b7280; margin-bottom:6px; }

  /* Reveal on focus (keyboard) or .row-open (optional JS toggle) */
  .admin-table tbody tr:focus-within > td:nth-child(1),
  .admin-table tbody tr:focus-within > td:nth-child(2),
  .admin-table tbody tr:focus-within > td:nth-child(5),
  .admin-table tbody tr:focus-within > td:nth-child(6),
  .admin-table tbody tr:focus-within > td:nth-child(7),
  .admin-table tbody tr:focus-within > td:nth-child(8),
  .admin-table tbody tr.row-open    > td:nth-child(1),
  .admin-table tbody tr.row-open    > td:nth-child(2),
  .admin-table tbody tr.row-open    > td:nth-child(5),
  .admin-table tbody tr.row-open    > td:nth-child(6),
  .admin-table tbody tr.row-open    > td:nth-child(7),
  .admin-table tbody tr.row-open    > td:nth-child(8){
    max-height: 240px; opacity:1; padding-top:10px; padding-bottom:10px;
  }

  /* Actions area tidy + centered when revealed */
  .admin-table tbody tr > td:nth-child(8){ text-align:center; }
  .admin-table tbody tr > td:nth-child(8) .btn{
    margin:0 4px 6px; padding:6px 10px; font-size:12px; border-radius:8px;
  }

  /* Badges look better on mobile */
  .admin-table .badge{
    font-size:12px; padding:4px 10px; border-radius:999px;
  }

  /* Pagination minor tighten */
  .admin-pagination-controls{ margin-top:16px; }
}

/* Ultra-small phones: labels closer, prevent overflow */
@media (max-width: 380px){
  .admin-table tbody tr > td:nth-child(5){ word-break:anywhere; }
}



@media (max-width:768px){
  /* hidden by default */
  .admin-table tbody tr > td:nth-child(1),
  .admin-table tbody tr > td:nth-child(2),
  .admin-table tbody tr > td:nth-child(5),
  .admin-table tbody tr > td:nth-child(6),
  .admin-table tbody tr > td:nth-child(7),
  .admin-table tbody tr > td:nth-child(8){
    max-height:0; opacity:0; padding-top:0; padding-bottom:0; overflow:hidden;
    transition:max-height .25s ease, opacity .2s ease, padding .2s ease;
  }
  /* show when open */
  .admin-table tbody tr.row-open > td:nth-child(1),
  .admin-table tbody tr.row-open > td:nth-child(2),
  .admin-table tbody tr.row-open > td:nth-child(5),
  .admin-table tbody tr.row-open > td:nth-child(6),
  .admin-table tbody tr.row-open > td:nth-child(7),
  .admin-table tbody tr.row-open > td:nth-child(8){
    max-height:240px; opacity:1; padding-top:10px; padding-bottom:10px;
  }
}










/* ===== MEDIA PAGE — MOBILE (≤768px) ===== */
@media (max-width: 768px){
  /* Page padding tighter */
  .media-page{ padding:12px; gap:16px; }

  /* Cards */
  .media-card{ padding:14px; border-radius:12px; }

  /* ---------- Create Media form ---------- */
  /* Make the outer grid truly single-column and edge-to-edge */
  .mediax-form-grid.compact-grid{
    grid-template-columns: 1fr !important;
    gap: .8rem !important;
    padding: 1rem !important;
    margin: .5rem 0 !important;
  }
  .mediax-form-group[style*="grid-column"]{ grid-column: auto !important; }

  /* Inputs/selects/textarea = full width, touch-friendly */
  .mediax-form-grid input[type="text"],
  .mediax-form-grid input[type="file"],
  .mediax-form-grid select,
  .mediax-form-grid textarea{
    height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
  }
  .mediax-form-grid textarea{ height:auto; min-height: 90px; }

  /* Submit button full width + centered wrapper button */
  .btn-media-green{ height:44px; border-radius:10px; font-size:16px; }
  .mediax-form-grid button[type="submit"]{
    grid-column: auto !important;
    width: 100% !important;
    margin: 0 !important;
  }
  .media-submit-wrapper{ padding:0 0.25rem; }
  .media-submit-wrapper .btn-media-green{ width:100%; height:44px; border-radius:10px; }

  /* ---------- Table → Card rows ---------- */
  .media-table-responsive{ overflow: visible; }
  .media-table thead{ display:none; }

  .media-table tbody tr{
    display:block;
    margin:10px 0;
    padding:12px;
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:12px;
    box-shadow:0 1px 2px rgba(0,0,0,.04);
  }
  .media-table tbody td{
    display:block;
    padding:8px 0;
    border:0;
    white-space: normal;
  }

  /* Column map: 1 ID, 2 PREVIEW, 3 TITLE, 4 CAPTION, 5 PAGE, 6 ACTIONS */
  .media-table tbody td:nth-child(3){        /* TITLE big on top */
    font-weight:700; font-size:15px; line-height:1.3; margin-top:2px;
  }
  .media-table tbody td:nth-child(2){        /* PREVIEW image row */
    display:flex; align-items:center; gap:10px;
  }
  .media-table tbody td:nth-child(2) img{
    width:56px; height:56px; border-radius:10px; object-fit:cover;
  }
  .media-table tbody td:nth-child(6){        /* ACTIONS at bottom */
    display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap; padding-top:10px;
  }

  /* Field labels via ::before (no HTML change) */
  .media-table tbody td:nth-child(1)::before{ content:"ID";      display:block; color:#6b7280; font-weight:600; font-size:12px; margin-bottom:4px; }
  .media-table tbody td:nth-child(2)::before{ content:"Preview"; display:block; color:#6b7280; font-weight:600; font-size:12px; margin-bottom:6px; }
  .media-table tbody td:nth-child(3)::before{ content:"Title";   display:block; color:#6b7280; font-weight:600; font-size:12px; margin-bottom:4px; }
  .media-table tbody td:nth-child(4)::before{ content:"Caption"; display:block; color:#6b7280; font-weight:600; font-size:12px; margin-bottom:4px; }
  .media-table tbody td:nth-child(5)::before{ content:"Page";    display:block; color:#6b7280; font-weight:600; font-size:12px; margin-bottom:4px; }
  .media-table tbody td:nth-child(6)::before{ content:"Actions"; display:block; color:#6b7280; font-weight:600; font-size:12px; margin-bottom:6px; }

  /* Action buttons size */
  .media-table tbody td:nth-child(6) .btn,
  .media-table tbody td:nth-child(6) .mediax-action-btn{
    padding:6px 10px; border-radius:8px; font-size:12px;
  }

  /* Pagination: center & wrap */
  .media-pagination-controls{ justify-content:center; }

  /* ---------- Modals (both) ---------- */
  .media-modal{ padding:0; align-items:stretch; }
  .media-modal-content,
  .media-modal-content-edit{
    width:100% !important;
    max-width:none !important;
    height:100svh;
    border-radius:0;
    padding:16px;
    display:flex;
    flex-direction:column;
    box-shadow:none;
  }
  .media-modal-content h3,
  .media-modal-content-edit h3{
    font-size:18px; margin:4px 40px 10px 0; padding-bottom:8px; border-bottom:1px solid #eee;
  }
  .media-modal-close{ top: 12px; right: 12px; }

  /* Edit modal form grid goes single-column */
  .media-modal-content-edit .mediax-form-grid{
    grid-template-columns: 1fr !important; gap: .8rem 1rem;
  }
  .media-modal-content-edit .mediax-form-grid textarea{ grid-column: auto !important; }
  .media-modal-content-edit .mediax-form-grid fieldset{ grid-column: auto !important; flex-wrap:wrap; gap:.75rem 1rem; }

  /* Inside modals: inputs comfortable */
  .media-modal-content input[type="text"],
  .media-modal-content input[type="file"],
  .media-modal-content select,
  .media-modal-content textarea,
  .media-modal-content-edit input[type="text"],
  .media-modal-content-edit input[type="file"],
  .media-modal-content-edit select,
  .media-modal-content-edit textarea{
    height:44px; padding:10px 12px; border-radius:10px; font-size:14px;
  }
  .media-modal-content textarea,
  .media-modal-content-edit textarea{ height:auto; min-height: 100px; }

  /* Keep Save button visible */
  .media-modal-content-edit .media-submit-wrapper{ margin-top:12px; }
  .media-modal-content-edit .media-submit-wrapper .btn-media-green{
    width:100%; height:44px; border-radius:10px; font-size:16px;
  }

  /* Make the modal body scrollable (content after the title) */
  .media-modal-content h3 + *,
  .media-modal-content-edit h3 + *{
    overflow:auto; -webkit-overflow-scrolling:touch;
  }
}

/* ===== Ultra-small phones (≤380px) tweaks ===== */
@media (max-width: 380px){
  .media-card{ padding:12px; }
  .media-table tbody td:nth-child(2) img{ width:52px; height:52px; }
  .media-modal-content, .media-modal-content-edit{ padding:14px; }
}












/* ===== Cart Reminders: hide table on small phones (portrait), show rotate notice ===== */

/* Base: keep the notice hidden unless we’re on small portrait */
#cartRemindersPage .rotate-notice {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px dashed #cfd8dc;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 14px;
  text-align: center;
}

/* Small phones, portrait: hide table + pagination, show the notice */
@media (max-width: 640px) and (orientation: portrait) {
  #cartRemindersPage .admin-table-wrapper,
  #cartRemindersPage .admin-pagination-controls {
    display: none !important;
  }
  #cartRemindersPage .rotate-notice {
    display: block;
  }
}

/* Small phones, landscape: show table, hide the notice */
@media (max-width: 640px) and (orientation: landscape) {
  #cartRemindersPage .admin-table-wrapper,
  #cartRemindersPage .admin-pagination-controls {
    display: block !important;
  }
  #cartRemindersPage .rotate-notice {
    display: none;
  }
}

/* Fallback: if orientation isn’t reported, prefer showing the notice on very narrow screens */
@media (max-width: 380px) {
  #cartRemindersPage .admin-table-wrapper,
  #cartRemindersPage .admin-pagination-controls {
    display: none !important;
  }
  #cartRemindersPage .rotate-notice {
    display: block;
  }
}



