/* =========================================================
   rental.css - Rental Products Page
   ========================================================= */

/* -- Variables -- */
:root {
  --color-primary:    #114E72;
  --color-header:     #6A8CA0;
  --color-white:      #ffffff;
  --color-border:     #D9D9D9;
  --color-text-muted: #7E7E7E;
  --font-main:        'Hanuman', serif;
  --radius-btn:       20px;
  --radius-sm:        10px;
  --sidebar-width:    340px;
}

/* -- Reset -- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background: #ffffff;
  color: var(--color-primary);
}

a    { text-decoration: none; color: inherit; }
ul   { list-style: none; }
img  { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; }

/* =========================================================
   HEADER  (2 rows: top-bar + navbar)
   ========================================================= */
.SiteHeader {
  width: 100%;
  background: var(--color-header);
  display: flex;
  flex-direction: column;   /* stack 2 rows */
  position: sticky;
  top: 0;
  z-index: 100;
}

/* -- Row 1: logo + actions -- */
.SiteHeader-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
}

.SiteHeader-logo {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
}

.Logo-img {
  width: 82px;
  height: 60px;
  object-fit: contain;
}

.Logo-text {
  color: var(--color-white);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.SiteHeader-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.Icon-faq {
  width: 41px;
  height: 41px;
  object-fit: contain;
}

.BtnLogin {
  background: var(--color-white);
  border-radius: var(--radius-btn);
  border: 2px solid var(--color-white);
  padding: 10px 28px;
  cursor: pointer;
}

.BtnLogin-text {
  color: var(--color-header);
  font-size: 24px;
  font-weight: 900;
}

/* -- Row 2: navbar -- */
.Navbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 40px 18px;
  flex-wrap: nowrap;
}

.BtnLogin {
  background: var(--color-white);
  border-radius: var(--radius-btn);
  border: 2px solid var(--color-white);
  padding: 10px 28px;
  cursor: pointer;
}

.BtnLogin-text {
  color: var(--color-header);
  font-size: 24px;
  font-weight: 900;
}

.Icon-faq-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: opacity 0.2s, filter 0.2s;
  text-decoration: none;
}

.Icon-faq-link:hover {
  filter: brightness(0.85);
}

.NavBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 20px;
  border-radius: var(--radius-btn);
  border: 2px solid var(--color-white);
  background: var(--color-header);
  color: var(--color-white);
  font-size: 16px;
  font-family: var(--font-main);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s;
}

.NavBtn:hover        { background: rgba(255,255,255,0.15); }
.NavBtn--active      { background: var(--color-primary); }

/* =========================================================
   LAYOUT: sidebar + product area
   ========================================================= */
.Content {
  display: flex;
  align-items: flex-start;
  width: 100%;
  min-height: calc(100vh - 140px);
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.Sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  padding: 24px 28px 40px 32px;
  border-right: 1px solid var(--color-border);
  min-height: 100%;
}

.Filter-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 14px;
}

.Filter-search { margin-bottom: 14px; }

.Filter-input {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-btn);
  border: 1px solid #000;
  padding: 0 16px;
  font-size: 18px;
  font-family: var(--font-main);
  color: var(--color-text-muted);
  outline: none;
}

.Filter-input:focus { border-color: var(--color-primary); }

.Filter-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 4px;
}

.Filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* custom checkbox */
.Filter-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 21px;
  height: 19px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}

.Filter-item input[type="checkbox"]:checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.Filter-item input[type="checkbox"]:checked::after {
  content: '\2713';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 13px;
  font-weight: 700;
}

.Filter-item label {
  font-size: 13px;
  color: var(--color-primary);
  cursor: pointer;
}

.Filter-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 20px 0;
}

/* SEX: 2-column grid */
.Filter-sex-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
  padding-left: 4px;
}

/* =========================================================
   PRODUCT AREA
   ========================================================= */
.ProductArea {
  flex: 1;
  padding: 24px 32px 40px 32px;
  min-width: 0;
}

/* -- Toolbar -- */
.Toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.Toolbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 440px;
  height: 48px;
  border-radius: var(--radius-btn);
  border: 1px solid #000;
  padding: 0 16px;
  background: var(--color-white);
}

.Toolbar-search-icon {
  width: 29px;
  height: 29px;
  flex-shrink: 0;
  object-fit: contain;
}

.Toolbar-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 20px;
  font-family: var(--font-main);
  color: var(--color-text-muted);
  background: transparent;
}

.Toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.Toolbar-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-btn);
  border: 1px solid #000;
  background: var(--color-white);
  cursor: pointer;
  font-size: 17px;
  font-weight: 500;
  color: var(--color-text-muted);
  font-family: var(--font-main);
  user-select: none;
  color: var(--color-primary);
}
 
.Toolbar-sort-arrow { 
    font-size: 13px;
    font-weight: 900;
    color: var(--color-primary);
    font-family: var(--font-main);
 }
 
/* -- Sort dropdown menu -- */
.Toolbar-sort {
  position: relative;   /* anchor สำหรับ dropdown */
}
 
.Sort-dropdown {
  display: none;        /* ซ่อนไว้ก่อน */
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--color-white);
  border: 1px solid #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 200;
  list-style: none;
  padding: 6px 0;
}
 
.Sort-dropdown.open {
  display: block;       /* แสดงเมื่อเปิด */
}
 
.Sort-option {
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 525;
  font-family: var(--font-main);
  color: var(--color-primary);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
 
.Sort-option:hover {
  background: rgba(17, 78, 114, 0.08);
}

.Toolbar-view-btn1 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 49px;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid #000;
  background: var(--color-white);
  color: var(--color-primary);
  font-size: 18px;
  font-weight: 400;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.Toolbar-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 49px;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid #000;
  background: var(--color-white);
  color: var(--color-primary);
  font-size: 18px;
  font-weight: 505;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.Toolbar-view-btn.active,
.Toolbar-view-btn:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

/* -- Product Grid -- */
.ProductGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.ProductCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.ProductCard:hover { transform: translateY(-4px); }

.ProductCard img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 4px;
  background: #eee;
}

.ProductCard-name {
  text-align: center;
  color: #000000;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  padding: 0 4px;
}

.ProductCard-price {
  text-align: left;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 515;
  line-height: 0.7;
  padding: 0 4px;
}

/* -- List view toggle -- */
.ProductGrid.list-view { grid-template-columns: 1fr; }

.ProductGrid.list-view .ProductCard {
  flex-direction: row;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 16px;
}

.ProductGrid.list-view .ProductCard img {
  width: 120px;
  aspect-ratio: 3 / 4;
  flex-shrink: 0;
}

.ProductGrid.list-view .ProductCard-name {
  text-align: left;
  font-size: 16px;
}

/* =========================================================
   CHECKOUT PAGE STYLES
   ========================================================= */
.Checkout-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px 80px;
  width: 100%;
}

.Checkout-header {
  margin-bottom: 32px;
}

.Checkout-title {
  font-size: 32px;
  font-weight: 900;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.Checkout-subtitle {
  font-size: 16px;
  color: var(--color-text-muted);
}

.Checkout-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  align-items: start;
}

.Form-group-box {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin-bottom: 24px;
}

.Form-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 10px;
}

.Input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.Input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.Input-group label {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
}

.Checkout-input {
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0 14px;
  font-family: var(--font-main);
  font-size: 15px;
  outline: none;
  color: var(--color-primary);
}

.Checkout-input:focus {
  border-color: var(--color-primary);
}

.Checkout-input.textarea {
  height: 80px;
  padding: 12px 14px;
  resize: vertical;
}

.Note-text {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: -4px;
}

/* Payment Methods */
.Payment-methods {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.Payment-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.Payment-option:hover {
  border-color: var(--color-primary);
}

.Payment-option input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.Payment-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary);
}

/* Summary Section */
.Summary-box {
  background: #f7fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 24px;
  position: sticky;
  top: 140px;
}

.Summary-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--color-primary);
  margin-bottom: 20px;
}

.Summary-product {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.Summary-product-img {
  width: 80px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
}

.Summary-product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.Summary-product-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.Summary-product-price {
  font-size: 15px;
  font-weight: 900;
  color: var(--color-header);
}

.Summary-divider {
  border: none;
  border-top: 1px dashed var(--color-border);
  margin: 16px 0;
}

.Summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--color-primary);
}

.Summary-row.total {
  font-size: 18px;
  font-weight: 900;
  margin-top: 8px;
  margin-bottom: 24px;
}

.Btn-confirm {
  width: 100%;
  height: 50px;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 900;
  font-family: var(--font-main);
  cursor: pointer;
  transition: opacity 0.2s;
}

.Btn-confirm:hover {
  opacity: 0.9;
}

/* Responsive adjust */
@media (max-width: 900px) {
  .Checkout-grid {
    grid-template-columns: 1fr;
  }
}

.ProductGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px;
}

.ProductCard {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    overflow: hidden;
    cursor: pointer;
    transition: 0.3s;
}

.ProductCard:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); }

.ProductCard-img img {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.ProductCard-info { padding: 15px; }
.ProductCard-title { margin: 0; font-size: 1rem; color: #333; }
.ProductCard-category { color: #888; font-size: 0.85rem; margin: 5px 0; }
.ProductCard-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.ProductCard-price { font-weight: bold; color: #114E72; font-size: 1.1rem; }
.BtnRent { background: #114E72; color: white; border: none; padding: 6px 12px; border-radius: 5px; cursor: pointer; }