/* ========================================= */
/* ============= GLOBAL STYLES ============= */
/* ========================================= */

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  font-family: Arial, sans-serif;
  /* Retaining the body color from the original main block */
  color: #0e1317;
}

body {
  /* Using the light gray background from the second, overriding definition for the main body content background */
  background-color: #f8f8f8;
  /* space for fixed header */
  padding-top: 90px;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ========================================== */
/* ================= HEADER ================= */
/* ========================================== */

.header-container {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px; /* Desktop Default */
  background-color: #edebc5;
  color: #0e1317;
  font-family: oswald-medium, oswald, sans-serif;
  font-weight: bold;
  border-bottom: 3px solid #0e1317;
}

.logo-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  height: 72px; /* Desktop Default */
}

.home-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  gap: 18px; /* Desktop Default */
}

.site-logo {
  max-height: 72px; /* Desktop Default */
  width: auto;
  display: block;
  object-fit: contain;
}

.site-name {
  font-size: 28px; /* Desktop Default */
  font-weight: bold;
  white-space: nowrap;
}

.header-buttons {
  display: flex;
  margin-left: auto;
  margin-right: 4vw; /* Desktop Default */
}

.header-btn {
  display: inline-block;
  padding: 14px 26px; /* Desktop Default Padding */
  margin: 0;
  border: none;
  background-color: #cc2424;
  color: #edebc5;
  font-size: 19px; /* Desktop Default Font Size */
  font-weight: bold;
  font-family: Helvetica, Arial, sans-serif;
  transition: 0.2s;
}

.header-btn:hover {
  background-color: #a91f1f;
  text-decoration: underline;
}

/* ========================================== */
/* ============ HEADER DROPDOWN ============= */
/* ========================================== */

.header-dropdown {
  display: inline-block;
  position: relative;
  padding: 0;
  margin: 0;
}

.header-dropdown:hover .dropdown-content {
  display: block;
}

.header-dropdown .header-btn {
  display: inline-block;
  padding: 14px 26px; /* Desktop Default Padding */
  height: 100%;
  box-sizing: border-box;
  font-size: 19px; /* Desktop Default Font Size */
  font-weight: bold;
  font-family: Helvetica, Arial, sans-serif;
  background-color: #cc2424;
  color: #edebc5;
  border: none;
  transition: 0.2s;
  text-align: center;
  white-space: nowrap;
}

.header-dropdown .header-btn:hover {
  background-color: #a91f1f;
  text-decoration: underline;
}

.dropdown-content {
  display: none;
  position: absolute; /* Desktop Position */
  top: 100%;
  left: 0;
  background-color: #cc2424;
  min-width: 160px;
  border-radius: 6px;
  overflow: hidden;
  z-index: 1000;
}

.header-dropdown .dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #cc2424;
  min-width: 160px;
  border-radius: 6px;
  overflow: hidden;
  z-index: 1000;
}

.header-dropdown .dropdown-content a {
  display: block;
  padding: 12px 20px;
  color: #edebc5;
  font-weight: bold;
  font-family: Helvetica, Arial, sans-serif;
  text-decoration: none;
  transition: 0.2s;
}

.header-dropdown .dropdown-content a:hover {
  background-color: #a91f1f;
}

/* ----------------
   CART BADGE STYLES
   ---------------- */

.cart-link {
  position: relative;
  display: inline-block;
  height: 24px;
  width: 24px;
}

.cart-badge {
  background-color: #dc3545;
  color: #edebc5;
  border-radius: 999px;
  border: 1px solid #0e1317;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  min-width: 15px;
  text-align: center;
  white-space: nowrap;
  position: absolute;
  top: -5px;
  right: -5px;
  z-index: 10;
}

.cart-badge[data-count='0'],
.cart-badge:empty {
  display: none;
}

/* ========================================== */
/* ================== HERO ================== */
/* ========================================== */

.hero {
  text-align: center;
  padding: 80px 20px;
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero > div {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 20px;
}

.hero p {
  font-size: 20px;
  margin-bottom: 40px;
}

.hero button {
  padding: 12px 28px;
  border: none;
  border-radius: 6px;
  background-color: #cc2424;
  color: #edebc5;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  text-shadow: none;
}

.hero button:hover {
  background-color: #0e1317;
  color: #edebc5;
  transform: scale(1.05);
}

/* ========================================== */
/* ================ SECTIONS ================ */
/* ========================================== */

.section {
  text-align: center;
  padding: 60px 20px;
  background-color: #edebc5;
  padding-bottom: 80px;
  margin-bottom: -90px;
}

.featured {
  background-color: #edebc5;
  color: #0e1317;
  padding-bottom: 80px;
  margin-bottom: -40px;
}

.section h2 {
  font-size: 36px;
  margin-bottom: 20px;
  color: #cc2424;
}

.section p {
  max-width: 800px;
  margin: 0 auto 20px;
  font-size: 18px;
  line-height: 1.6;
}

/* ========================================== */
/* ========= NEW SHOP LAYOUT (2025) ========= */
/* ========================================== */

.shop-page-wrapper {
  background-color: #edebc5;
  min-height: 100vh;
  padding-top: 20px;
  margin-bottom: 0;
  padding-bottom: 80px;
}

.shop-page-header {
  background-color: #0e1317;
  color: #edebc5;
  text-align: center;
  padding: 35px 20px;
  margin: 0 0 40px 0;
  margin-bottom: 0 !important;
}

#categoryTitle {
  margin: 0;
  font-size: 48px;
  font-weight: bold;
  letter-spacing: 3px;
  font-family: 'Oswald', Arial, sans-serif;
}

.shop-wrapper {
  display: flex;
  gap: 40px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 70vh;
  background-color: #edebc5;
  margin-top: 0 !important;
  padding-top: 0 !important;
  align-items: start;
}

/* ========================================== */
/* ================= FILTERS ================ */
/* ========================================== */

/* --- MOBILE FILTER TOGGLE BUTTON (NEW STYLE) --- */
.mobile-filter-toggle {
  display: none; /* Hidden on desktop */
  padding: 10px 15px;
  background-color: #cc2424;
  color: #edebc5;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s;
  align-items: center;
  gap: 8px;
}

.mobile-filter-toggle:hover {
  background-color: #a91f1f;
}

.filters {
  display: none !important;
}

.filters label {
  font-weight: bold;
  margin-right: 5px;
}

.filters select {
  padding: 12px 26px;
  margin: 0 10px;
  border: none;
  border-radius: 6px;
  background-color: #cc2424;
  color: #edebc5;
  font-size: 16px;
  font-weight: bold;
  font-family: Helvetica, Arial, sans-serif;
  cursor: pointer;
  transition: 0.2s;
  width: 180px;
}

.filters select:hover {
  background-color: #a91f1f;
}

.sidebar-filters {
  background-color: #0e1317;
  color: #edebc5;
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  height: fit-content;
  border-radius: 0;
  padding: 25px;
  margin-top: 40px;
  align-self: flex-start;

  /* Ensure desktop styles make it visible and static */
  display: block !important;
  position: sticky;
}

.sidebar-inner h3 {
  margin: 0 0 25px 0;
  color: #edebc5;
  font-size: 26px;
  text-align: center;
}

.sidebar-filters label {
  display: block;
  margin: 20px 0 8px 0;
  font-weight: bold;
  font-size: 15px;
}

.sidebar-search,
.sidebar-filters select {
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 6px;
  background-color: #cc2424;
  color: #edebc5;
  font-size: 16px;
  font-weight: bold;
  font-family: Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}

.sidebar-search::placeholder {
  color: #edebc5aa;
}

.sidebar-search:hover,
.sidebar-filters select:hover,
.sidebar-search:focus,
.sidebar-filters select:focus {
  background-color: #a91f1f;
  outline: 3px solid rgba(204, 36, 36, 0.4);
}

.shop-container {
  background-color: #edebc5 !important;
  width: 95%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 40px 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.shop-container + #footer,
.shop-page-wrapper + #footer {
  margin-top: -50px;
}

/* ========================================== */
/* =============== ITEM CARDS =============== */
/* ========================================== */

.item-card {
  background: #fff;
  border-radius: 0 !important;
  transform: scale(0.8);
  transform-origin: top center;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s;
}

.item-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.item-img-container {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
}

.item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.item-body {
  padding: 16px;
}

.item-name {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 8px;
  min-height: 48px;
}

.item-price {
  font-size: 18px;
  color: #cc2424;
  font-weight: bold;
  margin-bottom: 16px;
}

.item-button {
  background: #cc2424;
  color: #edebc5;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  width: 100%;
  transition: 0.2s;
}

.item-button:hover {
  background: #a91f1f;
}

/* ========================================== */
/* ================ CART PAGE =============== */
/* ========================================== */

/* --- Cart Page Layout --- */
.cart-main-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.cart-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 30px;
  border-bottom: 2px solid #ddd;
  padding-bottom: 10px;
}

.cart-content-wrapper {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

/* --- Cart Items Section (Left Column) --- */
.cart-items-section {
  flex: 3;
  min-width: 300px;
}

.cart-header {
  font-weight: bold;
  border-bottom: 2px solid #ccc;
  padding: 10px 0;
  text-transform: uppercase;
  color: #555;
  background: transparent;
  box-shadow: none;
}

/* Cart Item Rows (using CSS Grid/Flex for alignment) */
.cart-item {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  align-items: center;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
  background: #fff;
}

.cart-item:last-of-type {
  border-bottom: none;
}

.item-details {
  display: flex;
  align-items: center;
  gap: 15px;
}

.item-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.item-name {
  font-weight: 600;
  margin-bottom: 5px;
}

.cart-item > div:not(.item-details) {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
}

.item-version::before {
  content: 'Version: ';
  font-weight: 600;
  color: #555;
}

.item-price::before {
  content: 'Price: ';
  font-weight: 600;
  color: #555;
}

.item-quantity::before {
  content: 'Quantity: ';
  font-weight: 600;
  color: #555;
}

.item-line-total {
  font-weight: 700;
  font-size: 1.1rem;
  border-top: 1px solid #ddd;
  padding-top: 10px;
  margin-top: 15px;
}

.item-line-total::before {
  content: 'Line Total: ';
  font-weight: 600;
  color: #555;
}

.remove-btn {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
  text-decoration: underline;
  transition: color 0.2s;
}

.remove-btn:hover {
  color: #a71d2a;
}

.empty-cart-message {
  font-size: 1.2rem;
  color: #666;
  padding: 50px;
  text-align: center;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* --- Cart Summary Section (Right Column) --- */
.cart-summary-section {
  flex: 1;
  min-width: 280px;
}

.summary-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 20px;
}

.summary-card h2 {
  font-size: 1.5rem;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 1rem;
  color: #333;
}

.total-line {
  font-size: 1.2rem;
  font-weight: 700;
  border-top: 1px dashed #ccc;
  padding-top: 10px;
  margin-top: 15px;
}

.checkout-btn {
  width: 100%;
  padding: 12px;
  margin-top: 20px;
  background-color: #007bff;
  color: #edebc5;
  border: none;
  border-radius: 6px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.3s, opacity 0.3s;
}

.checkout-btn:hover:not(:disabled) {
  background-color: #0056b3;
}

.checkout-btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  opacity: 0.7;
}

/* ========================================== */
/* ============== CONTACT PAGE ============== */
/* ========================================== */

.contact-section {
  text-align: center;
  padding: 60px 20px;
  background-color: #edebc5;
}

.contact-section h1 {
  font-size: 36px;
  color: #cc2424;
  margin-bottom: 20px;
}

.contact-section p {
  font-size: 18px;
  margin-bottom: 20px;
}

.contact-social-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.contact-social-icons img {
  width: 40px;
  height: 40px;
  transition: transform 0.2s ease;
  cursor: pointer;
  color: #0e1317;
  filter: none;
}

.contact-social-icons img:hover {
  transform: scale(1.15);
}

/* ========================================== */
/* ================= FOOTER ================= */
/* ========================================== */

.footer {
  background-color: #0e1317;
  color: #edebc5;
  padding: 70px 20px 30px;
}

.footer-top {
  max-width: 1200px;
  margin: 0 auto 40px auto;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.footer-main-row {
  max-width: 1300px;
  margin: 0 auto 50px;
  display: grid;
  grid-template-columns: 2fr 1.5fr 2fr;
  gap: 40px;
  align-items: start;
}

.footer-sitemap h4,
.footer-social h4 {
  color: #cc2424;
  margin-bottom: 18px;
  font-size: 21px;
}

.footer-sitemap h4,
.footer-social h4 {
  color: #cc2424;
  margin-bottom: 16px;
  font-size: 20px;
  letter-spacing: 1px;
}

.footer-sitemap ul,
.footer-social ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-sitemap ul {
  list-style: none;
  padding: 0;
  line-height: 2.1;
}

.footer-sitemap a {
  color: #edebc5;
  text-decoration: none;
  font-size: 16px;
}

.footer-sitemap a:hover {
  color: #cc2424;
}

.footer-sitemap a {
  color: #edebc5;
  text-decoration: none;
  font-size: 16px;
  line-height: 2;
  transition: color 0.3s;
}

.footer-social h4 {
  margin-bottom: 12px;
  text-align: center;
}

.social-wrapper {
  display: flex;
  justify-content: center;
}

.social-icons {
  display: flex;
  gap: 24px;
}

.social-icons {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
}

.social-icons {
  margin-bottom: 20px;
}

.social-link svg {
  transition: 0.2s ease;
}

.social-link:hover svg {
  stroke: #cc2424;
  transform: scale(1.15);
}

.footer-trust {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 20px;
}

.footer-trust {
  max-width: 1200px;
  margin: 40px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 0 20px;
  opacity: 0.9;
}

.trust-badges {
  text-align: right;
  line-height: 1.7;
  font-size: 15px;
  opacity: 0.95;
}

.trust-badges {
  margin-top: 20px;
  line-height: 1.8;
  font-size: 15px;
  opacity: 0.95;
}

.trust-badges span {
  margin: 0 15px;
  font-size: 15px;
}

.payment-icons img {
  height: 36px;
  margin: 0 6px;
}

.payment-icons img {
  height: 34px;
  margin: 0 8px;
}

.footer-links {
  text-align: center;
  margin: 30px 0;
  font-size: 15px;
}

.footer-links {
  text-align: center;
  margin: 25px 0;
  font-size: 14.5px;
}

.footer-links a {
  color: #edebc5;
  text-decoration: none;
}

.footer-links a:hover {
  color: #cc2424;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(237, 235, 197, 0.15);
  font-size: 14px;
  opacity: 0.8;
}

.footer-bottom p {
  text-align: center;
  margin: 0;
  font-size: 14px;
  opacity: 0.7;
}

.copyright {
  font-size: 14px;
  opacity: 0.8;
  margin: 0;
}

/* ========================================== */
/* ================ BUTTONS ================= */
/* ========================================== */

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background-color: #0e1317;
  color: #edebc5;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

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

/* ========================================== */
/* =============== ITEM MODAL =============== */
/* ========================================== */

.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #edebc5;
  margin: 5% auto;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 900px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  position: relative;
}

.close-btn {
  color: #0e1317;
  float: right;
  font-size: 36px;
  font-weight: bold;
  position: absolute;
  top: 10px;
  right: 20px;
}

.close-btn:hover,
.close-btn:focus {
  color: #cc2424;
  text-decoration: none;
  cursor: pointer;
}

/* Modal Layout */
.modal-body {
  display: flex;
  gap: 20px;
  padding-top: 20px;
}

.modal-image-col {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.modal-image-wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
}

.modal-image-wrapper #modalImage {
  max-width: 100%;
  height: auto;
  display: block;
  user-select: none;
  touch-action: pan-y;
}

.modal-image-col img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 8px;
}

.modal-details-col {
  flex: 1;
  padding-top: 10px;
}

.modal-details-col h2 {
  font-size: 28px;
  margin-top: 0;
  margin-bottom: 10px;
  color: #0e1317;
}

.modal-details-col p {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Variations */
.variations-container {
  margin-bottom: 20px;
}

.variation-group {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.variation-group label {
  font-weight: bold;
  color: #cc2424;
}

.variation-select {
  padding: 8px 15px;
  border: 2px solid #cc2424;
  border-radius: 4px;
  background-color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.modal-add-to-cart {
  margin-top: 20px;
}

/* Navigation buttons */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(14, 19, 23, 0.7);
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 10;
  transition: background 0.2s;
  border-radius: 50%;
  line-height: 0;
}

.nav-btn:hover {
  background: rgba(204, 36, 36, 0.9);
}

.nav-btn svg {
  width: 20px;
  height: 20px;
  fill: #edebc5;
  display: block;
}

.prev-btn {
  left: 8px;
}

.next-btn {
  right: 8px;
}

/* Navigation Button Styles - Positioned relative to .modal-image-wrapper */
.modal-image-wrapper .nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #edebc5;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
}

.modal-image-wrapper .nav-btn svg {
  width: 24px;
  height: 24px;
}

.modal-image-wrapper .prev-btn {
  left: 5px;
}

.modal-image-wrapper .next-btn {
  right: 5px;
}

.modal-image-wrapper .nav-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* ========================================== */
/* ============== RESPONSIVE ================ */
/* ========================================== */

/* --- Mobile View Default (Applies to screens up to 767px) --- */
@media (max-width: 767px) {
  /* 1. SHRINK HEADER CONTAINER PADDING */
  .header-container {
    flex-wrap: wrap;
    justify-content: center;
    height: auto;
    padding: 8px 5px; /* Tighter vertical padding */
  }

  /* 2. FURTHER SHRINK SITE NAME AND LOGO */
  .site-name {
    font-size: 16.8px;
  }
  .site-logo {
    max-height: 43.2px;
  }
  .home-link {
    gap: 10px;
  }

  /* Center the logo container above the buttons */
  .logo-container {
    width: 100%;
    justify-content: center;
    gap: 10px;
    height: auto;
    margin-bottom: 5px;
  }

  /* 3. HORIZONTAL BUTTONS (Tighter Fit) */
  .header-buttons {
    width: 100%;
    margin: 0;
    margin-right: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 5px; /* Tighter spacing between buttons */
    flex-wrap: wrap;
  }

  /* Tighter button sizing */
  .header-btn,
  .header-dropdown .header-btn {
    width: auto;
    padding: 6px 10px; /* TIGHTER BUTTON PADDING FOR MOBILE */
    font-size: 14px; /* SMALLER BUTTON FONT SIZE FOR MOBILE */
    max-width: none;
  }

  /* Dropdown Content Fix for Mobile */
  .dropdown-content {
    position: static;
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 6px;
    box-shadow: none;
    left: auto;
  }

  /* --- SHOP PAGE RESPONSIVE MODIFICATIONS --- */

  /* 4. Adjust Header for Toggle Button */
  .shop-page-header {
    display: flex;
    justify-content: space-between; /* Space title and button */
    align-items: center;
    padding: 20px 15px; /* Tighter padding */
    margin-bottom: 20px !important; /* Add some space below header */
  }

  #categoryTitle {
    font-size: 28px; /* Smaller font size for mobile title */
    text-align: left;
  }

  /* Show the mobile toggle button */
  .mobile-filter-toggle {
    display: flex;
    flex-shrink: 0;
  }

  .shop-wrapper {
    display: block; /* Stack elements vertically */
    padding: 0 15px;
    position: relative; /* Context for absolute filters */
  }

  /* 5. Filter Drawer Behavior */
  .sidebar-filters {
    /* Filter Drawer Positioning */
    width: calc(100% - 30px); /* Full width minus wrapper padding */
    position: absolute;
    top: 0;
    left: 15px;
    z-index: 10;
    padding: 20px;
    margin-top: 0; /* Remove desktop margin */
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);

    /* Initial State: Hidden */
    display: none !important;
  }

  /* Class added by JavaScript to open the drawer */
  .sidebar-filters.open {
    display: block !important;
  }

  /* 6. Adjust Shop Container */
  .shop-container {
    /* Tighter grid for mobile view (2 columns) */
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    width: 100%;
    padding: 0;
    margin-top: 15px;
  }

  /* Cart Page Layout Adjustments */
  .cart-content-wrapper {
    flex-direction: column;
  }

  .cart-summary-section {
    min-width: auto;
  }

  .summary-card {
    position: static;
    top: auto;
  }

  .cart-item {
    grid-template-columns: 1fr;
    padding: 10px 0;
    gap: 5px;
  }

  .cart-header {
    display: none;
  }

  .cart-item > div {
    justify-content: flex-start;
    border-bottom: 1px dotted #eee;
    padding: 5px 0;
  }

  .item-version::before,
  .item-price::before,
  .item-quantity::before {
    content: '';
  }

  /* Modal Adjustments */
  .modal-body {
    flex-direction: column;
  }

  .modal-image-col {
    padding: 0;
  }
}

/* --- Tablet / Desktop Override (Applies to screens MINIMUM 768px wide and up) --- */
@media (min-width: 768px) {
  /* Revert Logo size to default */
  .site-name {
    font-size: 28px;
  }
  .site-logo {
    max-height: 72px;
  }
  .home-link {
    gap: 18px;
  }

  /* Revert Header Container to desktop defaults */
  .header-container {
    flex-wrap: nowrap;
    justify-content: space-between;
    height: 70px;
    padding: 12px 24px;
  }

  /* Revert Button Container to desktop horizontal row with default spacing */
  .header-buttons {
    width: auto;
    margin-left: auto;
    margin-right: 4vw;
    flex-direction: row;
    gap: 0; /* Default button elements use margin/padding, not gap */
  }

  /* RESTORE BUTTONS TO DESKTOP DEFAULT SIZING */
  .header-btn {
    padding: 14px 26px;
    font-size: 19px;
  }

  .header-dropdown .header-btn {
    padding: 14px 26px;
    font-size: 19px;
  }

  /* Revert dropdown position for desktop hover usage */
  .dropdown-content {
    position: absolute;
    min-width: 160px;
    left: 0;
    top: 100%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  }

  /* Revert Cart Item layout to grid */
  .cart-item {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 15px;
    padding: 15px 0;
  }

  .cart-header {
    display: grid;
  }

  /* Re-add pseudo-element content for desktop grid clarity */
  .item-version::before {
    content: 'Version: ';
  }
  .item-price::before {
    content: 'Price: ';
  }
  .item-quantity::before {
    content: 'Quantity: ';
  }

  .summary-card {
    position: sticky;
    top: 20px;
  }
}
