/* ==================== VARIABLES ==================== */
:root {
  --primary: #2C1E0F;
  --secondary: #D9B382;
  --bg: #1F140C;
  --text: #F5E6D3;
  --box-bg: #3A2C1E;
  --nav-bg: #23180D;
  --accent: #2A6F2F;
  --accent-hover: #1F5A24;
  --save: #5F7A8C;
  --danger: #B34A4A;
  --out-of-stock: #865d3f;
  --white: #FFFFFF;
  --shadow: 0 6px 12px rgba(0,0,0,0.5);
  --radius: 15px;
  --heading-font: 'Cormorant Garamond', serif;
  --body-font: 'Nunito', sans-serif;
  --link-color: #D9B382;
  --link-hover: #F5E6D3;
  --border-color: #5F4E3C;
  --modal-overlay: rgba(0,0,0,0.9);
  --cookie-bg: #23180D;
  --button-bg: #91877B;
  --button-hover: #728D74;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--body-font);
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  width: 100%;
  overflow-x: hidden;
  font-weight: 300;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

/* ==================== HEADER & NAVIGATION ==================== */
header {
  background: var(--primary);
  color: var(--white);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  width: 100%;
}

.header-social {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.header-social .social-icon {
  color: var(--white);
  font-size: 1.2rem;
  opacity: 0.8;
  transition: opacity 0.2s, color 0.2s;
}

.header-social .social-icon:hover {
  opacity: 1;
  color: var(--secondary);
}

.logo {
  width: 60px;
  height: 60px;
  background: #A67B5B;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-wrapper {
  flex: 1;
  text-align: center;
  min-width: 0;
  padding: 0 8px;
}

.brand-name {
  font-size: 2rem;
  letter-spacing: 3px;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--heading-font);
}

.tagline {
  font-size: 1.2rem;
  font-family: cursive;
  color: rgba(255,255,255,0.8);
  letter-spacing: 1px;
  margin-top: 0;
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
}

.spacer {
  width: 60px;
  height: 60px;
  visibility: hidden;
  flex-shrink: 0;
}

.nav-bar {
  background: var(--nav-bg);
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  flex-wrap: wrap;
}

.nav-bar button {
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: all 0.2s;
  touch-action: manipulation;
  min-width: 44px;
  font-family: var(--body-font);
}

.nav-bar button:hover {
  background: rgba(255,255,255,0.1);
}

.nav-bar button.active-nav {
  color: var(--secondary);
  border-bottom: 2px solid var(--secondary);
  border-radius: 0;
}

/* ==================== PAGE CONTAINERS ==================== */
.page {
  display: none;
  padding: 1.5rem 1rem;
  max-width: 1000px;
  margin: 0 auto;
  min-height: 80vh;
  position: relative;
  z-index: 1;
  width: 100%;
}

.page.active {
  display: block;
}

/* ==================== HOME PAGE ==================== */
#page-home {
  background-color: var(--bg);
  background-image: url('images/man-in-woodworkshop.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 80vh;
}

#page-home > div:first-child {
  background: rgba(44,30,15,0.8);
  border-radius: 30px;
  padding: 4rem 1rem;
  text-align: center;
  color: var(--text);
  position: relative;
  z-index: 2;
}

#home-footer-section1-heading,
#home-footer-section2-heading {
  margin: 1.5rem 0 0.5rem;
}

#home-footer-section1-heading h3,
#home-footer-section2-heading h3 {
  font-size: 1.8rem;
  font-family: var(--heading-font);
  font-weight: 600;
  color: var(--text);
}

#home-footer-section1-text,
#home-footer-section2-text {
  margin-bottom: 1.5rem;
}

#home-footer-section1-text p,
#home-footer-section2-text p,
#home-footer-section1-text li,
#home-footer-section2-text li {
  font-size: 1.1rem;
  line-height: 1.6;
}

#home-footer-section1-text ul,
#home-footer-section2-text ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
  text-align: left;
}

#home-footer-section1-text li,
#home-footer-section2-text li {
  margin-bottom: 0.25rem;
}

/* ==================== BACKGROUND OVERLAY ==================== */
.page:not(#page-home) {
  background-image: url('images/man-in-woodworkshop.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.page:not(#page-home)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(31,20,12,0.75);
  z-index: 1;
  pointer-events: none;
}

.page:not(#page-home) > * {
  position: relative;
  z-index: 2;
}

/* ==================== DETAIL FOOTER (SHARE/BACK BUTTONS) ==================== */
.detail-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
  min-height: 50px;
}

.share-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
}

.share-text {
  color: var(--secondary);
  font-size: 0.9rem;
  white-space: nowrap;
  line-height: 1.2;
}

.share-button {
  background: none;
  border: none;
  color: var(--secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.share-button:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
  transform: translateY(-2px);
}

.back-button {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  height: 40px;
}

.back-button:hover {
  text-decoration: underline;
}

.share-container {
  position: relative;
  display: inline-block;
}

/* ==================== SHARE MENU - OPENS TO THE RIGHT ==================== */
.share-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: auto;
  background: var(--box-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.5rem 0;
  min-width: 200px;
  box-shadow: var(--shadow);
  z-index: 10000;
  margin-bottom: 10px;
  white-space: nowrap;
}

@media only screen and (max-width: 480px) {
  .share-menu {
    max-width: calc(100vw - 20px);
    white-space: normal;
    min-width: 160px;
  }

  .share-option {
    white-space: normal;
    word-break: break-word;
  }
}

@media only screen and (max-width: 360px) {
  .share-menu {
    max-width: 95vw;
  }
}

.share-menu.hidden {
  display: none;
}

.share-option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.2rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s;
  font-size: 1rem;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.share-option:last-child {
  border-bottom: none;
}

.share-option:hover {
  background: #4A3A2A;
}

.share-option i {
  width: 1.5rem;
  text-align: center;
  font-size: 1.2rem;
  color: var(--secondary);
}

@media only screen and (max-width: 480px) {
  .share-text {
    display: none;
  }
}

/* ==================== BACK TO TOP BUTTON ==================== */
.back-to-top {
  display: inline-block;
  margin-top: 0.1rem;
  margin-bottom: 0.1rem;
  text-align: right;
  width: 100%;
  color: var(--secondary);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  transition: color 0.2s;
}

.back-to-top:hover {
  color: var(--text);
}

/* ==================== GALLERY CONTROLS ==================== */
.gallery-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
  width: 100%;
}

.category-filter {
  min-width: 250px;
}

.category-select {
  width: 100%;
  padding: 12px 20px;
  border-radius: 25px;
  border: 1px solid var(--border-color);
  background: var(--box-bg);
  color: var(--text);
  font-family: var(--body-font);
  cursor: pointer;
  font-size: 1rem;
}

.category-select option {
  background: var(--box-bg);
  color: var(--text);
}

@media (max-width: 768px) {
  .gallery-controls {
    justify-content: center;
  }
  
  .category-filter {
    width: 100%;
    max-width: 400px;
  }
}

@media (max-width: 480px) {
  .category-filter {
    max-width: 100%;
  }
}

/* ==================== GRIDS ==================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ==================== CARDS ==================== */
.card {
  background: var(--box-bg);
  padding: 1rem;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
  color: var(--text);
  word-break: break-word;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 400px;
}

.card:hover {
  transform: translateY(-5px);
  background: #4A3A2A;
}

.card img.product-thumb {
  width: 100%;
  height: 180px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 10px;
  background: #4A3A2A;
  display: block;
  flex-shrink: 0;
}

.card h3 {
  margin: 0.5rem 0;
  font-size: 1.1rem;
  min-height: 2.6rem;
  line-height: 1.3;
  flex-shrink: 0;
}

/* Clamp lines for text truncation - standard alternative */
.card h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card p {
  color: var(--secondary);
  font-weight: bold;
  margin: 0.5rem 0;
  min-height: 1.5rem;
  flex-shrink: 0;
}

.stock-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0.5rem auto 0;
  width: fit-content;
  align-self: center;
  flex-shrink: 0;
}

.stock-badge.in-stock {
  background: #4a4848;
  color: white;
}

.stock-badge.out-of-stock {
  background: var(--out-of-stock);
  color: white;
}

.card.out-of-stock {
  opacity: 0.7;
  cursor: not-allowed;
  position: relative;
}

.card.out-of-stock::after {
  content: "OUT OF STOCK";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: bold;
  z-index: 10;
}

/* ==================== PROJECT CARDS ==================== */
.blog-card {
  background: var(--box-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card:hover {
  transform: translateY(-5px);
  background: #4A3A2A;
}

.blog-img {
  height: 200px;
  background: #4A3A2A;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.blog-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #4A3A2A;
}

.blog-content {
  padding: 1.5rem 1rem;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.blog-content .blog-date {
  font-size: 0.8rem;
  color: var(--secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.blog-content h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.4;
  min-height: 3rem;
}

.blog-content h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-content p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

.blog-content p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== ABOUT CARD ==================== */
.about-card {
  background: var(--box-bg);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
  color: var(--text);
}

.about-img {
  height: 200px;
  background: #4A3A2A;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--text);
  overflow: hidden;
}

.about-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-content {
  padding: 1.5rem;
}

.about-cap {
  display: block;
  font-size: 0.8rem;
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ==================== IMAGES ==================== */
.product-thumb {
  width: 100%;
  height: 180px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 10px;
  background: #4A3A2A;
  display: block;
  flex-shrink: 0;
}

.product-thumb-large {
  max-width: 100%;
  max-height: 400px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 10px;
  background: #4A3A2A;
  padding: 10px;
}

.item-thumb {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: middle;
}

/* ==================== IMAGE GALLERIES ==================== */
.image-gallery,
.project-image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.image-gallery img,
.project-image-gallery img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 12px;
  background: #4A3A2A;
  padding: 10px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.image-gallery img:hover,
.project-image-gallery img:hover {
  opacity: 0.9;
}

/* ==================== WORKSHOP GRID ==================== */
.workshop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.workshop-grid .workshop-item {
  background: #4A3A2A;
  height: 150px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.workshop-grid .workshop-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ==================== DETAIL VIEWS ==================== */
.detail-view {
  background: var(--box-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  position: relative;
  padding-bottom: 1rem;
}

/* Fixed: Removed invalid bottom/right on static position */
.detail-view .back-button {
  position: relative;
}

.disclaimer {
  font-size: 0.9rem;
  font-style: italic;
  margin: 10px 0;
  color: var(--secondary);
}

/* ==================== VIDEO CONTAINER (for icon) ==================== */
.video-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--button-bg);
  color: white;
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  margin: 15px auto;
  transition: background 0.2s, transform 0.2s;
  width: fit-content;
  border: none;
}

.video-icon-wrapper i {
  font-size: 1.5rem;
}

.video-icon-wrapper:hover {
  background: var(--button-hover);
  transform: translateY(-2px);
}

/* ==================== VIDEO MODAL ==================== */
.video-modal {
  display: none;
  position: fixed;
  z-index: 6000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
  align-items: center;
  justify-content: center;
}

.video-modal.active {
  display: flex;
}

.video-modal-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  background: var(--box-bg);
  border-radius: 16px;
  padding: 20px;
  border: 2px solid var(--secondary);
}

.video-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.video-close:hover {
  color: var(--secondary);
}

.video-modal-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.video-modal-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ==================== CONTACT FORM ==================== */
.contact-container {
  background: var(--box-bg);
  padding: 1.5rem;
  border-radius: 20px;
  box-shadow: var(--shadow);
  color: var(--text);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: var(--text);
}

input, textarea, select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background: #4A3A2A;
  color: var(--text);
  font-family: var(--body-font);
}

select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23F5E6D3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

/* ==================== BASKET UI ==================== */
.item-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--box-bg);
  border-radius: 8px;
  margin-bottom: 8px;
  color: var(--text);
  gap: 10px;
}

/* ==================== BUTTONS ==================== */
.btn-accent {
  background: var(--button-bg);
  color: var(--white);
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  width: 100%;
  max-width: 280px;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
  touch-action: manipulation;
  font-family: var(--body-font);
}

.btn-accent:hover {
  background: var(--button-hover);
  transform: translateY(-2px);
}

.btn-accent:disabled {
  background: #666;
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  width: 100%;
  max-width: 280px;
  margin-top: 10px;
  font-weight: 600;
  font-family: var(--body-font);
  transition: all 0.2s, transform 0.2s;
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

.btn-sm {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  padding: 0 6px;
  color: var(--text);
  min-width: 40px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--secondary);
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.9rem;
  padding: 8px 4px;
  touch-action: manipulation;
  font-family: var(--body-font);
}

.link-btn:hover {
  color: var(--text);
}

.link-btn.red {
  color: var(--danger);
}

.link-btn.red:hover {
  color: #ff6666;
}

/* ==================== CHECKOUT STEPS ==================== */
.checkout-step {
  background: var(--box-bg);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 20px;
}

.checkout-step h3 {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.delivery-option {
  margin: 15px 0;
  padding: 10px;
  background: #4A3A2A;
  border-radius: 8px;
}

.payment-method {
  display: flex;
  gap: 20px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.payment-method label {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #4A3A2A;
  padding: 10px 15px;
  border-radius: 30px;
  cursor: pointer;
}

.card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.card-field {
  flex: 1 1 200px;
}

.small-field {
  flex: 1 1 100px;
}

/* ==================== ADMIN PANEL ==================== */
.admin-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.2s;
  margin-left: 1rem;
}

.admin-toggle:hover {
  opacity: 1;
  transform: translateY(-2px);
}

#admin-panel {
  background: var(--box-bg);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 2rem;
  border: 2px solid var(--accent);
  box-shadow: var(--shadow);
}

#admin-panel h3 {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.admin-section {
  margin-bottom: 2rem;
  background: #4A3A2A;
  padding: 1.5rem;
  border-radius: var(--radius);
}

.admin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 10px;
}

.admin-item button {
  background: var(--danger);
  color: white;
  border: none;
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  margin-left: 0.5rem;
}

.admin-item button.edit {
  background: var(--save);
}

.admin-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-form .full-width {
  grid-column: span 2;
}

.admin-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.import-export {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ==================== PAGE CONTENT EDITOR ==================== */
.page-editor {
  background: #4A3A2A;
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

.page-editor summary {
  cursor: pointer;
  font-weight: bold;
  margin-bottom: 1rem;
  color: var(--secondary);
}

.page-editor .form-group {
  margin-bottom: 1rem;
}

.page-editor label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--secondary);
}

.page-editor input, 
.page-editor textarea {
  width: 100%;
  padding: 0.5rem;
  background: #3A2C1E;
  border: 1px solid var(--border-color);
  color: var(--text);
  border-radius: 6px;
}

/* ==================== ADMIN TABS ==================== */
.admin-tab {
  display: none;
}

.admin-tab.active {
  display: block;
}

/* ==================== UTILITY CLASSES ==================== */
.hidden {
  display: none !important;
}

#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  display: none;
  z-index: 2000;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* ==================== COOKIE BANNER ==================== */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--cookie-bg);
  color: var(--text);
  padding: 1.2rem 2rem;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  z-index: 3000;
  border-top: 2px solid var(--secondary);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
  font-size: 0.95rem;
}

#cookie-banner p {
  margin: 0;
  flex: 1 1 100px;
}

#cookie-banner a {
  color: var(--secondary);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

#cookie-banner a:hover {
  color: var(--text);
}

.cookie-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#cookie-banner button {
  background: var(--button-bg);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  touch-action: manipulation;
  transition: background 0.2s, transform 0.1s;
  min-width: 100px;
}

#cookie-banner button:hover {
  background: var(--button-hover);
  transform: translateY(-2px);
}

#cookie-banner button.reject {
  background: #5F4E3C;
  border: 1px solid var(--secondary);
}

#cookie-banner button.reject:hover {
  background: #6F5E4C;
  transform: translateY(-2px);
}

/* ==================== LEGAL MODAL STYLES ==================== */
.legal-modal {
  display: none;
  position: fixed;
  z-index: 4000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay);
  align-items: center;
  justify-content: center;
}

.legal-modal.active {
  display: flex;
}

.legal-modal-content {
  background: var(--box-bg);
  color: var(--text);
  max-width: 900px;
  width: 95%;
  max-height: 85vh;
  border-radius: 16px;
  border: 1px solid var(--secondary);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.legal-modal-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.legal-modal-header h2 {
  margin: 0;
  color: var(--secondary);
  font-size: 1.6rem;
  font-family: var(--heading-font);
}

.legal-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 2.2rem;
  cursor: pointer;
  padding: 0 0.5rem;
  transition: color 0.2s, transform 0.2s;
}

.legal-close:hover {
  color: var(--secondary);
  transform: scale(1.1);
}

.legal-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.legal-modal-body .cancellation-form,
.legal-modal-body p[style*="background: #f5f5f5"],
.legal-modal-body p[style*="background: #f5f5f5;"] {
  background: #f8f4e9 !important;
  color: #1a1a1a !important;
  padding: 1.5rem !important;
  border-radius: 12px !important;
  border: 1px solid var(--secondary) !important;
  font-family: monospace;
  margin: 1.5rem 0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.legal-modal-body .cancellation-form strong,
.legal-modal-body p[style*="background: #f5f5f5"] strong {
  color: #2C1E0F;
}

.copy-button-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.copy-cancellation-btn {
  background: var(--button-bg);
  color: white;
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s, transform 0.2s;
  border: 1px solid transparent;
}

.copy-cancellation-btn:hover {
  background: var(--button-hover);
  transform: translateY(-2px);
}

.copy-cancellation-btn i {
  font-size: 1rem;
}

.copy-cancellation-btn.copied {
  background: var(--save);
}

.legal-modal-body h3 {
  color: var(--secondary);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.3rem;
}

.legal-modal-body h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text);
}

.legal-modal-body p {
  margin-bottom: 1rem;
}

.legal-modal-body ul, 
.legal-modal-body ol {
  padding-left: 2rem;
  margin-bottom: 1.5rem;
}

.legal-modal-body li {
  margin-bottom: 0.5rem;
}

.legal-modal-body a {
  color: var(--link-color);
  text-decoration: underline;
  cursor: pointer;
}

.legal-modal-body a:hover {
  color: var(--link-hover);
}

.legal-modal-body strong {
  color: var(--secondary);
}

.legal-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  background: var(--nav-bg);
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.legal-modal-footer .btn-outline {
  max-width: 120px;
  margin: 0;
}

/* ==================== FOOTER (WITH LEGAL LINKS) ==================== */
footer {
  background: var(--primary);
  color: var(--white);
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-color);
  margin-top: 0.1rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-left-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-legal-links {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.footer-legal-links a {
  color: var(--secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  border: 1px solid transparent;
  transition: all 0.2s, transform 0.2s;
  cursor: pointer;
}

.footer-legal-links a:hover {
  border-color: var(--secondary);
  background: rgba(217, 179, 130, 0.1);
  color: var(--text);
  transform: translateY(-2px);
}

.footer-legal-links .separator {
  color: var(--border-color);
  font-size: 0.8rem;
}

/* Footer contact info (phone and email) */
.footer-contact {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-contact span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text);
  opacity: 0.9;
}

.footer-contact i {
  color: var(--secondary);
  font-size: 0.9rem;
}

.social-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social-icon {
  color: var(--secondary);
  font-size: 1.2rem;
  transition: color 0.2s, opacity 0.2s, transform 0.2s;
  opacity: 0.8;
}

.social-icon:hover {
  color: var(--text);
  opacity: 1;
  transform: translateY(-2px);
}

.sitemap-text {
  background: none;
  border: 1px solid var(--secondary);
  color: var(--secondary);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s, transform 0.2s;
  touch-action: manipulation;
}

.sitemap-text:hover {
  background: var(--secondary);
  color: var(--primary);
  transform: translateY(-2px);
}

.copyright {
  font-size: 1rem;
  color: var(--text);
  opacity: 0.9;
}

/* Mobile responsive for footer contact */
@media (max-width: 560px) {
  .footer-contact {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* ==================== SITEMAP MODAL ==================== */
#sitemap-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  visibility: hidden;
  opacity: 0;
  transition: 0.2s;
}

#sitemap-modal.active {
  visibility: visible;
  opacity: 1;
}

.modal-content {
  background: var(--box-bg);
  padding: 2rem;
  border-radius: var(--radius);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  color: var(--text);
  box-shadow: var(--shadow);
  border: 1px solid var(--secondary);
}

.modal-content h3 {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  color: var(--secondary);
}

.modal-content ul {
  list-style: none;
}

.modal-content li {
  margin: 0.8rem 0;
}

.modal-content a {
  color: var(--secondary);
  text-decoration: none;
  font-size: 1.1rem;
  display: block;
  padding: 0.3rem 0;
  transition: color 0.2s, padding-left 0.2s;
}

.modal-content a:hover {
  color: var(--text);
  padding-left: 0.5rem;
  text-decoration: underline;
}

.close-modal {
  background: var(--button-bg);
  color: white;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  margin-top: 1.5rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
}

.close-modal:hover {
  background: var(--button-hover);
  transform: translateY(-2px);
}

/* ==================== LIGHTBOX ==================== */
.lightbox {
  display: none;
  position: fixed;
  z-index: 5000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
  border: 5px solid var(--secondary);
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  background: #fff;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s, transform 0.2s;
}

.lightbox-close:hover {
  color: var(--secondary);
  transform: scale(1.1);
}

.lightbox-caption {
  margin-top: 10px;
  color: #fff;
  font-size: 1rem;
  text-align: center;
  max-width: 80%;
}

/* ==================== PROJECT DETAIL DATE ALIGNMENT ==================== */
#projectDetailContent .blog-date {
  display: block;
  text-align: left;
  margin: 20px 0 5px;
  font-size: 1rem;
  color: var(--secondary);
}

/* ==================== MOBILE TWEAKS ==================== */
@media (max-width: 768px) {
  .footer-legal-links {
    gap: 0.5rem;
  }
  
  .footer-legal-links a {
    font-size: 0.85rem;
    padding: 0.2rem 0.6rem;
  }
  
  .legal-modal-content {
    width: 98%;
    max-height: 90vh;
  }
  
  .legal-modal-header h2 {
    font-size: 1.3rem;
  }
  
  .legal-modal-body {
    padding: 1rem;
  }
}

@media (max-width: 560px) {
  header {
    padding: 0.8rem 0.8rem;
  }
  
  .brand-name {
    font-size: 1.4rem;
    white-space: normal;
    letter-spacing: 1.5px;
    line-height: 1.2;
  }
  
  .tagline {
    font-size: 1rem;
  }
  
  .logo, .spacer {
    width: 45px;
    height: 45px;
  }
  
  .nav-bar button {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
  }
  
  footer {
    padding: 1rem;
  }
  
  .admin-form {
    grid-template-columns: 1fr;
  }
  
  .admin-form .full-width {
    grid-column: span 1;
  }
  
  #cookie-banner {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .cookie-buttons {
    width: 100%;
    justify-content: flex-start;
  }
  
  #cookie-banner button {
    flex: 1;
    text-align: center;
    white-space: normal;
    min-width: 0;
  }
  
  .footer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .footer-left-group {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }
  
  .footer-legal-links {
    width: 100%;
    justify-content: flex-start;
  }
  
  .social-row {
    width: 100%;
    justify-content: flex-start;
  }
  
  .legal-modal-header {
    padding: 0.8rem 1rem;
  }
  
  .legal-modal-header h2 {
    font-size: 1.2rem;
  }
  
  .legal-close {
    font-size: 1.8rem;
  }
  
  .legal-modal-body h3 {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .detail-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .share-wrapper {
    width: 100%;
    justify-content: flex-start;
  }
  
  .back-button {
    width: 100%;
    justify-content: flex-start;
    padding-left: 0;
    margin-left: 0;
  }
  
  .footer-legal-links {
    flex-wrap: wrap;
    gap: 0.3rem;
  }
  
  .footer-legal-links a {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
  }
  
  .footer-legal-links .separator {
    display: none;
  }
  
  .cookie-buttons {
    flex-direction: column;
    gap: 8px;
  }
  
  #cookie-banner button {
    width: 100%;
  }
}