/* Advanced CSS for Marble & Granite Company */

/* Importing Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;600;700&family=Playfair+Display:wght@400;700&display=swap");

/* CSS Variables for easy theming */
:root {
  --primary-color: #f5f5f5;
  --secondary-color: #333;
  --accent-color: #808080;
  --text-color: #333;
  --background-color: #fff;
  --glow-color: rgba(255, 255, 255, 0.5);
  --transition-speed: 0.3s;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Dark mode variables */
.dark-mode {
  --primary-color: #333;
  --secondary-color: #f5f5f5;
  --accent-color: #a0a0a0;
  --text-color: #f5f5f5;
  --background-color: #1a1a1a;
  --glow-color: rgba(0, 0, 0, 0.5);
  --box-shadow: 0 4px 6px rgba(255, 255, 255, 0.1);
}

/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Raleway", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  transition: background-color var(--transition-speed),
    color var(--transition-speed);
  font-size: 14px;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
  /* Centering content */
}

/* Typography */
h1,
h2,
h3 {
  font-family: "Playfair Display", serif;
  margin-bottom: 15px;
}

h1 {
  font-size: 1.8rem; /* Adjusted size */
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.2rem;
}

p {
  margin-bottom: 15px;
}

/* Header styles */
header {
  background-color: var(--primary-color);
  box-shadow: var(--box-shadow);
  transition: top 0.3s ease;
  width: 100%;
}

header.floating {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px; /* Adjusted height */
}

.logo {
  flex: 1;
}

.logo h1 {
  font-size: 1.2rem; /* Adjusted size */
  color: var(--secondary-color);
  margin: 0;
}

nav {
  flex: 2;
}

nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav ul li {
  margin: 0 10px;
}

nav ul li a {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color var(--transition-speed);
  position: relative;
}

nav ul li a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background-color: var(--accent-color);
  transition: width var(--transition-speed);
}

nav ul li a:hover::after {
  width: 100%;
}

/* Dark mode toggle icon */
#dark-mode-icon {
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--secondary-color);
  transition: color var(--transition-speed);
  margin-left: 20px; /* Adjusted margin */
}

#dark-mode-icon:hover {
  color: var(--accent-color);
}

/* Dark mode toggle and language switcher */
#dark-mode-icon {
  font-size: 1.2rem;
  margin: 0 5px;
  cursor: pointer;
  color: var(--secondary-color);
  transition: color var(--transition-speed);
}

#dark-mode-icon:hover {
  color: var(--accent-color);
}

/* Hamburger menu icon */
.menu-icon {
    display: block;
    font-size: 1.5rem;
    cursor: pointer;
    position: fixed;
    top: 12px; /* Center vertically */
    z-index: 1001; /* Ensure it is above other elements */
  }
  
  .menu-icon.left {
    left: 20px;
  }
  
  .menu-icon.right {
    right: 20px;
  }
  
  /* Sliding menu */
.sliding-menu {
    display: block; /* Ensure it is always displayed */
    position: fixed;
    top: 0;
    width: 250px;
    height: 100%;
    background-color: var(--background-color);
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-speed), visibility 0s linear 0.3s; /* Add visibility transition */
    z-index: 1002; /* Ensure it is above the menu icon */
    overflow-y: auto; /* Allow scrolling if content overflows */
    visibility: hidden; /* Initially hidden */
  }
  
  .sliding-menu.left {
    left: 0;
    transform: translateX(-100%);
  }
  
  .sliding-menu.left.open {
    transform: translateX(0);
    visibility: visible; /* Make visible when open */
    transition: transform var(--transition-speed), visibility 0s; /* Remove delay */
  }
  
  .sliding-menu.right {
    right: 0;
    transform: translateX(100%);
  }
  
  .sliding-menu.right.open {
    transform: translateX(0);
    visibility: visible; /* Make visible when open */
    transition: transform var(--transition-speed), visibility 0s; /* Remove delay */
  }  
  
  .sliding-menu ul {
    list-style: none;
    padding: 20px;
    margin: 0;
    text-align: left; /* Default alignment */
  }
  
  .sliding-menu.right ul {
    text-align: right; /* Align text to the right for Arabic */
  }
  
  .sliding-menu ul li {
    margin-bottom: 20px;
  }
  
  .sliding-menu ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2rem;
    transition: color var(--transition-speed);
  }
  
  .sliding-menu ul li a:hover {
    color: var(--accent-color);
  }
  
  .sliding-menu .close-icon {
    font-size: 1.5rem;
    cursor: pointer;
    position: absolute;
    top: 20px;
  }
  
  .sliding-menu .close-icon.left {
    left: 20px;
  }
  
  .sliding-menu .close-icon.right {
    right: 20px;
  }
  
  /* Sliding menu bottom section */
  .menu-bottom {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
  }
  
  #language-switcher {
    display: flex;
    align-items: center;
  }
  
  #language-switcher i {
    margin-right: 10px;
  }
  
  #language-select {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid var(--accent-color);
    background-color: var(--primary-color);
    color: var(--text-color);
  }
  
  #dark-mode-toggle {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--secondary-color);
    transition: color var(--transition-speed);
  }
  
  #dark-mode-toggle:hover {
    color: var(--accent-color);
  }  
  

/* Show menu icon and hide nav on small screens */
@media (max-width: 768px) {
  nav {
    display: none;
  }

  .menu-icon {
    display: block;
  }

  .sliding-menu {
    display: block;
  }

  .logo {
    flex: 1;
    text-align: center;
  }

  .logo h1 {
    margin: 0 auto;
  }

  .container {
    justify-content: space-between;
  }
}

/* Dark mode styles for .btn */
.dark-mode .btn {
  color: #000;
}

/* Hero section */
.hero {
  background-image: url("https://img.freepik.com/premium-photo/marble-stone-countertop-modern-kitchen-background_627079-3649.jpg?w=900");
  background-size: cover;
  background-position: center;
  height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
  max-width: 600px;
  padding: 20px;
  animation: fadeIn 1.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h2 {
  font-size: 2rem;
  margin-bottom: 15px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
  font-size: 1rem;
  margin-bottom: 20px;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--accent-color);
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color var(--transition-speed),
    transform var(--transition-speed);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* Dark mode styles for .btn */
.dark-mode .btn {
  color: #000;
}

/* Products section */
.products {
  padding: 80px 0;
  background-color: var(--background-color);
  transition: background-color var(--transition-speed);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.product {
  background-color: var(--primary-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: transform var(--transition-speed),
    box-shadow var(--transition-speed);
}

.product:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.product img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform var(--transition-speed);
}

.product:hover img {
  transform: scale(1.1);
}

.product h3,
.product p {
  padding: 20px;
}

/* Styles for smaller screens */
@media (min-width: 481px) and (max-width: 768px) {
  .product-grid,
  .team-grid,
  .partners-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-grid > *:nth-child(2n + 1):last-child,
  .team-grid > *:nth-child(2n + 1):last-child,
  .partners-grid > *:nth-child(2n + 1):last-child {
    grid-column: 1 / -1;
    justify-self: center;
  }

  .products {
    padding: 40px 0;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    justify-items: center;
  }

  .product {
    border-radius: 5px;
    width: 100%;
    max-width: 300px;
  }

  .product:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  }

  .product img {
    height: 150px;
  }

  .product:hover img {
    transform: scale(1.05);
  }

  .product h3,
  .product p {
    padding: 10px;
    font-size: 0.9rem;
  }
}

/* About section */
.about {
  padding: 80px 0;
  background-color: var(--primary-color);
  transition: background-color var(--transition-speed);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.about-image img {
  width: 100%;
  border-radius: 10px;
  box-shadow: var(--box-shadow);
  transition: transform var(--transition-speed);
}

.about-image:hover img {
  transform: scale(1.05);
}

/* Show More button */
.show-more {
  display: inline-block;
  margin: 40px auto 0;
  padding: 12px 24px;
  background-color: var(--accent-color);
  color: #fff;
  text-decoration: none;
  border-radius: 30px;
  transition: background-color 0.3s ease, transform 0.3s ease,
    box-shadow 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.show-more::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300%;
  height: 300%;
  background-color: rgba(255, 255, 255, 0.2);
  transition: width 0.3s ease, height 0.3s ease, top 0.3s ease, left 0.3s ease;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.show-more:hover::before {
  width: 0;
  height: 0;
  top: 50%;
  left: 50%;
}

.show-more:hover {
  background-color: var(--secondary-color);
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.show-more:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Team section */
#team-title {
  margin-top: 20px; /* Adjusted top margin */
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 40px;
  margin-bottom: 60px;
}

.team-member {
  background-color: var(--primary-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: transform var(--transition-speed),
    box-shadow var(--transition-speed);
  text-align: center; /* Center text */
}

.team-member:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.team-member img {
  width: 100px; /* Adjusted size */
  height: 100px; /* Adjusted size */
  object-fit: cover;
  border-radius: 50%; /* Make image round */
  margin-top: 20px; /* Add margin */
  transition: transform var(--transition-speed);
}

.team-member:hover img {
  transform: scale(1.1);
}

.team-member h3 {
  font-size: 1.2rem; /* Smaller font size */
  margin: 10px 0 5px; /* Adjusted margin */
}

.team-member p {
  font-size: 0.9rem; /* Smaller font size */
  margin: 0 20px 20px; /* Adjusted margin */
}

/* Mobile app section */
#mobile-app {
  padding: 20px 0;
  background-color: var(--primary-color); /* Adjusted background color */
  transition: background-color var(--transition-speed);
  margin-top: 10px; /* Adjusted top margin */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#mobile-app .app-text {
  text-align: left;
  width: 100%;
}

#mobile-app .app-button {
  text-align: right;
  width: 100%;
  margin-top: 20px; /* Space between text and button */
}

#mobile-app .app-button a {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background-color: var(--accent-color);
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color var(--transition-speed),
    transform var(--transition-speed);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#mobile-app .app-button a img {
  margin-right: 10px;
}

#mobile-app .app-button a:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* About section */
.about {
  padding: 80px 0;
  background-color: var(--primary-color);
  transition: background-color var(--transition-speed);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.about-image img {
  width: 100%;
  border-radius: 10px;
  box-shadow: var(--box-shadow);
  transition: transform var(--transition-speed);
}

.about-image:hover img {
  transform: scale(1.05);
}

/* Contact section */
.contact {
  padding: 80px 0;
  background-color: var(--background-color);
  transition: background-color var(--transition-speed);
  margin-top: 20px; /* Adjusted top margin */
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.contact-item {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.contact-item i {
  font-size: 1.5rem;
  margin-right: 15px;
  color: var(--accent-color);
}

.map-container {
  height: 300px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--box-shadow);
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

form input,
form textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  border: 1px solid var(--accent-color);
  border-radius: 5px;
  background-color: var(--primary-color);
  color: var(--text-color);
  transition: border-color var(--transition-speed),
    box-shadow var(--transition-speed);
}

form input:focus,
form textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 5px var(--glow-color);
}

form textarea {
  height: 150px;
  resize: vertical;
}

/* Centering form elements */
form {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

/* Footer */
footer {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  text-align: center;
  padding: 20px 0;
  transition: background-color var(--transition-speed),
    color var(--transition-speed);
}

/* Footer links */
footer a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color var(--transition-speed);
}

footer a:hover {
  color: var(--primary-color);
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    width: 100%;
    padding: 0 15px;
  }

  header .container {
    flex-wrap: nowrap;
    height: 60px;
  }

  .logo {
    flex: 1;
    text-align: left;
  }

  nav {
    flex: 2;
  }

  nav ul {
    justify-content: flex-end;
  }

  .hero {
    height: 50vh;
  }

  .hero h2 {
    font-size: 1.5rem;
  }

  .hero p {
    font-size: 0.9rem;
  }

  .product-grid,
  .team-grid,
  .partners-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid,
  .contact-content {
    grid-template-columns: 1fr;
  }

  form {
    width: 100%;
  }
}

/* Responsive design for Dark Mode Toggle */
@media (max-width: 768px) {
  .dark-mode-toggle {
    font-size: 0.9rem;
    padding: 8px 16px;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .contact-content {
    grid-template-columns: 1fr;
  }

  .logo {
    text-align: center;
  }

  .menu-icon {
    order: -1;
  }
}

/* Adjustments for smaller screens */
@media (max-width: 480px) {
  .product-grid,
  .team-grid,
  .partners-grid {
    grid-template-columns: 1fr;
  }

  .hero-content {
    padding: 10px;
  }

  .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
}

/* Cookie Consent Styles */
#cookie-consent {
    position: fixed;
    bottom: 0;
    width: 100%; /* Make the width match the parent */
    background-color: #f8f9fa; /* Background color */
    padding: 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: none;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

#cookie-consent.show {
    display: flex;
}

#cookie-consent p {
    margin: 0;
    color: #333;
}

#cookie-consent .buttons {
    display: flex;
    gap: 10px; /* Space between buttons */
    margin-left: auto; /* Align buttons to the right */
}

#cookie-consent button {
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    border-radius: 5px;
}

/* Button colors */
#accept-cookies {
    background-color: #007bff; /* Blue color for accept button */
    color: #fff;
}

#decline-cookies {
    background-color: #e0e0e0; /* Slightly different color for decline button */
    color: #333;
}

/* Link styles */
.cookie-consent a {
    color: var(--accent-color);
    text-decoration: underline;
}

.cookie-consent a:hover {
    color: var(--secondary-color);
}

.cookie-buttons {
    display: flex;
    gap: 10px;
}

.cookie-consent .btn {
    padding: 10px 20px;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.cookie-consent .btn:hover {
    background-color: var(--secondary-color);
}

.cookie-consent .btn-secondary {
    background-color: var(--secondary-color);
}

.cookie-consent .btn-secondary:hover {
    background-color: var(--accent-color);
}

/* Responsive design */
@media (max-width: 768px) {
    .cookie-consent {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-consent p {
        padding-right: 0;
        margin-bottom: 10px;
    }

    .cookie-buttons {
        width: 100%;
        justify-content: flex-end; /* Align buttons to the right on small screens */
    }
}
