/* ================================================================
   promotions.css — Aqua Laundry · PROMOTIONS PAGE
   ================================================================
   ⚠️  ต้องโหลด main.css ก่อนไฟล์นี้เสมอ
   โค้ดที่ซ้ำกันทุกหน้า (hero, breadcrumb, :root tokens,
   utilities, keyframes) ถูกย้ายไปรวมที่ main.css แล้ว
   ================================================================ */

/* === CSS Variables === */
:root {
  --promo-primary: #0077B6;
  --promo-secondary: #023E8A;
  --promo-accent: #00B4D8;
  --promo-light: #90E0EF;
  --promo-pale: #CAF0F8;
  --promo-success: #10B981;
  --promo-danger: #EF4444;
  --promo-warning: #F59E0B;
  --promo-gradient: linear-gradient(135deg, #0077B6 0%, #00B4D8 100%);
}

/* === Search Section - Glass Morphism (แทน Filter) === */
.promotions-search {
  margin-top: 0;
  padding-top: 1.5rem;
  position: relative;
  z-index: 10;
}

.search-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02);
  border-top: 5px solid var(--promo-primary);
  border: 1px solid rgba(0, 180, 216, 0.2);
  position: relative;
  overflow: hidden;
}

.search-card .form-label {
  font-weight: 600;
  color: var(--promo-secondary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  letter-spacing: 0.2px;
}

.search-card .form-label i {
  width: 25px;
  height: 25px;
  background: var(--promo-gradient);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1rem;
}

.search-card .form-select {
  border: 2px solid #E2E8F0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Prompt', sans-serif;
  background: white;
  font-weight: 500;
  color: #1E293B;
}

.search-card .form-select:focus {
  border-color: var(--promo-primary);
  box-shadow: 0 0 0 5px rgba(0, 119, 182, 0.1);
  outline: none;
  background: white;
  transform: translateY(-2px);
}

.search-card .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%230077B6' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.25rem center;
  background-size: 20px 16px;
  padding-right: 3.5rem;
  appearance: none;
  cursor: pointer;
}

/* Search Button */
.btn-search {
  background: var(--promo-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-search::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.btn-search:hover::before {
  left: 100%;
}

.btn-search:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0, 119, 182, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-search i {
  font-size: 1.2rem;
}

/* === Results Section === */
.results-section {
  padding-bottom: 80px;
  background: #F8FAFC;
}

/* Results Header - แทน promotions-header */
.results-header {
  background: white;
  border-radius: 16px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 5px solid var(--promo-primary);
  position: relative;
  overflow: hidden;
}

.results-header::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 180, 216, 0.03));
  pointer-events: none;
}

.results-count {
  font-size: 1rem;
  color: #1E293B;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.results-count i {
  width: 40px;
  height: 40px;
  background: var(--promo-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(0, 119, 182, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.results-count .count {
  color: var(--promo-primary);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

/* Results Sort */
.results-sort {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
}

.results-sort label {
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.results-sort label i {
  color: var(--promo-primary);
  font-size: 0.95rem;
}

.results-sort .form-select {
  min-width: 200px;
  border: 2px solid #E2E8F0;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  padding-right: 3rem;
  font-weight: 600;
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%230077B6' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px 14px;
  appearance: none;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #1E293B;
  font-size: 0.9rem;
}

.results-sort .form-select:focus {
  border-color: var(--promo-primary);
  box-shadow: 0 0 0 5px rgba(0, 119, 182, 0.1);
}

/* === Promotion Cards Grid === */
.promotions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.promotion-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.02);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0, 180, 216, 0.05);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.promotion-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--promo-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.promotion-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 25px 60px rgba(0, 119, 182, 0.2), 0 0 0 1px rgba(0, 180, 216, 0.1);
  border-color: rgba(0, 180, 216, 0.15);
}

.promotion-card:hover::before {
  transform: scaleX(1);
}

/* Promotion Badge */
.promo-badge {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: rgba(255, 255, 255, 0.98);
  color: var(--promo-primary);
  padding: 0.4rem 1.2rem;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 900;
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.5);
  z-index: 2;
}

.promo-badge.hot {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: white;
  animation: badgePulse 2.5s ease-in-out infinite;
}

.promo-badge.new {
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  animation: badgePulse 2.5s ease-in-out infinite;
}

.promo-badge.special {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: white;
  animation: badgePulse 2.5s ease-in-out infinite;
}

@keyframes badgePulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
  }

  50% {
    transform: scale(1.08);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.6);
  }
}

/* Promotion Image */
.promotion-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.promotion-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.promotion-card:hover .promotion-image img {
  transform: scale(1.15);
}

/* Promotion Content */
.promotion-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Promotion Title */
.promotion-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--promo-secondary);
  margin: 0 0 1rem 0;
  line-height: 1.4;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
}

.promotion-title i {
  color: var(--promo-accent);
  margin-right: 10px;
  font-size: 1.1rem;
}

/* Promotion Description */
.promotion-description {
  color: #64748B;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* Promotion Details */
.promotion-details {
  background: #F8FAFC;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border: 1px solid #E2E8F0;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #475569;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.detail-item:last-child {
  margin-bottom: 0;
}

.detail-item i {
  width: 25px;
  height: 25px;
  background: linear-gradient(135deg, #F0F9FF, #E0F2FE);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--promo-primary);
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

/* Promotion Footer */
.promotion-footer {
  margin-top: auto;
}

/* View Details Button */
.btn-view-details {
  width: 100%;
  padding: 0.75rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.2px;
  background: var(--promo-gradient);
  color: white;
}

.btn-view-details::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-view-details:hover::before {
  width: 300px;
  height: 300px;
}

.btn-view-details:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0, 119, 182, 0.5);
}

.btn-view-details i {
  font-size: 1rem;
}

/* === Modal/Popup Styles === */
.promo-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 4, 94, 0.7);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.promo-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.promo-modal {
  background: white;
  border-radius: 24px;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(30px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.promo-modal-overlay.active .promo-modal {
  transform: translateY(0);
}

/* Modal Close Button */
.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 45px;
  height: 45px;
  background: white;
  border: none;
  border-radius: 50%;
  color: var(--promo-primary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--promo-primary);
  color: white;
  transform: rotate(90deg);
}

/* Modal Header */
.modal-header {
  position: relative;
  height: 300px;
  overflow: hidden;
  border-radius: 24px 24px 0 0;
}

.modal-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-badge {
  position: absolute;
  top: 2rem;
  left: 2rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--promo-primary);
  padding: 0.6rem 1.5rem;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Modal Content - แทบเลื่อนขึ้นลง */
.modal-content {
  padding: 2.5rem;
  max-height: calc(90vh - 300px);
  overflow-y: auto;
}

/* เพิ่มแท็บใน modal */
.modal-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid #E2E8F0;
  padding-bottom: 1rem;
}

.modal-tab {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.modal-tab.active {
  color: var(--promo-primary);
  background: #F0F9FF;
}

.modal-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1rem;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--promo-gradient);
  border-radius: 3px;
}

.modal-tab-content {
  display: none;
}

.modal-tab-content.active {
  display: block;
}

.modal-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--promo-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.modal-description {
  color: #475569;
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

/* Modal Details Grid */
.modal-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
  background: #F8FAFC;
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid #E2E8F0;
}

.modal-detail-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.modal-detail-item i {
  width: 50px;
  height: 50px;
  background: var(--promo-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.modal-detail-content h4 {
  font-size: 0.9rem;
  color: #64748B;
  margin: 0 0 0.25rem 0;
  font-weight: 600;
}

.modal-detail-content p {
  font-size: 1.1rem;
  color: var(--promo-secondary);
  font-weight: 700;
  margin: 0;
}

/* Modal Terms */
.modal-terms {
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.modal-terms h4 {
  color: #EA580C;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-terms ul {
  margin: 0;
  padding-left: 1.2rem;
  color: #92400E;
  font-size: 0.95rem;
  line-height: 1.6;
}

.modal-terms li {
  margin-bottom: 0.5rem;
}

.modal-terms li:last-child {
  margin-bottom: 0;
}

/* Modal Action Buttons */
.modal-actions {
  display: flex;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid #E2E8F0;
}

.modal-btn {
  flex: 1;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.modal-btn-primary {
  background: var(--promo-gradient);
  color: white;
}

.modal-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 119, 182, 0.4);
}

.modal-btn-outline {
  background: white;
  color: var(--promo-primary);
  border: 2px solid var(--promo-primary);
}

.modal-btn-outline:hover {
  background: #F0F9FF;
  transform: translateY(-3px);
}

/* === No Results State === */
.no-promotions {
  text-align: center;
  padding: 6rem 3rem;
  background: white;
  border-radius: 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 180, 216, 0.08);
  grid-column: 1 / -1;
}

.no-promotions-icon {
  width: 160px;
  height: 160px;
  margin: 0 auto 2.5rem;
  background: linear-gradient(135deg, #CAF0F8, #90E0EF);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--promo-primary);
  box-shadow: 0 15px 40px rgba(0, 119, 182, 0.2), inset 0 2px 10px rgba(255, 255, 255, 0.5);
}

.no-promotions h3 {
  font-size: 2rem;
  color: var(--promo-secondary);
  margin-bottom: 1rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.no-promotions p {
  color: #64748B;
  font-size: 1.15rem;
  line-height: 1.7;
  font-weight: 500;
}


/* === Loading State === */
.promotions-grid.loading {
  opacity: 0.6;
  pointer-events: none;
}

.promotion-card.loading {
  animation: cardShimmer 1.5s ease-in-out infinite;
}

@keyframes cardShimmer {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* === Responsive Design === */
@media (max-width: 1200px) {
  .promotions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (max-width: 992px) {
  .promo-hero-content h1 {
    font-size: 2rem;
  }

  .promo-hero-content h1 i {
    font-size: 1.85rem;
  }

  .search-card {
    padding: 1.75rem 2rem;
  }
}

@media (max-width: 768px) {
  .promotions-hero {
    padding: 60px 0 80px;
  }

  .promo-hero-content h1 {
    font-size: 1.85rem;
  }

  .promo-hero-content h1 i {
    font-size: 1.65rem;
  }

  .search-card {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .promotions-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .results-header {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
  }

  .results-count {
    width: 100%;
    justify-content: center;
    font-size: 0.95rem;
  }

  .results-count i {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .results-count .count {
    font-size: 1.35rem;
  }

  .results-sort {
    width: 100%;
    flex-direction: column;
    gap: 0.75rem;
  }

  .results-sort label {
    text-align: center;
    font-size: 0.85rem;
  }

  .results-sort .form-select {
    width: 100%;
    font-size: 0.85rem;
  }

  .modal-details-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    padding: 1.5rem;
    max-height: calc(90vh - 250px);
  }

  .modal-tabs {
    flex-direction: column;
  }

  .modal-title {
    font-size: 1.5rem;
  }

  .modal-actions {
    flex-direction: column;
  }
}

@media (max-width: 576px) {
  .promotions-hero {
    padding: 50px 0 70px;
  }

  .promo-hero-content h1 {
    font-size: 1.5rem;
    gap: 0.75rem;
  }

  .promo-hero-content h1 i {
    font-size: 1.35rem;
  }

  .search-card {
    padding: 1.25rem 1rem;
    border-radius: 14px;
  }

  .promotion-content {
    padding: 1.25rem;
  }

  .promotion-title {
    font-size: 1.1rem;
  }

  .modal-header {
    height: 200px;
  }

  .modal-badge {
    top: 1rem;
    left: 1rem;
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
  }

  .modal-detail-item i {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .modal-content {
    padding: 1.25rem;
    max-height: calc(90vh - 200px);
  }
}