/* WC Frontend Portal styles */
:root {
  --wcfp-bg: #f7f7f8;
  --wcfp-surface: #ffffff;
  --wcfp-border: #e5e7eb;
  --wcfp-text: #111827;
  --wcfp-muted: #6b7280;
  --wcfp-primary: #111827;
  --wcfp-accent: #2563eb;
  --wcfp-sidebar-width: 240px;
  --wcfp-header-height: 64px;
  --wcfp-radius: 16px;
  --wcfp-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

/* Admin menu hover */
.wcfp-admin-menu.open { display: block; }
.wcfp-admin-button:hover { background: #f3f4f6; }

/* Base */
.wcfp * { box-sizing: border-box; }
.wcfp {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--wcfp-text);
}
html { scroll-behavior: auto !important; }

/* Table images */
#wcfp-categories-table td img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

/* Toggle dropdown */
#wcfp-categories-table .toggle-status-dropdown {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 6px;
  border: none;
  background-color: #333;
  color: #fff;
}

/* General card style */
.wcfp-card,
.wcfp-card-header {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 16px 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Card header layout */
.wcfp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafafa;
}

/* Card title */
.wcfp-card-header .wcfp-title {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin: 0;
}

/* Primary buttons */
.wcfp-save-category,
.wcfp-add-category,
.wcfp-add-product,
.wcfp-add-extra-product,
.wcfp-save-product {
  background: #0073aa;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.wcfp-save-category:hover,
.wcfp-add-category:hover,
.wcfp-add-product:hover { background: #005f8d; }

/* Header */
.wcfp-header {
  position: relative;
  height: var(--wcfp-header-height);
  background: #2B1B17;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
}
.wcfp-header .title {
  font-weight: 800;
  font-size: 20px;
  color: #fff;
}
.wcfp-admin { position: relative; }
.wcfp-admin-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--wcfp-border);
  background: var(--wcfp-surface);
  padding: 8px 12px;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: var(--wcfp-shadow);
}
.wcfp-admin-button .dashicons { font-size: 18px; }
.wcfp-admin-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 160px;
  background: var(--wcfp-surface);
  border: 1px solid var(--wcfp-border);
  border-radius: 12px;
  box-shadow: var(--wcfp-shadow);
  padding: 6px;
  display: none;
}
.wcfp-admin-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--wcfp-text);
}
.wcfp-admin-menu a:hover { background: var(--wcfp-bg); }

/* Body layout */
.wcfp-body {
  display: grid;
  grid-template-columns: var(--wcfp-sidebar-width) 1fr;
  min-height: calc(100vh - var(--wcfp-header-height));
  background: var(--wcfp-bg);
}

/* Sidebar */
.wcfp-sidebar {
  background: #0f172a;
  color: #fff;
  padding: 16px 8px;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.wcfp-nav { list-style: none; margin: 0; padding: 0; }
.wcfp-nav li {
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
}
.wcfp-nav li:hover { background: rgba(255,255,255,0.12); }
.wcfp-nav li.active { background: #98AFC7; }

/* Content */
.wcfp-content { padding: 20px; }

/* Breadcrumb */
.wcfp-breadcrumb {
  font-size: 14px;
  color: var(--wcfp-muted);
  margin-bottom: 10px;
}
.wcfp-breadcrumb .breadcrumb-link {
  color: var(--wcfp-muted);
  cursor: pointer;
  text-decoration: none;
}
.wcfp-breadcrumb .breadcrumb-link:hover {
  color: #2563eb;
  text-decoration: underline;
}
.wcfp-breadcrumb span:last-child {
  color: #2563eb;
  font-weight: 600;
  cursor: default;
}

.wcfp-heading {
  margin: 0 0 16px 0;
  font-size: 28px;
  font-weight: 800;
  color: #111827;
}

/* Cards / Buttons grid */
.wcfp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.wcfp-btn-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: var(--wcfp-radius);
  background: var(--wcfp-surface);
  border: 1px solid var(--wcfp-border);
  box-shadow: var(--wcfp-shadow);
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
  text-align: center;
}
.wcfp-btn-card:hover { background: #f3f4f6; transform: translateY(-2px); }
.wcfp-btn-card:active { transform: translateY(1px); }

/* Views */
.wcfp-view { display: none; }
.wcfp-view.active { display: block; }

/* Placeholder */
.wcfp-placeholder {
  background: var(--wcfp-surface);
  border: 1px solid var(--wcfp-border);
  border-radius: var(--wcfp-radius);
  padding: 24px;
  box-shadow: var(--wcfp-shadow);
}

/* Category filter dropdown */
#wcfp-category-filter-best-items,
#wcfp-category-filter-category-products,
#wcfp-category-filter-new-arrivals{
  display: inline-block;
  padding: 7px 10px;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  height: 36px;
  font-size: 14px;
  background: #fff;
  margin-bottom: 10px;
  margin-right: 12px;
  min-width: 180px;
  max-width: 260px;
}

/* Toast + Modal */
.wcfp-toast {
  background: #333;
  color: #fff;
  padding: 10px 15px;
  border-radius: 4px;
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none;
  z-index: 10000;
}
#wcfp-confirmation-modal {
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.5);
  z-index:9999;
  text-align:center;
}
#wcfp-confirmation-modal > div {
  background:#fff;
  padding:20px;
  margin:15% auto;
  width:300px;
  border-radius:8px;
}

/* ===============================
   Forms – Combined Design + Functionality
   =============================== */
.wcfp-form {
  display: grid;
  grid-template-columns: 1fr 1fr; /* two-column layout on desktop */
  gap: 20px 30px; /* row gap 20px, column gap 30px */
  margin-top: 16px;
}

.wcfp-form-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.wcfp-form-group label {
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
}

.wcfp-form-group input,
.wcfp-form-group select,
.wcfp-form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.wcfp-form-group input[type="file"] { padding: 6px; }

/* Description row – always full width */
.wcfp-form-row.description-row {
  grid-column: 1 / -1; /* span all columns in the grid */
  width: 100%;
  margin-bottom: 18px;
  display: flex;          /* optional: keep flex for WP editor inside */
  flex-direction: column;
}


.wcfp-form-row.description-row .wcfp-form-group {
  width: 100% !important;
}

/* Mobile Responsive */
@media (max-width: 991px) {
  .wcfp-form {
    grid-template-columns: 1fr; /* stack columns */
    gap: 12px; /* smaller gap for mobile */
  }

  .wcfp-form-row { flex-direction: column; gap: 12px; }
  .wcfp-form-row .wcfp-form-group { flex: 1 1 100% !important; width: 100% !important; }

  /* Hide placeholder rows if any */
  .wcfp-form-group.placeholder { display: none; }
}


/* DataTables fixes */
.dataTables_processing {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999 !important;
}
.dataTables_processing:after { content: "Loading…" !important; color: #fff; font-weight: 600; font-size: 16px; }

/* Bigger select dropdown for status */
#wcfp-categories-table .toggle-status-dropdown {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0px 12px;
  font-size: 14px;
  border-radius: 4px;
  height: 32px;
  line-height: 1px;
  margin-bottom: 7px;
  background-color: #333;  /* black background */
  color: #fff;             /* white text */
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Hover effect */
#wcfp-categories-table .toggle-status-dropdown:hover {
  background-color: #222; /* dark gray */
 
}

/* Different colors depending on value */
#wcfp-categories-table .toggle-status-dropdown[data-current="active"] {
  background-color: #28a745; /* green */
  color: #fff;
}

#wcfp-categories-table .toggle-status-dropdown[data-current="hidden"] {
  background-color: #dc3545; /* red */
  color: #fff;
}

/* Fix DataTables processing overlay */
.dataTables_processing {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: rgba(0, 0, 0, 0.3); /* dark semi-transparent overlay */
  border: none !important;
  box-shadow: none !important;
  z-index: 9999 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dataTables_processing:after {
  content: "Loading…" !important;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
}

/* Normalize action buttons */
#wcfp-view-categories .edit-category,
#wcfp-view-categories .remove-popup{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;         /* force same height */
  padding: 0 10px;      /* consistent padding */
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

/* Different colors for clarity */
#wcfp-view-categories .edit-category {
  background: #0d6efd;
  color: #fff;
  border: none;
}

#wcfp-view-categories .remove-popup{
  background: #dc3545;
  color: #fff;
  border: none;
}

/* Add space between the buttons */
#wcfp-view-categories .edit-category {
  margin-right: 6px;   /* space between edit and remove */
}


/* Force action column contents inline */
#wcfp-categories-table td:last-child {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Normalize both buttons */
#wcfp-categories-table .edit-category,
#wcfp-categories-table .remove-popup{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

/* Hover effect (works now) */
#wcfp-categories-table .edit-category:hover {
  background-color: #0056b3;  /* darker blue */
  transform: translateY(-1px);
}
#wcfp-categories-table .remove-popup:hover {
  background-color: #c82333;  /* darker red */
  transform: translateY(-1px);
}

.wcfp-loading-dots span {
  animation: blink 1s infinite alternate;
}
.wcfp-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.wcfp-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  from { opacity: 0.2; }
  to { opacity: 1; }
}

.wcfp-spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Match textarea style with input fields */
#wcfp-add-category-form textarea,
#wcfp-edit-category-form textarea {
  font-family: inherit;        /* same font as inputs */
  font-size: 14px;             /* adjust to match inputs */
  line-height: 1.4;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  width: 100%;
  min-height: 80px;
  resize: vertical;            /* allow vertical resizing only */
  box-sizing: border-box;
  background: #fff;
  color: #333;
}

/* Optional: Make placeholder look consistent */
#wcfp-add-category-form textarea::placeholder,
#wcfp-edit-category-form textarea::placeholder {
  color: #888;
  font-style: italic;
}



/* ===============================
   📱 MOBILE CUSTOM STYLING (FIXED)
   =============================== */
@media (max-width: 991px) {

  /* Hide desktop sidebar in mobile */
  .wcfp-sidebar {
    display: none !important;
  }

  /* Full width body on mobile */
  .wcfp-body {
    display: block !important;
    grid-template-columns: 1fr !important;
  }

  /* Content should take full width */
  .wcfp-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 15px !important;
  }

  /* Show hamburger menu */
  .wcfp-hamburger {
    display: inline-block !important;
    font-size: 26px;
    margin-right: 12px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
  }

  /* Mobile navigation */
  #wcfp-mobile-menu {
    display: none;
    background: #1b263b;
    width: 100%;
    position: relative;
    z-index: 999;
  }
  #wcfp-mobile-menu ul { list-style: none; margin: 0; padding: 0; }
  #wcfp-mobile-menu li { border-bottom: 1px solid #324a5f; }
  #wcfp-mobile-menu a { display: block; padding: 14px 18px; color: white; text-decoration: none; font-size: 16px; }
  #wcfp-mobile-menu a:hover { background: #415a77; }

  /* Make cards 1 per row on mobile */
  .wcfp-grid {
    grid-template-columns: 1fr !important;
  }

  /* Make tables scrollable horizontally */
  .wcfp-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    width: 100%;
  }
  .wcfp-table-scroll table.dataTable {
    min-width: 700px; /* Force horizontal scroll if too many columns */
  }
  .wcfp-table-scroll table.dataTable thead,
  .wcfp-table-scroll table.dataTable tfoot {
    position: sticky;
    top: 0;
    background: white;
    z-index: 2;
  }
}

/* ===============================
   🖥 DESKTOP ONLY
   =============================== */
@media (min-width: 992px) {
  #wcfp-mobile-menu { display: none !important; }
  .wcfp-hamburger { display: none !important; }
}






.table-responsive {
    overflow-x: auto; /* horizontal scroll */
    -webkit-overflow-scrolling: touch; /* smooth on iOS */
}

#s wcfp-categories-table th,
#s wcfp-categories-table td {
    white-space: nowrap; /* prevent wrapping */
}

#category-products-table_wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#category-products-table th,
#category-products-table td {
    white-space: nowrap; /* prevent wrapping */
}

@media (max-width: 768px) {
  #wcfp-categories-table_wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #wcfp-categories-table {
    min-width: 700px; /* force scroll area */
  }
}

