/* * 1. Global Reset & Base Styles
 * -------------------------------------------
 */

/* Fixes browser defaults for padding/margin */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

/* CSS Variables from page-layout-structure.md */
:root {
  --color-primary: #004080;
  --color-secondary: #f5f5f5;
  --color-accent: #d9534f;
  --color-text: #333;
  --color-text-light: #f5f5f5;
  --color-bg-dark: #2a2a2a;
  --font-primary: Arial, sans-serif;
  --sub-header-height: 30px;
  --header-height: 60px;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  color: var(--color-text);
  background-color: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: calc(var(--header-height) + var(--sub-header-height)); /* Offset for fixed header */
}

main.page-content {
  flex-grow: 1; /* Pushes footer to bottom */
  width: 100%;
}

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

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  font-weight: 600;
}

h2 {
  text-align: center;
  font-size: 2.2em;
  margin-bottom: 40px;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--color-accent);
}

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

/* Reusable Button */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  border: 0;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.btn:hover {
  background-color: #002e5c; /* Darker primary */
  color: #fff;
}
.btn.btn-secondary {
  background-color: #6c757d;
}
.btn.btn-secondary:hover {
  background-color: #5a6268;
}


/* * 2. Layout: Header
 * -------------------------------------------
 */
.header-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: box-shadow 0.3s ease;
}

.sub-header {
  height: var(--sub-header-height);
  background-color: #2a2a2a; /* Lighter black / Dark grey */
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid #444;
}

.sub-header-content {
  display: flex;
  justify-content: flex-end; /* Align items to the right */
  align-items: center;
  width: 100%;
  max-width: 1200px; /* Aligns with .container */
  padding: 0 20px;
  gap: 25px;
}

.sub-header-content a {
  font-weight: bold;
  font-size: 0.85em;
  color: #fff;
  text-transform: uppercase;
}

.sub-header-content a:hover {
  color: #ccc;
}

.global-header {
  width: 100%;
  height: var(--header-height);
  background: #000;
  display: flex;
  justify-content: center;
}

/* Sticky state (from main.js) */
.global-header.sticky {
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px; /* Aligns with .container */
  padding: 0 20px;
  height: 100%;
}

.global-header .logo img {
  height: 50px; /* Logo size fix */
  width: auto;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center; /* This will vertically center all nav items */
}

.main-nav li {
  margin-left: 20px;
}

.main-nav a {
  padding: 5px 0;
  font-weight: bold;
  position: relative;
  color: #fff;
}

/* Nav hover/active state */
.main-nav a:hover {
  color: #ccc;
}

.main-nav a.active {
  color: #fff;
  border-bottom: 2px solid var(--color-accent);
}

/* Hamburger (hidden by default) */
.hamburger-menu {
  display: none;
  font-size: 24px;
  cursor: pointer;
  background: none;
  border: none;
  color: #fff;
}

/* New styles for icon button in nav */
.nav-icon-btn {
    position: relative;
    display: inline-block;
    vertical-align: middle; /* Aligns icon with text links */
}

.nav-icon-btn img {
    height: 28px; /* Matches approximate height of SEARCH button */
    width: auto;
    transition: opacity 0.3s ease;
}

.nav-icon-btn:hover img {
    opacity: 0.7;
}

/* Reposition cart count for the icon */
.nav-icon-btn .cart-item-count {
    right: -10px;
    top: -5px;
}

/* New styles for buttons in main nav */
.main-nav-btn {
  padding: 5px 10px; /* Smaller padding for nav buttons */
  font-size: 0.9em;
  border-radius: 20px; /* Rounded rectangle */
  position: relative; /* For cart item count positioning */
}
/* Make the SEARCH button white with red text */
#advancedSearchBtn {
    background-color: #fff;
    color: #f44336;
    border: 1px solid #f44336;
}
#advancedSearchBtn:hover {
    background-color: #f0f0f0; /* Light grey on hover */
    color: #f44336;
    border-color: #f44336;
}

.nav-button-item {
  margin-left: 20px; /* Spacing between nav items */
}

/* Cart item count within the new button */
.main-nav-btn .cart-item-count {
    position: absolute;
    top: -8px;
    right: -8px; /* Adjust position relative to the new button size */
    background-color: var(--color-accent);
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    font-weight: bold;
}

.item-added-feedback {
    animation: shake 0.6s;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
    40%, 60% { transform: translate3d(3px, 0, 0); }
}


/* * 3. Layout: Footer (Option 1: Minimalist Bar)
 * -------------------------------------------
 */
.global-footer {
  background: #000;
  color: var(--color-text-light);
  padding: 40px 20px 20px 20px;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.global-footer .footer-main {
  display: grid;
  grid-template-columns: 1fr; /* Default to 1 column on mobile */
  gap: 30px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.global-footer strong {
  color: #fff;
  font-size: 1.1em;
  margin-bottom: 15px;
  display: block;
}

.global-footer p {
  margin: 5px 0;
  font-size: 0.9em;
  color: #ccc;
}

.global-footer .footer-contact a {
  color: var(--color-accent); /* Wine color for mailto link */
  transition: color 0.3s ease;
}

.global-footer .footer-logo-social {
  text-align: center;
}

.global-footer .footer-logo img {
  height: 50px;
  width: auto;
  margin-bottom: 20px;
}

.global-footer .footer-bottom {
  display: flex;
  justify-content: center; /* Center copyright */
  align-items: center;
  border-top: 1px solid #444;
  padding-top: 20px;
  margin-top: 20px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.global-footer .footer-social a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  margin-right: 15px;
  font-size: 0.9em;
}

.global-footer .footer-social a:hover {
  color: var(--color-accent);
}

.global-footer .footer-social .social-icon {
  height: 30px;
  width: auto;
  transition: opacity 0.3s ease;
}

.global-footer .footer-social a:hover .social-icon {
  opacity: 0.8;
}

.global-footer .footer-copyright p {
  margin: 0;
  font-size: 0.8em;
  color: #aaa;
}


/* * 4. Page-Specific Styles
 * -------------------------------------------
 */

.hero-carousel {
  position: relative;
  width: 100%;
  height: 450px; /* You can adjust this height */
  background: #333; /* Fallback color */
}

.hero-carousel .swiper-slide {
  height: 450px; /* Match container height */
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}

/* Background image for the slide */
.hero-carousel .slide-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* Add a subtle overlay to darken the image */
  filter: brightness(0.6);
}

/* Content box for text */
.hero-carousel .slide-content-box {
  position: relative; /* Sits on top of the image */
  z-index: 10;
  background: rgba(255, 255, 255, 0.75); /* Semi-transparent white box */
  color: var(--color-text);
  padding: 21px;
  max-width: 380px;
  border-radius: 5px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.hero-carousel .slide-content-box h2 {
  font-size: 1.9em;
  color: #000;
  text-align: left;
  margin-bottom: 8px;
}

.hero-carousel .slide-content-box p {
  font-size: 0.85em;
  margin-bottom: 18px;
}

.hero-carousel .slide-content-box .btn {
    background-color: #000;
    padding: 7px 14px;
    font-size: 0.8em;
}

/* * Swiper Controls Styling (Prev/Next Buttons)
 */
.hero-carousel .swiper-button-prev,
.hero-carousel .swiper-button-next {
  color: #fff; /* White arrows */
  background: rgba(0,0,0,0.3);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}
.hero-carousel .swiper-button-prev:hover,
.hero-carousel .swiper-button-next:hover {
  background: rgba(0,0,0,0.5);
}

/* Make arrows smaller */
.hero-carousel .swiper-button-prev::after,
.hero-carousel .swiper-button-next::after {
  font-size: 20px;
  font-weight: bold;
}

/* Pagination dots styling */
.hero-carousel .swiper-pagination-bullet {
  background: #fff;
  opacity: 0.7;
}
.hero-carousel .swiper-pagination-bullet-active {
  background: var(--color-accent); /* Use accent color for active dot */
  opacity: 1;
}

/* Responsive adjustment for the carousel */
@media (max-width: 600px) {
  .hero-carousel,
  .hero-carousel .swiper-slide {
    height: 400px; /* Slightly shorter on mobile */
  }

  .hero-carousel .slide-content-box {
    margin: 0 15px; /* Add some horizontal margin */
    padding: 20px;
  }
  
  .hero-carousel .slide-content-box h2 {
    font-size: 2em;
  }
  
  .hero-carousel .swiper-button-prev,
  .hero-carousel .swiper-button-next {
    display: none; /* Hide arrows on small mobile */
  }
}

.materials-section {
  padding: 40px 0;
}

.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.material-card {
  border: 1px solid #ddd;
  text-align: center;
  transition: box-shadow 0.3s ease;
}
.material-card:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.material-card a {
  color: var(--color-text);
  display: block;
  padding: 10px;
}
.material-card img {
  height: 150px;
  object-fit: cover;
  margin-bottom: 10px;
}
.material-card.view-all-card {
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.material-card.view-all-card h3 {
  color: #000;
}

.latest-news-section {
  padding: 40px 0;
  background: var(--color-secondary);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 blocks */
  gap: 20px;
}

.news-block a {
  color: var(--color-text);
  display: block;
  border: 1px solid #ddd;
  background: #fff;
}
.news-block img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.news-block .news-content {
  padding: 15px;
}

.see-all-link {
  text-align: center;
  margin-top: 30px;
}

.see-all-link .btn {
    background-color: #000;
}

/* --- Stock Page (stock.php) --- */
.page-banner {
    margin-bottom: 40px;
}

.page-banner-bottom {
    margin-top: 40px;
}

.container h1 {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

.stock-filters {
  background: var(--color-secondary);
  padding: 20px;
  border-radius: 5px;
  margin-bottom: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  align-items: center;
}
.stock-filters label {
  font-weight: bold;
  margin-right: 5px;
}
.stock-filters select, .stock-filters input {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.stock-filters .btn {
  margin-right: 10px;
  padding: 8px;
  grid-column: 1 / -1; /* Make buttons span full width */
}

.stock-filters-modal {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}
.stock-filters-modal .form-group {
    display: flex;
    flex-direction: column;
}
.stock-filters-modal label {
    font-weight: bold;
    margin-bottom: 5px;
}
.stock-filters-modal .form-group-full {
    grid-column: 1 / -1; /* Span full width */
    display: flex;
    gap: 10px;
}

.stock-filters-modal .btn {
    background-color: #000;
    border-color: #000;
}

.stock-filters-modal .btn.btn-secondary {
    background-color: #f44336;
    border-color: #f44336;
}

#stockFilterForm {
    display: none; /* Hidden by default */
}

.product-grid {
  display: grid;
  /* 3-4 columns */
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.product-card {
  border: 1px solid #eee;
  border-radius: 5px;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  position: relative; /* This is crucial for badge positioning */
  display: flex; /* Use flexbox for card layout */
  flex-direction: column; /* Stack card content vertically */
}
.product-card:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.badge-container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 5px; /* Space between stacked badges */
    align-items: flex-start;
}
.badge {
    padding: 3px 8px;
    font-size: 0.8em;
    font-weight: bold;
    border-radius: 4px;
    color: #fff; /* Default text color for badges */
}
.on-sale-badge {
    background-color: #28a745; /* Green */
}
.on-hold-badge {
    background-color: #ffc107; /* Yellow */
    color: #000; /* Black text for better contrast on yellow */
}
.sold-badge {
    background-color: #d9534f; /* Red */
}
.new-arrival-badge {
    background-color: #800080; /* Purple */
}
.product-card a {
  color: var(--color-text);
}
.product-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.product-card h3,
.product-card p {
  padding: 0 15px;
  margin: 5px 0;
  text-align: center;
}
.product-card p {
  margin: 5px 0; /* Tighter spacing for product details */
  color: #555;
  font-size: 0.9em;
}
.product-card p strong {
  color: var(--color-text);
  font-weight: 600;
}

.product-price-box {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #eee;
  text-align: center;
  padding-bottom: 15px; /* Add space at the bottom of the card */
}

.admin-actions {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.product-price-box .btn-edit {
    background-color: #ffc107; /* Yellow */
    color: #000;
}
.product-price-box .btn-delete {
    background-color: #f44336; /* Red */
}

.text-center {
    text-align: center;
}

.btn-load-more {
    background-color: #f44336;
    font-size: 2.2em;
    line-height: 1;
    padding: 5px 16px;
}

.btn-load-more:hover {
    background-color: #000;
}

.add-to-cart-btn.on-hold {
    background-color: #ffc107; /* Yellow */
    color: #000;
}
.product-price-box .price-value,
.product-price-box .view-price-login {
  display: inline-block;
  padding: 5px 12px;
  background-color: #000;
  color: #fff;
  border-radius: 15px; /* Rounded rectangle */
  font-weight: bold;
  font-size: 0.9em;
}

.product-price-box .view-price-login:hover {
  background-color: #333; /* Darker black on hover */
  color: #fff;
}

.product-price-box .add-to-cart-btn {
  padding: 5px 12px; /* Match size */
  font-size: 0.9em; /* Match size */
  border-radius: 15px; /* Match shape */
  background-color: #000;
  border-color: #000;
}

.product-price-box > div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.page-title-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.btn-icon {
    font-size: 1.5em;
    padding: 0 12px;
    line-height: 1.5;
}

.page-title-container #addProductBtn {
    background-color: #f44336;
    border-color: #f44336;
}

.stock-country-filters {
    text-align: center;
    margin-bottom: 15px;
}

.stock-country-filters .btn {
    margin: 0 5px;
    background-color: #f0f0f0;
    color: #333;
    width: 120px; /* Wide buttons */
}

.stock-country-filters .btn.active {
    background-color: #f44336;
    color: #fff;
}
.stock-country-filters .btn.btn-on-sale.active {
    background-color: #ffc107; /* Yellow */
    color: #000;
}

.stock-quick-filters {
    text-align: center;
    margin-bottom: 30px;
}

.stock-quick-filters .btn {
    margin: 0 5px;
    background-color: #f0f0f0;
    color: #333;
    padding: 5px 10px; /* Reduced from 10px 20px */
    font-size: 0.9em; /* Slightly smaller font */
}

.stock-quick-filters .btn.active {
    background-color: #f44336;
    color: #fff;
}
/* --- FAQ Page (faq.php) --- */
.faq-question {
  background: var(--color-secondary);
  padding: 15px;
  border: 1px solid #ddd;
  cursor: pointer;
  font-weight: bold;
  margin-top: 10px;
  position: relative;
}
.faq-question.active {
  background-color: #e0e0e0;
}
.faq-question::after {
  content: '+';
  position: absolute;
  right: 15px;
  font-size: 1.2em;
}
.faq-question.active::after {
  content: '−';
}
.faq-answer {
  padding: 15px;
  border: 1px solid #ddd;
  border-top: none;
  display: none; /* Toggled by main.js */
}

/* --- Contact Page (contact.php) --- */
#formResult.success {
  display: block;
  background: #dff0d8;
  color: #3c763d;
  border: 1px solid #d6e9c6;
  padding: 10px;
  margin-top: 15px;
}
#formResult.failure {
  display: block;
  background: #f2dede;
  color: var(--color-accent);
  border: 1px solid #ebccd1;
  padding: 10px;
  margin-top: 15px;
}

/* --- Registration Page Modernization --- */
.form-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.form-container h1 {
    text-align: center;
}
.form-container p {
    text-align: center;
    color: #666;
}

/* --- Registration Page (register.php) --- */
.registration-form {
  display: grid;
  grid-template-columns: 1fr; /* Default to 1 column on mobile */
  gap: 20px;
  margin-top: 30px;
}
.registration-form fieldset {
    border: 1px solid #e0e0e0;
    padding: 20px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 0;
}
.registration-form legend {
    font-weight: bold;
    font-size: 1.2em;
    padding: 0 10px;
}
.registration-form fieldset:first-of-type {
    /* This prevents the first fieldset from stretching if it has fewer items */
    align-content: start;
}

.registration-form .form-group {
  display: flex;
  flex-direction: column;
}

.registration-form label {
  font-weight: bold;
  margin-bottom: 5px;
}

.registration-form input,
.registration-form select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
}

.registration-form .form-group-full {
  grid-column: 1 / -1; /* Span full width */
  text-align: center;
}

.registration-form .error-text {
  color: var(--color-accent);
  font-size: 0.85em;
  margin-top: 5px;
}

.registration-form .btn {
    background-color: #000;
    border-color: #000;
    width: 50%;
}

.phone-input-group {
  display: flex;
  align-items: center;
  gap: 5px;
}
.phone-input-group select {
  flex: 0 0 180px; /* Give the country code a fixed width */
}
.phone-input-group input {
  flex: 1 1 auto; /* Allow the phone number input to grow */
}

.form-group-combined {
    display: flex;
    align-items: flex-end;
    gap: 20px;
}

.form-group-combined .form-group {
    flex-grow: 1;
}

.form-group-checkbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 10px; /* Align with input box */
}


/* --- Login Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #888;
}

.modal-content h2 {
  text-align: left;
  margin-bottom: 10px;
  font-size: 1.8em;
}

.modal-content p {
  margin-bottom: 20px;
}

#modalLoginForm .form-group {
  margin-bottom: 15px;
}

#modalLoginForm label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
}

#modalLoginForm input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#modalLoginForm .btn {
  width: 100%;
  background-color: #000000;
  border-color: #000000;
}

.modal-register-link {
  font-size: 0.9em;
  text-align: center;
  margin-top: 15px;
}

/* --- Product Detail Modal --- */
.product-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 20px;
  overflow-y: auto;
}

.product-modal-content {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: 1100px;
  position: relative;
  box-shadow: 0 5px 25px rgba(0,0,0,0.4);
  padding: 30px 40px;
  max-height: 95vh;
  overflow-y: auto;
}

.product-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  color: #888;
  font-weight: 300;
}
.product-modal-close:hover {
  color: #000;
}

.product-modal-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.product-modal-actions {
  margin-bottom: 25px;
  display: flex;
  gap: 20px;
  align-items: center;
  position: relative; /* For tooltip positioning */
}

.product-modal-actions a {
  font-size: 0.85em;
  color: #555;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.product-modal-actions a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.product-modal-actions a i {
  margin-right: 6px;
}
/* Language Switch in Product Modal */
.language-switch-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto; /* Pushes it to the right */
    font-size: 0.85em;
    font-weight: bold;
    color: #555;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--color-primary);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--color-primary);
}

input:checked + .slider:before {
    transform: translateX(18px);
}

.slider.round {
    border-radius: 22px;
}

.slider.round:before {
    border-radius: 50%;
}

.product-modal-gallery .main-image-container {
  border: 1px solid #eee;
  margin-bottom: 10px;
  background: #f9f9f9;
}
.product-modal-gallery .main-image-container img {
  width: 100%; /* Make the image responsive to its container */
  height: auto; /* Let the height adjust to maintain aspect ratio */
  max-height: 50vh; /* Prevent very tall images from making the modal too long */
  object-fit: contain; /* Ensure the whole image is visible without cropping */
}

.product-modal-gallery .thumbnail-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
}
.product-modal-gallery .thumbnail-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.product-modal-gallery .thumbnail-image:hover {
  border-color: #ccc;
}
.product-modal-gallery .thumbnail-image.active {
  border-color: var(--color-primary);
}

.product-modal-details h2 {
  text-align: left;
  font-size: 2.4em;
  margin-bottom: 10px;
}

.product-modal-details .product-meta-tags {
  margin-bottom: 25px;
  color: #666;
  font-size: 0.9em;
  text-transform: uppercase;
}
.product-modal-details .product-meta-tags .separator {
  margin: 0 8px;
  color: #ccc;
}

.product-modal-details .details-section h3 {
  font-size: 1.2em;
  margin-bottom: 10px;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}
.product-modal-details .details-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.95em;
}
.product-modal-details .details-section li {
  padding: 4px 0;
}

.product-modal-details .price-section {
  margin-top: 30px;
}
.product-modal-details .price-value-large {
  font-size: 1.8em;
  font-weight: bold;
  color: #006400; /* Dark Green */
}
.product-modal-details .price-section {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
}
.product-modal-details .price-section .btn {
    background-color: #000;
}
.product-modal-details .price-section .btn:hover {
    background-color: #333;
}

.product-modal-tabs .tab-headers {
  border-bottom: 1px solid #ddd;
  margin-bottom: 20px;
}
.product-modal-tabs .tab-link {
  background: none;
  border: none;
  padding: 10px 20px;
  font-size: 1.1em;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.product-modal-tabs .tab-link.active {
  border-bottom-color: var(--color-primary);
  font-weight: bold;
  color: var(--color-primary);
}

.product-modal-tabs .tab-content {
  display: none;
}
.product-modal-tabs .tab-content.active {
  display: block;
}

.table-container {
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid #ddd;
}
.product-modal-tabs table {
  width: 100%;
  border-collapse: collapse;
}
.product-modal-tabs th, .product-modal-tabs td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}
.product-modal-tabs thead th {
  background: #f5f5f5;
  position: sticky;
  top: 0;
}
.product-modal-tabs tfoot td {
  background: #f0f0f0;
  font-weight: bold;
}

.product-card {
  cursor: pointer;
}

.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-left-color: var(--color-primary);
  animation: spin 1s ease infinite;
  margin: 50px auto;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Cart Modal --- */
.cart-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 4000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s 0.3s;
}
.cart-modal-overlay.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}

.cart-modal-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 450px;
  height: 100%;
  background: #fff;
  box-shadow: -5px 0 25px rgba(0,0,0,0.2);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}
.cart-modal-overlay.open .cart-modal-content {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}
.cart-header h3 {
  margin: 0;
  font-size: 1.4em;
}
.cart-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #888;
}

.cart-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart-items-list .empty-cart-message {
  text-align: center;
  color: #777;
  margin-top: 40px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
}
.cart-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 1px solid #eee;
}

.cart-item-details {
  flex-grow: 1;
}
.cart-item-details h4 {
  margin: 0 0 5px 0;
  font-size: 1em;
}
.cart-item-details p {
  margin: 0;
  font-size: 0.85em;
  color: #666;
}

.cart-item-price {
  font-weight: bold;
  font-size: 0.9em;
}

.cart-item-remove {
  background: none;
  border: none;
  font-size: 20px;
  color: #aaa;
  cursor: pointer;
}
.cart-item-remove:hover {
  color: var(--color-accent);
}
.cart-item-remove.confirm-remove {
    color: var(--color-accent); /* Make checkmark red */
}

.cart-footer {
  padding: 20px;
  border-top: 1px solid #ddd;
  background: #f9f9f9;
}
.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
}
.cart-total span {
  font-size: 1em;
  color: #555;
}
.cart-total strong {
  font-size: 1.5em;
  color: #28a745; /* Green */
}
.cart-item-count-modal {
  color: #777;
}
.cart-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 15px;
}
.cart-actions .btn {
  width: 100%;
  padding: 12px;
}
.cart-actions #checkoutButton {
    background-color: #28a745; /* Green */
}
.cart-actions #clearCartButton {
    background-color: #d9534f; /* Red */
}
.cart-footer-note {
  font-size: 0.8em;
  text-align: center;
  color: #888;
  margin: 0;
}

/* Notification Modal Sections */
.notification-sections {
    max-height: 60vh;
    overflow-y: auto;
}
.notification-sections h3 {
    font-size: 1.1em;
    color: #333;
    margin: 20px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}
.notification-sections h3:first-of-type {
    margin-top: 0;
}
.empty-list-message {
    color: #888;
    padding: 15px;
    text-align: center;
}

/* Notification Modal Item Styles */
.notification-item {
    display: block;
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: var(--color-text);
    text-decoration: none;
    transition: background-color 0.2s ease;
}
.notification-item.new {
    background-color: #e8f0fe; /* A light blue to highlight new items */
    border-left: 3px solid var(--color-primary);
}
.notification-item:hover {
    background-color: #f9f9f9;
}
.notification-item p {
    margin: 5px 0 0;
    font-size: 0.9em;
    color: #666;
}

/* Order Detail Modal Table Styles */
#orderItemsTable,
#customerOrderItemsTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    border: 1px solid #ccc; /* Outer border for the table */
}

#orderItemsTable th,
#orderItemsTable td,
#customerOrderItemsTable th,
#customerOrderItemsTable td {
    border: 1px solid #ddd; /* Borders for all cells */
    padding: 12px;
    text-align: center;
    vertical-align: middle;
}

#orderItemsTable th,
#customerOrderItemsTable th {
    background-color: #f8f8f8;
}

/* Special styling for the first column to handle image + text */
#orderItemsTable td:first-child,
#customerOrderItemsTable td:first-child {
    display: flex;
    align-items: center; /* Vertically centers the image and text */
    justify-content: flex-start; /* Aligns items to the start of the cell */
    gap: 15px;
    text-align: left; /* Aligns the text to the left, next to the image */
}

#orderItemsTable td:first-child img,
#customerOrderItemsTable td:first-child img {
    flex-shrink: 0; /* Prevents the image from shrinking */
}

.order-item-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

/* Order Status Badge in Order Detail Modal */
.order-status-badge {
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 0.9em;
}
.order-status-badge.status-processing {
    background-color: #ffc107; /* Yellow */
    color: #000;
}
.order-status-badge.status-approved {
    background-color: #28a745; /* Green */
}
.order-status-badge.status-rejected {
    background-color: #d9534f; /* Red */
}

/* My Orders Modal Table Styles */
.order-product-image-grid {
    width: 80px;
    height: 80px;
    display: grid;
    gap: 2px;
    background-color: #eee;
}
.order-product-image-grid.count-1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.order-product-image-grid.count-2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.order-product-image-grid.count-3,
.order-product-image-grid.count-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.order-product-image-grid .grid-item {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}
.order-product-image-grid .grid-item.plus-sign {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #888;
    background-color: #f0f0f0;
}

.order-status-text.status-new {
    color: #f0ad4e; /* Yellow */
    font-weight: bold;
}
.order-status-text.status-approved {
    color: #5cb85c; /* Green */
    font-weight: bold;
}
.order-status-text.status-rejected {
    color: #d9534f; /* Red */
    font-weight: bold;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* * 5. Responsive Design
 *
 * -------------------------------------------
 */

/* --- Tablet (Up to 1024px) --- */
@media (max-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Mobile (Up to 600px) --- */
@media (max-width: 600px) {
  /* Header: Hamburger Menu */
  .main-nav {
    display: none; /* This is correct, it's toggled by JS */
    position: absolute;
    top: var(--header-height); /* Position below header */
    left: 0;
    width: 100%;    
    background: #f0f0f0; /* Changed to grey */
    flex-direction: column;
    border-bottom: 1px solid #ccc;
  }
  .main-nav.nav-open {
    display: flex; /* Show menu */
  }
  .main-nav ul {
    flex-direction: column;
    width: 100%;
  }
  .main-nav li {
    margin: 0;
    text-align: center;
  }
  .main-nav a {
    display: block;
    padding: 15px;
    border-bottom: 1px solid #ddd;
    color: #000; /* Changed to black */
  }
  .main-nav a.active {
    border-bottom: 2px solid var(--color-primary);
  }
  .hamburger-menu {
    display: block;
  }

  /* Footer: Stack Vertically */
  .global-footer .footer-main {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .global-footer .footer-contact,
  .global-footer .footer-logo,
  .global-footer .footer-address {
    margin-bottom: 30px;
  }
  .global-footer .footer-logo {
    order: -1; /* Logo on top */
  }
  .global-footer .footer-bottom {
    flex-direction: column;
  }
  .global-footer .footer-social {
    margin-bottom: 15px;
  }

  /* Page Layouts */
  .materials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .news-grid,
  .product {
    grid-template-columns: 1fr; /* Stack on mobile */
  }
  .stock-filters {
    grid-template-columns: 1fr; /* Stack filters on mobile */
  }

  .global-footer .footer-main {
    text-align: center;
  }

  .product-modal-content {
    padding: 20px;
  }
  .product-modal-main-grid {
    grid-template-columns: 1fr;
  }

}

@media (min-width: 768px) {
  .global-footer .footer-main {
    grid-template-columns: repeat(3, 1fr); /* 3 columns on tablet and up */
    text-align: left;
  }
  .global-footer .footer-addresses {
    text-align: right;
  }
}

/* --- How to Buy Page --- */
.how-to-buy-top-bar {
  background-color: var(--color-secondary);
  padding: 8px 0;
  border-bottom: 1px solid #e0e0e0;
}
.how-to-buy-top-bar span {
  font-size: 0.9em;
  font-weight: bold;
  color: #555;
}

.how-to-buy-container {
  text-align: center;
  padding-top: 60px;
  padding-bottom: 60px;
}

.how-to-buy-container h1 {
  font-size: 2.5em;
  color: #000; /* Black */
  text-transform: uppercase;
  margin-bottom: 20px;
}

.how-to-buy-container .intro-text {
  max-width: 700px;
  margin: 0 auto 60px auto;
  line-height: 1.6;
  color: #555;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 30px;
}

.step-card {
  background-color: #fff;
  padding: 40px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.step-emoji {
  font-size: 3.5em;
  margin-bottom: 20px;
  line-height: 1;
}

.step-label {
  font-weight: bold;
  text-transform: uppercase;
  color: #333;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.step-description {
  font-size: 0.95em;
  color: #666;
  line-height: 1.5;
  margin: 0;
}

/* Responsive for How to Buy Page */
@media (max-width: 992px) {
  .steps-grid {
    grid-template-columns: 1fr; /* Stack vertically */
  }
}

@media (max-width: 768px) {
  .how-to-buy-container h1 {
    font-size: 2em;
  }
}

/* --- Contact Page --- */
.contact-top-bar {
  background-color: #e8e8e8;
  padding: 8px 0;
  border-bottom: 1px solid #ddd;
}
.contact-top-bar span {
  font-size: 0.9em;
  font-weight: bold;
  color: #333;
}

.contact-page-container {
  padding-top: 40px;
  padding-bottom: 60px;
}

.contact-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.contact-column-left {
  display: flex;
  flex-direction: column;
  gap: 1.25rem; /* 20px */
}

.contact-column-right {
  display: flex;
  flex-direction: column;
}

.input-group {
  position: relative;
}

.input-group input,
.input-group textarea {
  width: 100%;
  padding: 15px;
  background-color: #f0f2f4;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1em;
  color: #333;
  transition: border-color 0.2s;
}

.input-group textarea {
  resize: vertical;
  min-height: 150px;
  flex-grow: 1;
}

.input-group label {
  position: absolute;
  top: 15px;
  left: 15px;
  color: #888;
  pointer-events: none;
  transition: all 0.2s ease;
}

/* "Floating label" effect */
.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label,
.input-group textarea:focus + label,
.input-group textarea:not(:placeholder-shown) + label {
  top: 0px;
  left: 10px;
  font-size: 0.75em;
  background-color: #f0f2f4;
  padding: 0 5px;
}

.input-group input:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.contact-column-right .button-group {
  margin-top: 20px;
}

.contact-send-btn {
  background-color: #2b3f53;
  border-color: #2b3f53;
  text-transform: uppercase;
  padding: 15px 30px;
  width: auto;
}
.contact-send-btn:hover {
  background-color: #1c2a38;
}

/* Responsive for Contact Page */
@media (max-width: 768px) {
  .contact-form-grid {
    grid-template-columns: 1fr;
  }
  .contact-column-right .button-group {
    text-align: center;
  }
  .contact-send-btn {
    width: 100%;
  }
}