/* Family Tractors - Montana Style */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --green: #2d5016;
  --green-light: #4a7c23;
  --brown: #8b4513;
  --cream: #f5f5dc;
  --sky: #87ceeb;
  --text: #333;
  --text-light: #666;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--text);
  line-height: 1.6;
  background: var(--cream);
}

a {
  color: var(--green);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  background: var(--green);
  color: white;
  padding: 15px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.logo {
  font-size: 1.6rem;
  font-weight: bold;
  color: white;
  font-family: Georgia, serif;
}

.logo:hover {
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 30px;
}

.nav a {
  color: white;
  font-size: 1.1rem;
}

.nav a:hover {
  color: var(--cream);
}

.header-phone {
  font-size: 1.2rem;
  color: white;
  font-weight: bold;
}

/* Hero with Mountains */
.hero {
  background: linear-gradient(to bottom, var(--sky) 0%, var(--sky) 40%, var(--green-light) 40%, var(--green) 100%);
  color: white;
  padding: 60px 20px 80px;
  text-align: center;
  position: relative;
  min-height: 400px;
}

.hero::before {
  content: '';
  position: absolute;
  bottom: 60%;
  left: 0;
  right: 0;
  height: 200px;
  background:
    linear-gradient(135deg, transparent 40%, #6b8e4e 40%, #6b8e4e 45%, transparent 45%),
    linear-gradient(225deg, transparent 40%, #5a7d3d 40%, #5a7d3d 45%, transparent 45%),
    linear-gradient(160deg, transparent 30%, #7a9d5d 30%, #7a9d5d 38%, transparent 38%),
    linear-gradient(200deg, transparent 30%, #4a6d2d 30%, #4a6d2d 38%, transparent 38%);
  background-size: 300px 200px, 300px 200px, 400px 200px, 400px 200px;
  background-position: 0 0, 150px 0, 50px 0, 250px 0;
  background-repeat: repeat-x;
  opacity: 0.8;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 15px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
  font-size: 1.4rem;
  margin-bottom: 30px;
  opacity: 0.95;
}

.btn {
  display: inline-block;
  padding: 15px 35px;
  border-radius: 5px;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: Georgia, serif;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-primary {
  background: var(--brown);
  color: white;
}

.btn-secondary {
  background: white;
  color: var(--green);
}

/* Section */
.section {
  padding: 60px 20px;
}

.section-title {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 40px;
  color: var(--green);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}

.product-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 15px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image {
  width: 100%;
  height: 220px;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info {
  padding: 20px;
}

.product-category {
  font-size: 0.85rem;
  color: var(--green-light);
  text-transform: uppercase;
  font-weight: bold;
  margin-bottom: 5px;
}

.product-name {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--text);
}

.product-price {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--green);
  margin-bottom: 15px;
}

.product-card .btn {
  width: 100%;
  text-align: center;
}

/* Single Product */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 40px 0;
}

.product-gallery {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.product-gallery img {
  width: 100%;
  height: auto;
  border-radius: 5px;
}

.product-content h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
  color: var(--green);
}

.product-content .product-price {
  font-size: 2rem;
  margin-bottom: 20px;
}

.product-description {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 30px;
  line-height: 1.8;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}

.specs-table th,
.specs-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.specs-table th {
  background: var(--cream);
  font-weight: bold;
  width: 40%;
}

.contact-box {
  background: var(--green);
  color: white;
  padding: 30px;
  border-radius: 10px;
  text-align: center;
}

.contact-box h3 {
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.contact-box .phone {
  font-size: 1.8rem;
  font-weight: bold;
  display: block;
  margin-bottom: 10px;
  color: white;
}

.contact-box a {
  color: var(--cream);
}

/* Filters */
.filter-bar {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  padding: 10px 25px;
  border: 2px solid var(--green);
  background: white;
  color: var(--green);
  border-radius: 25px;
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 1rem;
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--green);
  color: white;
}

/* About Section */
.about-section {
  background: white;
  text-align: center;
}

.about-section p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
  color: var(--text-light);
}

/* Contact Banner */
.contact-banner {
  background: var(--green);
  color: white;
  text-align: center;
}

.contact-banner h2 {
  font-size: 2rem;
  margin-bottom: 15px;
}

.contact-banner p {
  font-size: 1.2rem;
  margin-bottom: 25px;
  opacity: 0.9;
}

.contact-banner .phones {
  font-size: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.contact-banner a {
  color: white;
}

/* Footer */
.footer {
  background: #222;
  color: #ccc;
  padding: 50px 20px 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer h4 {
  color: white;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.footer a {
  color: #ccc;
}

.footer a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid #444;
  color: #888;
}

/* Admin Styles */
.admin-page {
  background: #f0f0f0;
  min-height: 100vh;
}

.admin-header {
  background: var(--green);
  color: white;
  padding: 20px;
  text-align: center;
}

.admin-header h1 {
  margin: 0;
}

.admin-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 20px;
}

.admin-section {
  background: white;
  border-radius: 10px;
  padding: 30px;
  margin-bottom: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-section h2 {
  color: var(--green);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--cream);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--green);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.product-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #eee;
}

.product-list-item:last-child {
  border-bottom: none;
}

.product-list-item h4 {
  margin: 0 0 5px 0;
}

.product-list-item span {
  color: var(--text-light);
  font-size: 0.9rem;
}

.btn-small {
  padding: 8px 15px;
  font-size: 0.9rem;
}

.btn-edit {
  background: var(--green);
  color: white;
}

.btn-danger {
  background: #c0392b;
  color: white;
}

/* Login */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 10px;
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.login-box h2 {
  color: var(--green);
  margin-bottom: 20px;
}

.login-box input {
  width: 100%;
  padding: 15px;
  margin-bottom: 15px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1.1rem;
}

.hidden {
  display: none !important;
}

/* Messages */
.message {
  padding: 15px 20px;
  border-radius: 5px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: bold;
}

.message-success {
  background: #d4edda;
  color: #155724;
}

.message-error {
  background: #f8d7da;
  color: #721c24;
}

/* Loading */
.loading {
  text-align: center;
  padding: 60px;
  color: var(--text-light);
  font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    text-align: center;
  }

  .nav {
    order: 3;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .product-detail {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .contact-banner .phones {
    flex-direction: column;
    gap: 15px;
  }
}
