/* Importing the original styles with adaptations for Flask */
/* General Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    line-height: 1.6;
}

/* Header Section */
.header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 10px 20px;
    background-color: #f8f8f8;
}

.logo {
    justify-self: center;
}

#logo {
    width: 160px;
    height: 118px;
    position: relative;
    display: block;
    top: -10px;
}

.logo:hover {
    color: #0073e6;
}

/* Search Bar Styling */
.search-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    max-width: 400px;
    position: relative;
    justify-self: start;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #ccc;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-bar input:focus {
    border-color: #0073e6;
    box-shadow: 0 0 8px rgba(0, 115, 230, 0.5);
}

.search-bar button {
    position: absolute;
    right: -41px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #828282;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.search-bar button:hover {
    background-color: #828282;
    transform: translateY(-50%) scale(1.1);
}

.search-bar button:active {
    transform: translateY(-50%) scale(0.95);
}

.search-bar button img {
    width: 21px;
    height: 21px;
}

.contact-info {
    text-align: right;
}

.social-icons a {
    margin-left: 10px;
    text-decoration: none;
    font-size: 20px;
}

/* Main Navigation Bar */
.navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #333;
    padding: 5px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navigation a {
    margin: 0 15px;
    text-decoration: none;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.navigation a:hover {
    background-color: #606060;
    color: #fff;
    transform: scale(1.1);
}

.navigation a.active {
    background-color: #606060;
    color: #fff;
    border: 1px solid #606060;
}

/* Dropdown Menu */
.dropdown {
    display: none;
    position: absolute;
    top: 96%;
    left: 170px;
    transform: translateX(-50%);
    background-color: #444;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: dropdown-slide 0.3s ease forwards;
    white-space: nowrap;
    flex-direction: column;
}

.dropdown a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: bold;
    display: block;
    margin: 5px 0;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.dropdown a:hover {
    background-color: #9ca1ac;
}

/* Show dropdown on hover */
.dropdown-parent:hover + .dropdown,
.dropdown:hover {
    display: flex;
    flex-direction: column;
}

.dropdown-parent-active {
    background-color: #606060;
    color: #fff;
    border: 1px solid #606060;
}

/* Dropdown Slide-Down Animation */
@keyframes dropdown-slide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Image Carousel */
.carousel {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
    border: 2px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    max-width: 1300px;
    max-height: 350px;
    background-color: #f9f9f9;
}

.carousel img {
    width: 100%;
    height: 400px;
    display: none;
    object-fit: cover;
}

.carousel img.active {
    display: block;
}

.carousel .arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 10px;
    cursor: pointer;
    z-index: 2;
}

.arrow-left {
    left: 10px;
}

.arrow-right {
    right: 10px;
}

/* Brands Ticker */
.brands-ticker {
    text-align: center;
    margin: 30px auto;
    max-width: 1200px;
}

.brands-ticker h2 {
    margin-bottom: 20px;
}

.brands-list {
    display: flex;
    overflow: hidden;
    padding: 0;
    list-style: none;
}

.brands-list li {
    flex-shrink: 0;
    margin: 0 20px;
    animation: scroll 20s linear infinite;
}

.brands-list img {
    height: 60px;
    width: auto;
}

@keyframes scroll {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Main Content Section */
.content {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    width: 30%;
    padding: 20px;
    background: #f1f1f1;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* About Us Card Styling */
.about-us-card {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.about-us-card p {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.about-us-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #8c8c8c;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.about-us-button:hover {
    background-color: #828282;
}

#types-bg {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
}

/* Reviews Section */
.checkatrade-reviews {
    background: #f8f8f8;
    padding: 30px;
    text-align: center;
    border-radius: 10px;
    max-width: 800px;
    margin: 20px auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.checkatrade-reviews h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
}

.review-card {
    background: white;
    padding: 20px;
    margin: 15px 0;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.review-text {
    font-size: 16px;
    color: #444;
    margin-bottom: 10px;
    line-height: 1.6;
}

.review-rating {
    color: #FFD700;
    font-size: 18px;
    margin-bottom: 5px;
}

.review-author {
    font-weight: bold;
    color: #555;
    font-size: 14px;
}

/* Product Page Layout */
.product-page {
    display: flex;
    gap: 20px;
    margin: 20px auto;
    max-width: 1200px;
    padding: 20px;
}

/* Sidebar Styling */
.sidebar {
    flex: 1;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 400px;
}

.sidebar h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.sidebar label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: #555;
}

.sidebar input[type="checkbox"] {
    margin-right: 10px;
}

/* Product Grid Styling */
.product-grid {
    flex: 3;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.product {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.product img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
}

.product h4 {
    font-size: 18px;
    color: #333;
    margin-bottom: 5px;
}

.product p {
    font-size: 16px;
    color: #666;
}

#prod-id {
    font-size: 14px;
    color: #999;
}

/* View Product Button */
.view-product-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #848383;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.view-product-btn:hover {
    background-color: #757474;
    transform: scale(1.05);
}

.view-product-btn:active {
    transform: scale(0.95);
}

/* Product Detail Page */
.product-details {
    margin-bottom: 30px;
    text-align: center;
}

.product-title {
    font-size: 32px;
    color: #333;
    margin-bottom: 10px;
}

.product-description {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

.product-images {
    margin: 30px auto;
    max-width: 800px;
    text-align: center;
}

.main-image {
    margin-bottom: 20px;
}

.main-image img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.thumbnail-images {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s, transform 0.3s;
}

.thumbnail:hover {
    opacity: 1;
    transform: scale(1.1);
}

.thumbnail.active {
    opacity: 1;
    border: 2px solid #007BFF;
}

.product-specs {
    margin: 30px auto;
    max-width: 800px;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.specs-table tr {
    border-bottom: 1px solid #ddd;
}

.specs-table tr:last-child {
    border-bottom: none;
}

.specs-table td {
    padding: 12px 15px;
}

.spec-name {
    font-weight: bold;
    color: #333;
    width: 40%;
}

.spec-value {
    color: #555;
}

.product-features {
    margin: 30px auto;
    max-width: 800px;
}

.product-features ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-top: 15px;
}

.product-features li {
    margin-bottom: 10px;
    color: #555;
}

/* Call to Action Button */
.cta-section {
    text-align: center;
    margin: 40px 0;
}

.cta-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: #848484;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #005bb5;
}

/* Search Results Page */
.results {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 20px auto;
    padding: 20px;
    max-width: 1200px;
}

.result-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    padding: 15px;
    width: 250px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.result-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.result-card h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

.result-id {
    font-size: 14px;
    color: #999;
    margin-bottom: 10px;
}

.result-desc {
    font-size: 14px;
    color: #555;
    margin-bottom: 15px;
}

.result-link {
    display: inline-block;
    padding: 10px 15px;
    background-color: #828282;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.result-link:hover {
    background-color: #969696;
}

/* About Us Page */
.about-us {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.section-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin: 30px 0 20px;
    text-align: center;
}

.section-text {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
}

.about-image {
    text-align: center;
    margin: 30px 0;
}

.about-image img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.commitment-list {
    padding-left: 20px;
    margin: 20px 0;
}

.commitment-list li {
    margin-bottom: 10px;
    color: #555;
}

.map-container {
    margin-top: 40px;
}

/* Contact Page */
.contact-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.page-title {
    font-size: 32px;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.contact-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.contact-info {
    flex: 1;
    min-width: 300px;
}

.contact-info h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
}

.contact-info p {
    font-size: 16px;
    color: #555;
    margin-bottom: 20px;
}

.contact-details {
    margin-top: 30px;
}

.contact-item {
    margin-bottom: 20px;
}

.contact-item h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

.social-links a {
    display: inline-block;
    margin-right: 10px;
    color: #007BFF;
    text-decoration: none;
}

.social-links a:hover {
    text-decoration: underline;
}

.contact-form {
    flex: 1;
    min-width: 300px;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.contact-form h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.form-control:focus {
    border-color: #007BFF;
    outline: none;
}

textarea.form-control {
    height: 150px;
    resize: vertical;
}

.errors {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

.submit-btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #848484;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #005bb5;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer Styling */
.footer {
    background-color: #333;
    color: #fff;
    padding: 20px 0;
    text-align: center;
    margin-top: 50px;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.footer-nav, .footer-contact, .footer-social {
    flex: 1;
    margin: 10px;
    min-width: 200px;
}

.footer-nav h3, .footer-contact h3, .footer-social h3 {
    font-size: 18px;
    margin-bottom: 10px;
    text-transform: uppercase;
    color: #f8f8f8;
}

.footer-nav .quick-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.footer-nav .quick-links a {
    color: #ddd;
    text-decoration: none;
    font-size: 14px;
    padding: 5px 10px;
    background-color: #444;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.footer-nav .quick-links a:hover {
    background-color: #555;
    color: #fff;
}

.footer-contact p, .footer-social a {
    margin: 5px 0;
    color: #dbd7d7;
    text-decoration: none;
}

.footer-social a img {
    margin: 0 5px;
    transition: transform 0.3s;
}

.footer-social a img:hover {
    transform: scale(1.1);
}

.footer-copyright {
    background-color: #222;
    padding: 10px 0;
    font-size: 14px;
    color: #aaa;
}

/* Mobile responsiveness improvements */
@media (max-width: 768px) {
    /* Reorganize header for mobile */
    .header {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 1rem;
      gap: 1rem;
    }
  
    /* Center logo */
    .logo {
      order: 1;
      margin: 0 auto;
      text-align: center;
    }
  
    #logo {
      max-width: 180px;
      height: auto;
    }
  
    /* Center contact info and social area */
    .contact-info {
      order: 2;
      text-align: center;
      width: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
    }
  
    .social-icons {
      display: flex;
      justify-content: center;
      margin-top: 0.5rem;
    }
  
    /* Move search bar to bottom of header */
    .search-bar {
      order: 3;
      width: 100%;
      max-width: 100%;
    }
  
    /* Navigation bar container */
  .navigation {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0;
    text-align: center;
  }

  /* Centered navigation links */
  .navigation a {
    display: inline-block;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    white-space: nowrap;
    text-align: center;
  }

  /* For horizontal scrolling if needed */
  .navigation-scroll {
    width: 100%;
    overflow-x: auto;
    display: flex;
    justify-content: center;
  }
  
    /* Fix dropdown positioning for mobile */
    .dropdown {
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      width: 200px;
      z-index: 100;
    }
  }
  
  /* Extra small devices */
  @media (max-width: 576px) {
    .navigation {
      justify-content: flex-start;
      padding: 0 0.5rem;
    }
    
    .navigation a {
      padding: 0.75rem 0.75rem;
      font-size: 0.85rem;
    }
    
    #logo {
      max-width: 150px;
    }
    
    .contact-info p {
      font-size: 0.9rem;
      margin: 0.25rem 0;
    }
  }

  /* Better responsive behavior */
  @media (max-width: 992px) {
    .header {
      grid-template-columns: auto auto;
      gap: 1rem;
      padding: 1rem;
    }
    
    .logo {
      justify-self: start;
    }
    
    .search-bar {
      grid-column: 1 / -1;
      grid-row: 2;
      max-width: 100%;
      width: 100%;
      margin-top: 1rem;
    }
    
    .contact-info {
      justify-self: end;
    }
    
    .navigation {
      overflow-x: auto;
      justify-content: flex-start;
      padding: 0 1rem;
    }
    
    .navigation a {
      white-space: nowrap;
    }
    
    .content {
      flex-direction: column;
      padding: 2rem 1rem;
    }
    
    .card {
      width: 100%;
    }
    
    .product-page {
      flex-direction: column;
      padding: 2rem 1rem;
    }
    
    .sidebar {
      width: 100%;
      position: static;
      margin-bottom: 2rem;
    }
    
    .footer-content {
      grid-template-columns: 1fr;
      text-align: center;
      gap: 3rem;
    }
    
    .footer h3:after {
      left: 50%;
      transform: translateX(-50%);
    }
    
    .footer-nav .quick-links {
      align-items: center;
    }
  }
  
  @media (max-width: 768px) {
    h1 {
      font-size: 2rem;
    }
    
    h2 {
      font-size: 1.75rem;
    }
    
    .carousel {
      height: 300px;
    }
    
    .carousel img {
      height: 300px;
    }
    
    .contact-container {
      box-shadow: none;
      border-radius: 0;
    }
    
    .contact-info, .contact-form {
      border-radius: 8px;
      margin-bottom: 2rem;
    }
    
    .admin-navbar {
      height: auto;
      padding: 1rem;
      flex-direction: column;
      align-items: flex-start;
    }
    
    .admin-navbar .brand {
      margin-bottom: 1rem;
    }
    
    .admin-nav {
      flex-direction: column;
      width: 100%;
    }
    
    .admin-nav li {
      width: 100%;
    }
    
    .admin-nav a {
      width: 100%;
      text-align: left;
      border-radius: 0;
      border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .admin-user-menu {
      width: 100%;
      margin-top: 1rem;
      justify-content: space-between;
    }
    
    .page-title {
      flex-direction: column;
      align-items: flex-start;
      gap: 1rem;
    }
    
    .admin-container {
      padding: 1rem;
    }
  }