
/* PAGE TITLE */
.products-title {
    text-align: center;
    margin: 4% 0 3%;
    color: #fff;
}

.products-title h1 {
    font-size: 2.2rem;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* PRODUCTS CONTAINER */
.offers-scroll {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
    margin: 0 5% 5%;
}

/* PRODUCT CARD */
.offer {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    padding: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    color: #2c3e50;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.3);
}

.offer:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

/* CARD HEADER - TYPE & NAME */
.offer-header {
    padding: 24px 20px 18px;
    text-align: center;
    background: linear-gradient(to bottom, #f8fafc, #ffffff);
    border-bottom: 1px solid #edf2f7;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.offer-header h5 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    max-height: 3.6rem;          /* ~2 lines */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;       /* limit to 2 lines */
    -webkit-box-orient: vertical;
    position: relative;
    cursor: pointer;
    transition: max-height 0.3s ease;  /* smooth hover expand */
}

.offer-header h5:hover {
    -webkit-line-clamp: unset;   /* remove 2 line limit */
    max-height: 10rem;            /* allow full text to expand */
}

.offer-header h5:hover::after {
    content: attr(data-fullname); /* Use the full name from data attribute */
    position: absolute;
    left: 50%;
    top: 100%;                  /* below the h5 */
    transform: translateX(-50%);
    white-space: normal;
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    width: max-content;
    max-width: 250px;           /* optional, prevents huge tooltip */
    opacity: 1;
    pointer-events: none;
    z-index: 10;
}


/* MOBILE: vertically scrollable product name with gradient hint */
@media (max-width: 600px) {
    .offer-header h5 {
      font-size: 0.9rem !important;
      max-height: 4rem;            /* ~2 lines visible */
      overflow-y: auto;            /* vertical scroll */
      overflow-x: hidden;          /* hide horizontal scroll */
      white-space: normal;         /* allow wrapping */
      text-overflow: unset;        /* remove ellipsis */
      -webkit-line-clamp: unset;   /* remove clamp */
      display: block;
      padding-right: 4px;          /* avoid scrollbar overlap */
      position: relative;
      cursor: grab;                /* draggable hint */
    }
  
    /* subtle scrollbar */
    .offer-header h5::-webkit-scrollbar {
      width: 6px;
    }
  
    .offer-header h5::-webkit-scrollbar-track {
      background: transparent;
    }
  
    .offer-header h5::-webkit-scrollbar-thumb {
      background-color: rgba(100, 116, 139, 0.5);
      border-radius: 3px;
    }
  
    /* Gradient fade hint at bottom */
    .offer-header h5::after {
      content: "";
      position: sticky;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 20px;
      pointer-events: none;
      background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8));
    }
  
    /* remove hover-based desktop styling */
    .offer-header h5:hover {
      -webkit-line-clamp: unset;
      max-height: 4rem;
    }
  
    /* remove tooltip display on mobile */
    .offer-header h5 .full-name-tooltip {
      display: none !important;
    }
  
    /* cursor while dragging */
    .offer-header h5:active {
      cursor: grabbing;
    }
}

.full-name-tooltip {
    display: none;                 /* hidden by default */
    position: absolute;
    top: 100%;                     /* below the h5 */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    white-space: normal;
    width: max-content;
    max-width: 250px;
    z-index: 100;
}

/* Show tooltip on hover */
.offer-header h5:hover .full-name-tooltip {
    display: block;
}

/* THE HIGHLIGHTED PRODUCT TYPE */
.offer-type {
    display: inline-block;
    background: #e0e7ff;
    color: #4338ca;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(67, 56, 202, 0.1);
}

.offer h5 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

/* CARD CONTENT */
.offer-content {
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex-grow: 1;   /* fill remaining space */
}

.offer-footer {
    margin-top: auto;  /* push button to bottom */
}

/* PRICE HIGHLIGHT */
.offer-price {
    display: inline-block;
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(135deg, #064db6 0%, #0b5ed7 100%);
    padding: 10px 28px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(6, 77, 182, 0.2);
}

/* PRODUCT DETAILS GRID */
.offer-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.offer-detail-item {
    background: #f1f5f9;
    padding: 10px;
    border-radius: 8px;
    text-align: left;
}

.offer-detail-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.offer-detail-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
}

.offer-detail-full {
    grid-column: 1 / -1;
}

/* BUTTON */
.offer button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: #0f172a;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: auto;
}

.offer button:hover {
    background: #1e293b;
}

/* RESPONSIVE */
@media (max-width: 600px) {
    .offers-scroll {
        grid-template-columns: 1fr;
        margin: 0 5% 5%;
    }
}

.offers-scroll {
    overflow-y: visible;
}


/* HEADER WITH DROPDOWN AND TITLE */
.products-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin: 20px 5%;
}
  
.products-header .page-size-container label {
  font-weight: 600;
  margin-right: 8px;
  color: #fff;
}

.products-header .page-size-container select {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: #0f172a;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.products-header .products-title {
  text-align: center;
  margin: 0;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.products-header select,
.products-header button {
  height: 40px;
  border-radius: 10px;
  padding: 0 12px;
  font-weight: 700;
}
  
/* PAGINATION FOOTER */
.pagination-footer {
  display: flex;
  justify-content: center;
  margin: 30px 0 50px;
}

.pagination-footer .pagination-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 10px 14px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.pagination-footer .pagination-container button {
  min-width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-footer .pagination-container button:hover {
  background: #1e293b;
}

.pagination-footer .pagination-container .pages {
  display: flex;
  gap: 6px;
}

.pagination-footer .pagination-container .pages button {
  background: rgba(15, 23, 42, 0.7);
  padding: 6px 10px;
}

.pagination-container button:hover:not(:disabled) {
  background: #1e293b;
  transform: translateY(-1px);
}

.pagination-container .pages button.active {
  background: linear-gradient(135deg, #0b5ed7, #2563eb);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
  cursor: default;
}

.pagination-container button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-container .ellipsis {
  display: flex;
  align-items: center;
  padding: 0 6px;
  color: #cbd5f5;
  font-weight: 700;
}
  
  @media (max-width: 600px) {
    .pagination-container {
      flex-wrap: wrap;
      justify-content: center;
      gap: 6px;
    }
  
    .pagination-container button {
      min-width: 38px;
      height: 38px;
      font-size: 0.9rem;
    }
  }

  .filter-btn {
    background: #0f172a;
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .filter-btn:hover {
    background: #1e293b;
  }
  
  /* FILTER MODAL */
  .filter-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }
  
  .filter-modal.open {
    display: flex;
  }
  
  .filter-content {
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
  }
  
  .filter-content h3 {
    margin-bottom: 16px;
    text-align: center;
  }
  
  .filter-group {
    margin-bottom: 14px;
  }
  
  .filter-group label {
    font-weight: 700;
    font-size: 0.8rem;
    color: #475569;
    text-transform: uppercase;
  }
  
  .filter-group input {
    width: 95%;    
    margin: 0 auto;      
    display: block;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    margin-top: 4px;
  }

  /* Style for the dropdown in the filter modal */
.filter-group select {
  width: 95%;         
  margin: 0 auto;         
  display: block;
  padding: 10px; /* Padding for better touch target */
  border-radius: 8px; /* Rounded corners */
  border: 1px solid #cbd5e1; /* Border color */
  background: #f9fafb; /* Light background for contrast */
  color: #1e293b; /* Text color */
  font-size: 1rem; /* Font size */
  font-weight: 600; /* Font weight */
  cursor: pointer; /* Pointer cursor */
  transition: border-color 0.2s ease; /* Smooth border transition */
}

/* Change border color on focus */
.filter-group select:focus {
  border-color: #0b5ed7; /* Highlight border on focus */
  outline: none; /* Remove default outline */
}

/* Style for the dropdown options */
.filter-group option {
  padding: 10px; /* Padding for options */
}

/* Style to indicate hover state on options */
.filter-group option:hover {
  background: #e0e7ff; /* Light background on hover */
}

.filter-group select[multiple] {    
  width: 100%;    
  padding: 10px;    
  border-radius: 8px;    
  border: 1px solid #cbd5e1;    
  background: #f9fafb;    
  color: #1e293b;    
  font-size: 1rem;    
  font-weight: 600;    
  cursor: pointer;    
  transition: border-color 0.2s ease;    
  min-height: 120px;
}

.filter-group select[multiple]:focus {    
  border-color: #0b5ed7;    
  outline: none;    
  box-shadow: 0 0 0 3px rgba(11, 94, 215, 0.1);
}

.filter-group select[multiple] option:checked {    
  background: linear-gradient(#0b5ed7, #0b5ed7);    
  background-color: #0b5ed7;
  border-radius: 10px;  
  color: white;
}

.filter-group select[multiple] option {    
  padding: 8px;    
  margin: 4px 0;
}

  
.price-inputs {
  display: flex;
  gap: 8px;
}

.price-inputs input {
  flex: 1;
}

.filter-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 18px;
}

.filter-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  cursor: pointer;
}

.filter-body {
  overflow-y: auto;
  padding-right: 6px;
  margin-bottom: 12px;
  flex: 1;
}

.filter-body::-webkit-scrollbar {
  width: 6px;
}

.filter-body::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.4);
  border-radius: 4px;
}

/* Sticky buttons */
.filter-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 12px;
  box-shadow: 0 -6px 16px rgba(0,0,0,0.08);
}

.btn-apply {
  background: #0b5ed7;
  color: #fff;
}

.btn-reset {
  background: #e2e8f0;
}

.btn-close {
  background: #334155;
  color: #fff;
}

.sort-container label {
  font-weight: 600;
  margin-right: 8px;
  color: #fff;
}

.sort-container select {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: #0f172a;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* CART TOAST POPUP */
.cart-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #0b5ed7;
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  font-weight: 700;
  font-size: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 2000;
  transform: translateY(20px);
}

.cart-toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}


@media (max-width: 768px) {
  .products-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .products-header .products-title {
    order: 1;
  }

  .header-left {
    order: 2;
    justify-content: center;
    flex-wrap: wrap;
  }

  .header-right {
    order: 3;
    justify-content: center;
    flex-wrap: wrap;
  }

  .products-header select,
  .products-header button {
    width: 100%;
    max-width: 240px;
  }
}

@media (max-width: 500px) {
  .logo{
    height: 60px;
  }
}

@media (max-width: 400px) {
  h1{
    font-size: 0.9rem!important;
  }
  .logo{
    height: 50px;
  }
}