/* Global Styles */
:root {
  --primary-color: #000000;
  --secondary-color: #ffffff;
  --accent-color: #f4f4f4;
  --text-color: #333333;
  --font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
  font-family: var(--font-family);
  margin: 0;
  background-color: var(--secondary-color);
  color: var(--text-color);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  text-decoration: none;
  color: var(--primary-color);
}

img {
  max-width: 100%;
  height: auto;
}

/* Header */
.main-header {
  padding: 20px 0;
  border-bottom: 1px solid var(--accent-color);
}

.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
}

.main-nav {
  display: flex;
  gap: 30px;
}

.main-nav a, .header-actions a, .header-actions button {
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

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

#login-btn {
  border: none;
  background: none;
  padding: 0;
  font-family: var(--font-family);
}

.cart-link {
  position: relative;
  display: inline-flex;
  text-decoration: none;
  color: black;
}

.badge {
  position: absolute;
  top: -8px;
  right: -12px;
  background: red;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
}


/* Hero Section */
.hero-section {
  text-align: center;
  padding: 100px 20px;
  background-color: var(--accent-color);
  margin-bottom: 40px;
}

.hero-section h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero-section p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: #666;
}

.shop-now-btn {
  display: inline-block;
  padding: 12px 25px;
  background-color: var(--primary-color);
  color: var(--secondary-color);
  font-size: 1rem;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s;
}

.shop-now-btn:hover {
  background-color: #333;
}

/* Product List */
.product-grid { /* Changed from #product-list */
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* PC layout */
  gap: 20px; /* Updated gap */
  padding: 20px; /* Added padding */
}

/* Responsive adjustment for product list on smaller screens */
@media (max-width: 768px) {
  .product-grid { /* Changed from #product-list */
    grid-template-columns: repeat(2, 1fr); /* Mobile layout */
  }
}

.product-card {
  display: block; /* Ensure the entire card is a clickable block */
  text-decoration: none;
  color: inherit;
  background: var(--secondary-color); /* White background */
  border: 1px solid var(--accent-color);
  transition: box-shadow 0.3s, transform 0.3s;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-image-wrapper { /* New wrapper for image */
  aspect-ratio: 3 / 4; /* Vertical rectangular shape */
  background-color: #f3f4f6; /* Light gray background */
  overflow: hidden; /* Ensure image doesn't overflow */
  display: flex; /* Center image/span vertically and horizontally */
  align-items: center;
  justify-content: center;
}

.product-card img {
  width: 100%;
  height: 100%; /* Fill the wrapper */
  object-fit: cover; /* Maintain aspect ratio and cover container */
  border-radius: 12px; /* Add rounded corners */
}

.product-info {
  padding: 15px; /* Updated padding */
  text-align: left; /* Left alignment for text */
}

.product-info h3 { /* Product title */
  margin: 0 0 5px; /* Updated margin */
  font-size: 1rem; /* Updated font size */
  font-weight: 600; /* Bold product name */
}

.product-info p { /* Product price */
  margin: 0;
  font-weight: normal;
  font-size: 0.9rem; /* Updated font size */
  color: #666; /* Slightly lighter gray for price */
}

/* Product Detail */
.product-container {
  display: flex;
  gap: 50px;
  padding: 80px 0; /* Adjusted padding for more whitespace */
}

.image-section {
  flex-basis: 50%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#product-image {
  width: 100%;
  max-width: 500px;
  border-radius: 8px;
  border: 1px solid var(--accent-color);
  aspect-ratio: 3 / 4; /* New: Maintain 3:4 aspect ratio */
  object-fit: cover; /* New: Ensure image covers the area */
}

.info-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px; /* Adjusted gap */
}

.size-selector {
  margin-top: 10px;
}

.size-selector label {
  font-weight: bold;
  margin-right: 10px;
}

.size-selector select {
  padding: 8px;
  border-radius: 4px;
  border: 1px solid var(--text-color); /* Clean border style */
  background-color: var(--secondary-color);
  color: var(--text-color);
}

.button-group {
  display: flex;
  gap: 10px;
  margin-top: auto; /* Push buttons to the bottom */
  padding-top: 20px;
}

.btn-cart, .btn-buy {
  border: none; /* No border for minimalist look */
  padding: 15px;
  flex: 1;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: background-color 0.2s;
}

.btn-cart {
  background-color: #444; /* Dark gray */
  color: white;
}

.btn-buy {
  background-color: #000; /* Black */
  color: white;
  font-weight: 700; /* Bolder font for buy button */
}

.btn-cart:hover {
  background-color: #555; /* Slightly lighter on hover */
}

.btn-buy:hover {
  background-color: #333; /* Slightly lighter on hover */
}

/* Cart Page */
.cart-container {
  padding: 40px 0;
}

.cart-item {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--accent-color);
}

.cart-item-img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
}

.cart-item-info {
  flex-grow: 1;
}

.cart-item-actions {
  display: flex;
  align-items: center;
}

.remove-item-btn {
  background: none;
  border: 1px solid #ccc;
  color: #777;
  cursor: pointer;
  padding: 5px 10px;
  transition: background-color 0.3s, color 0.3s;
}

.remove-item-btn:hover {
  background-color: var(--primary-color);
  color: var(--secondary-color);
}

.cart-summary {
  margin-top: 40px;
  padding: 30px;
  background-color: var(--accent-color);
  text-align: right;
}

.total-price {
  font-size: 1.5rem;
  font-weight: bold;
}

.checkout-btn {
  margin-top: 20px;
  padding: 15px 30px;
  background: var(--primary-color);
  color: var(--secondary-color);
  border: none;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

.checkout-btn:hover {
  background-color: #333;
}

/* Login Modal */
#login-modal {
  border: 1px solid var(--accent-color);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  padding: 40px;
  max-width: 400px;
  border-radius: 8px;
}

#login-modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

#login-modal h2 {
  margin-top: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-form input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.login-form button {
  padding: 10px;
  border: none;
  background-color: var(--primary-color);
  color: var(--secondary-color);
  cursor: pointer;
}

.close-modal-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.switch-text { 
  margin-top: 15px; 
  font-size: 0.9rem; 
  color: #666; 
  text-align: center; 
}
#toggle-auth { 
  color: #333; 
  font-weight: bold; 
  cursor: pointer; 
  text-decoration: underline; 
}
#toggle-auth:hover { 
  color: blue; 
}

/* Responsive */
@media (max-width: 768px) {
  .main-header .container {
    flex-direction: column;
    gap: 15px;
  }
  
  .main-nav {
    order: 1;
  }

  .hero-section h1 {
    font-size: 2rem;
  }

  .product-detail-container {
    grid-template-columns: 1fr;
  }
}

/* Detail View Section Styles */
#detail-view-section {
  padding: 40px 0;
  margin-top: 40px;
  text-align: center;
  background-color: var(--accent-color);
  border-radius: 8px;
  overflow: hidden;
}

#detail-view-section h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
}

#product-long-desc {
  padding: 20px 15px; /* Adjusted padding */
  font-size: 1rem; /* Slightly reduced font size */
  line-height: 1.8;
  color: #444;
  max-width: 800px; /* Limit width for readability */
  margin: 0 auto 30px auto; /* Center and add space below */
  text-align: center; /* Ensure text is centered */
}

#extra-images-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px; /* Space between images */
    padding-bottom: 20px;
}

.detail-view-image {
  width: 100%;
  max-width: 600px; /* Adjust as needed */
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
}