/* =========================================================
   Register Page Layout
   ========================================================= */
.register-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.form-field {
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Success / Error messages */
.success-message,
.error-message {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 5px;
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
}

.success-message {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.error-message {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

#close-message {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: inherit;
}

/* Primary action button */
.addmore-btn {
  background: linear-gradient(to left, #eb3333, #a05252);
  color: white;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}

/* Store name suggestions */
.suggestions-dropdown {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  width: 100%;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  max-height: 150px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.suggestions-dropdown div {
  padding: 8px;
  cursor: pointer;
}

.suggestions-dropdown div:hover {
  background-color: #f0f0f0;
}

/* =========================================================
   Campaign marquee
   ========================================================= */
.campaign-closed-marquee {
  background: #800000;
  color: #ffd700;
  font-weight: bold;
  padding: 10px 0;
  margin-bottom: 20px;
  border-radius: 5px;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.campaign-closed-marquee span {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 25s linear infinite;
  font-size: 1.1em;
}

@keyframes marquee {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(-100%, 0); }
}

.register-container.closed {
  opacity: 0.9;
  pointer-events: none;
}
.register-container.closed .campaign-closed-marquee {
  pointer-events: auto;
}

/* =========================================================
   PRODUCTS SECTION
   ========================================================= */
.products-section {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-top: 18px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.products-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

/* Grid Layout Responsive */
.products-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* Mobile: 2 cols */
}
@media (min-width: 576px){ .products-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px){ .products-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px){ .products-grid{ grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Product Card */
.product-card {
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: visible; /* Tooltip needs this */
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.product-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0,0,0,0.08);
}

/* Selected state (When quantity > 0) */
.product-card.is-selected {
  border-color: #eb3333;      /* Highlight Color */
  box-shadow: 0 10px 18px rgba(235, 51, 51, 0.12);
}

/* Image Thumbnail */
.product-thumb {
  width: 100%;
  height: 180px;
  background: #f6f7f9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@media (min-width: 992px){ .product-thumb{ height: 210px; } }
@media (max-width: 575.98px){ .product-thumb{ height: 160px; } }

.product-info {
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: visible;
}

/* Product Name & Tooltip */
.product-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
  cursor: help;
  min-height: 2.6em;
  font-size: 14px;
  line-height: 1.3;
}

/* Desktop Tooltip */
@media (min-width: 769px) {
  .product-name:hover::after {
    content: attr(data-fullname);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    background: #111827;
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: normal;
    width: max-content;
    max-width: 260px;
    z-index: 9999;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  }
}

/* =========================================================
   QUANTITY CONTROLS (Unified Capsule Design)
   This fixes the mobile overflow issue.
   ========================================================= */

/* The Container: A single pill shape */
.products-section .qty-controls {
    display: flex;             /* Use Flexbox, not Grid */
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 40px;              /* Standard touch height */
    border: 1px solid #e5e7eb; /* Single shared border */
    border-radius: 20px;       /* Pill shape */
    background-color: #fff;
    overflow: hidden;          /* Keeps children inside corners */
    margin-top: auto;          /* Push to bottom of card */
}

/* If selected, color the capsule background slightly */
.product-card.is-selected .qty-controls {
    background-color: #fff5f5; /* Light red tint */
    border-color: #eb3333;
}

/* The Buttons: Transparent clickable areas inside the pill */
.products-section .qty-btn {
    width: 44px !important;    /* Fixed width for easy tapping */
    height: 100% !important;   /* Fill container height */
    border: none !important;   /* No individual borders */
    background: transparent !important;
    border-radius: 0 !important; 
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
    transition: background 0.2s;
}

.products-section .qty-btn:hover {
    background-color: rgba(0,0,0,0.05) !important;
}

.products-section .qty-btn:active {
    background-color: rgba(0,0,0,0.1) !important;
}

.products-section .qty-btn i {
    font-size: 14px; /* Icon size */
}

/* The Middle Number */
.products-section .qty-display {
    flex: 1;                   /* Grow to fill space */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

/* Hide the meta text (Selected vs Not Selected) as the border color now indicates selection. 
   Or you can keep it styled small below the pill. */
.qty-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: #6b7280;
  min-height: 20px; /* Prevent jumpiness */
}

/* =========================================================
   Responsive Form Layout
   ========================================================= */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-field {
    width: 100%;
  }
  .register-container {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-field label {
    font-size: 14px;
  }
  .form-field input,
  .form-field select,
  .form-field textarea {
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
  }
  .addmore-btn {
    font-size: 10px;
    padding: 6px 10px;
  }
}

/* =========================================================
   Loading modal
   ========================================================= */
#loadingModal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.5);
}

#loadingModal .modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 20px;
  border-radius: 5px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}