/* ============================================
   PREVENT FOUC (Flash of Unstyled Content)
   ============================================ */

/* Body starts hidden, shown when ready */
body.ready {
  visibility: visible !important;
}

/* ============================================
   Base Styles
   ============================================ */

/* Base styling for Leazzy rental site */
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: #121212;
  color: #f5f5f5;
  line-height: 1.6;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: #1e1e1e;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* Increase the size of the logotype to make it more prominent */
  /* Increase the logo size further for better prominence */
  font-size: 3rem;
  font-weight: bold;
  color: #e91e63; /* pink logo color */
}

/* Make the entire logo clickable by styling the anchor */
.logo a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}

.logo svg {
  /* Hide the gamepad icon for a simpler, text-only logo */
  display: none;
}

nav a {
  color: #a0a0a0;
  text-decoration: none;
  margin-left: 0.5rem;
  font-weight: bold;
}

nav a.active {
  color: #ffffff;
}

/* Hero (banner) */
.hero {
  text-align: center;
  padding: 3rem 1rem 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

.hero h1 {
  color: #e91e63;
  margin-bottom: 1rem;
  font-size: 2.5rem;
}

.hero .subtitle {
  font-size: 1.3rem;
  color: #c0c0c0;
  margin-top: 0.5rem;
}

.hero p {
  max-width: 700px;
  margin: 0 auto;
  color: #cccccc;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(90deg, #ff007a, #00ff99, #00aaff);
  color: #121212;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s;
}

.btn:hover {
  transform: scale(1.05);
}

/* Category and product lists */
.categories .grid {
  display: grid;
  /* Fixed 4-column layout for desktop, responsive for mobile */
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* Mobile: single column */
@media (max-width: 768px) {
  .categories .grid {
    grid-template-columns: 1fr;
  }
}

.products .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 0;
}

.categories .card,
.products .card {
  display: block;
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  border-radius: 12px;
  border: 2px solid #2a2a2a;
  background: linear-gradient(145deg, #1a1a1a, #222);
  color: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.categories .card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(233, 30, 99, 0.1), transparent);
  transition: left 0.5s;
}

.categories .card:hover::before,
.products .card:hover::before {
  left: 100%;
}

.categories .card:hover,
.products .card:hover {
  transform: translateY(-4px);
  background: linear-gradient(145deg, #222, #2a2a2a);
  border-color: #e91e63;
  box-shadow: 0 8px 16px rgba(233, 30, 99, 0.2);
}

.categories .placeholder,
.products .placeholder {
  width: 100%;
  height: 120px;
  background-color: #2a2a2a;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.categories .card h3,
.products .card h3 {
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

/* Style category headings as minimal buttons */
.categories .card h3 {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: 2px solid #e91e63;
  color: #e91e63;
  background-color: transparent;
  transition: background-color 0.2s, color 0.2s;
  /* Fixed height to ensure uniform button sizes */
  min-height: 2.5rem;
  line-height: 1.3rem;
  /* Allow text wrapping for multi-word categories */
  max-width: 100%;
  text-align: center;
}

.categories .card:hover h3 {
  background-color: #e91e63;
  color: #121212;
}

.products .card p {
  margin: 0;
  color: #cccccc;
}

/* Product detail page */
.gallery {
  padding: 2rem 0;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.gallery .photo-placeholder {
  width: 100%;
  padding-top: 75%; /* 4:3 aspect ratio */
  background-color: #2a2a2a;
  border-radius: 4px;
  position: relative;
}

.gallery .photo-placeholder::before,
.gallery .photo-placeholder::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  height: 2px;
  background-color: #444444;
  transform: translate(-50%, -50%) rotate(0deg);
}

.gallery .photo-placeholder::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

/* Real images used in galleries */
/*
 * Gallery images on product pages should not overflow their container.  Set a fixed
 * height and use object-fit: cover to preserve aspect ratio without distorting
 * the image.  This ensures that portrait‑oriented photos don't dominate the
 * layout or overlap neighbouring items.  A height of 180px keeps images
 * compact on both desktop and mobile screens.
 */
.gallery img {
  width: 100%;
  max-width: 350px;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  margin: 0 auto;
  display: block;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Images in category and product cards */
/* When replacing the placeholder div with a real image element,
   ensure it fills the card area without distorting the aspect ratio.
   Use object‑fit: contain for category cards so the entire device is visible
   without cropping. Product cards still use cover to maintain a tight crop. */
.categories .card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 1rem;
  transition: transform 0.3s;
}

/* Crop laptop image to match other category proportions */
.categories .card img.laptop-img {
  object-fit: cover;
  object-position: center center;
}

.products .card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 1rem;
  transition: transform 0.3s;
}

.categories .card:hover img,
.products .card:hover img {
  transform: scale(1.05);
}

/* Ensure consistent card heights */
.categories .card,
.products .card {
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

/* Prevent layout shift during product loading */
.products .grid {
  min-height: 400px;
}

.categories .card h3,
.products .card h3 {
  margin-top: auto;
  margin-bottom: 0.5rem;
}

.price-list {
  margin: 1rem 0;
  max-width: 400px;
}

.price-option {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #333333;
}

.price-option:last-child {
  border-bottom: none;
}

.duration {
  font-weight: bold;
}

/* Contact block reused across pages */
.contact-block {
  margin-top: 1rem;
  background-color: #2a2a2a;
  padding: 1rem;
  border-radius: 6px;
  text-align: left;
  /* Hide the contact block by default. It will be shown when the user clicks
     the reservation button on the product page. */
  display: none;
}

.contact-block p {
  margin: 0.5rem 0;
}

.contact-block .contact-numbers {
  font-weight: bold;
}

.contact-block form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-block form input {
  padding: 0.5rem;
  font-size: 0.9rem;
  border: none;
  border-radius: 4px;
}

.contact-block form button {
  padding: 0.5rem;
  font-size: 0.9rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  background: linear-gradient(90deg, #ff007a, #00ff99, #00aaff);
  color: #121212;
  font-weight: bold;
}

.contact-block .note {
  font-size: 0.75rem;
  color: #bbbbbb;
  margin-top: 0.5rem;
}

/* Deposit line styling */
.deposit {
  font-weight: bold;
  margin-top: 0.5rem;
  color: #ffffff;
}

.footer {
  text-align: center;
  padding: 1rem;
  background-color: #1e1e1e;
  font-size: 0.9rem;
  color: #888888;
  margin-top: 2rem;
  margin-left: 0;
  margin-right: 0;
}

/* Rating stars – used on category cards and product pages */
.rating {
  color: #ffd700;
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

/* Availability message shown on category cards */
.availability {
  color: #888888;
  font-size: 0.9rem;
  margin-top: 0.3rem;
  font-weight: 500;
}

/* Availability status colors */
.availability.status-available {
  color: #00ff99;
}

.availability.status-rented {
  color: #ff1493;
}

.availability.status-on-order {
  color: #ffd700;
}

/* Info sections for product specs, pricing */
.info-section {
  background-color: #1a1a1a;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid #2a2a2a;
}

/* The h2 in an info-section should be pink for better readability */
.info-section h2 {
  color: #e91e63;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.info-section h3 {
  color: #ff6b9d;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}

/* Style lists in info sections */
.info-section ul {
  list-style: none;
  padding-left: 0;
}

.info-section ul li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: #e0e0e0;
  line-height: 1.6;
}

.info-section ul li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #e91e63;
  font-weight: bold;
}

.info-section ul li strong {
  color: #ffffff;
}

/* Paragraphs in info sections */
.info-section p {
  color: #c0c0c0;
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.info-section p strong {
  color: #ffffff;
  font-weight: 600;
}

/* Reservation button (book button) */
.book-button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(90deg, #ff007a, #00ff99, #00aaff);
  color: #121212;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.2s;
}

.book-button:hover {
  transform: scale(1.05);
}


/* ============================================
   SUBCATEGORIES SECTION
   ============================================ */

.subcategories {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 2rem;
}

.subcategories h2 {
  text-align: center;
  color: #e91e63;
  margin-bottom: 2rem;
  font-size: 1.8rem;
}

.subcategory-card {
  background: linear-gradient(145deg, #1e1e1e, #2a2a2a);
  border: 2px solid #333;
  transition: all 0.3s;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
}

.subcategory-card:hover {
  border-color: #e91e63;
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(233, 30, 99, 0.3);
}

.subcategory-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.subcategory-card p {
  color: #aaa;
  font-size: 0.9rem;
  margin: 0;
}

.no-products {
  text-align: center;
  color: #999;
  padding: 3rem;
  grid-column: 1 / -1;
}

