@import url("https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700;900&display=swap");

:root {
  --primary-dark: #0b2b17;
  --primary: #164a2a;
  --primary-light: #226b3d;
  --accent: #d4af37;
  --bg: #f7f9f8;
  --card-bg: #ffffff;
  --text-main: #2d3748;
  --text-muted: #718096;
  --error: #e53e3e;
  --success: #38a169;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.12);
  --radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Vazirmatn", sans-serif;
  direction: rtl;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}
img {
  max-width: 100%;
  display: block;
}

/* === Header === */
header {
  background: var(--primary-dark);
  color: white;
  padding: 0 5%;
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.logo {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo i {
  font-size: 1.8rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 35px;
}

nav ul li a {
  font-weight: 500;
  font-size: 1rem;
  position: relative;
  transition: var(--transition);
}

nav ul li a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition);
}

nav ul li a:hover {
  color: var(--accent);
}
nav ul li a:hover::after {
  width: 100%;
}

.header-actions {
  display: flex;
  gap: 25px;
  align-items: center;
}

.auth-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  transition: var(--transition);
}
.auth-link:hover {
  color: var(--accent);
}

.cart-icon {
  position: relative;
  font-size: 1.4rem;
  cursor: pointer;
  transition: var(--transition);
}
.cart-icon:hover {
  transform: scale(1.1);
  color: var(--accent);
}

#cart-count {
  position: absolute;
  top: -10px;
  left: -12px;
  background: var(--accent);
  color: var(--primary-dark);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 900;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

@keyframes bounce {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.4);
  }
}
.bounce {
  animation: bounce 0.4s ease;
}

/* === Main & Hero === */
main {
  min-height: calc(100vh - 160px);
  padding-bottom: 60px;
}

.hero {
  background: linear-gradient(
    135deg,
    var(--primary-dark) 0%,
    var(--primary) 100%
  );
  color: white;
  padding: 100px 5% 120px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(212, 175, 55, 0.1) 0%,
    transparent 70%
  );
  animation: pulse 10s infinite alternate;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.1);
  }
}

.hero h1 {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* === Section Titles === */
.section-title {
  text-align: center;
  margin: 60px 0 40px;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-dark);
  position: relative;
  display: inline-block;
  width: 100%;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background: var(--accent);
  margin: 15px auto 0;
  border-radius: 2px;
}

/* === Products Grid === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.products-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  width: 280px;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.card-img-wrapper {
  height: 320px;
  overflow: hidden;
  position: relative;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .card-img-wrapper img {
  transform: scale(1.08);
}

.card-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--accent);
  color: var(--primary-dark);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.card-body .author {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 15px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px dashed #eee;
}

.price {
  color: var(--primary);
  font-weight: 900;
  font-size: 1.1rem;
}

.btn {
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(22, 74, 42, 0.3);
}

.btn-accent {
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 700;
}
.btn-accent:hover {
  background: #c29b27;
  box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

/* === Product Details === */
.details-container {
  display: flex;
  gap: 50px;
  background: var(--card-bg);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin-top: 40px;
  flex-wrap: wrap;
}

.details-img {
  width: 350px;
  height: 500px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
}

.details-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.details-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.details-info h1 {
  font-size: 2.2rem;
  color: var(--primary-dark);
}

.details-info .price-large {
  font-size: 1.8rem;
  color: var(--primary);
  font-weight: 900;
}

.details-info .desc {
  color: var(--text-muted);
  text-align: justify;
  line-height: 2;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.specs-table th,
.specs-table td {
  padding: 12px 15px;
  text-align: right;
  border-bottom: 1px solid #f0f0f0;
}

.specs-table th {
  background: var(--bg);
  font-weight: 700;
  color: var(--primary-dark);
  width: 30%;
}

/* === Contact Form === */
.contact-wrapper {
  max-width: 700px;
  margin: 40px auto;
  background: var(--card-bg);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.form-group {
  margin-bottom: 25px;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--primary-dark);
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  background: #fafafa;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(22, 74, 42, 0.1);
}

.error-msg {
  color: var(--error);
  background: #fff5f5;
  border: 1px solid #fed7d7;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: none;
  font-size: 0.9rem;
  line-height: 1.8;
}

/* === Footer === */
footer {
  background: var(--primary-dark);
  color: white;
  padding: 60px 5% 30px;
  margin-top: 80px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col h4 {
  color: var(--accent);
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col ul li a {
  opacity: 0.8;
  transition: var(--transition);
  font-size: 0.95rem;
}

.footer-col ul li a:hover {
  opacity: 1;
  color: var(--accent);
  padding-right: 5px;
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  opacity: 0.6;
  font-size: 0.9rem;
}

/* === Responsive === */
@media (max-width: 992px) {
  .details-container {
    flex-direction: column;
    align-items: center;
  }
  .details-img {
    width: 100%;
    max-width: 400px;
    height: 500px;
  }
}

@media (max-width: 768px) {
  header {
    height: auto;
    padding: 15px 5%;
    flex-direction: column;
    gap: 15px;
  }

  nav ul {
    gap: 20px;
    font-size: 0.9rem;
  }
  .header-actions {
    gap: 15px;
  }

  .hero {
    padding: 60px 5% 80px;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 1rem;
  }

  .product-card {
    width: 100%;
    max-width: 350px;
  }
  .card-img-wrapper {
    height: 280px;
  }

  .contact-wrapper {
    padding: 25px;
    margin: 20px;
  }
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  .footer-col ul {
    align-items: center;
  }
}
