/*
=====================================
=== 1. GENERAL & SETUP (NEW THEME)
=====================================
*/
:root {
    --primary-color: #1e3a8a; /* New: AutoPartPro Blue */
    --secondary-color: #f97316; /* New: AutoPartPro Orange */
    --light-grey: #f4f4f4;
    --dark-grey: #333;
    
    /* New Theme Colors */
    --theme-dark-bg: #171717; /* bg-neutral-900 */
    --theme-dark-border: #404040; /* border-neutral-800 */
    --theme-dark-text: #d4d4d4; /* text-neutral-300 */
    --theme-dark-text-hover: #ffffff; /* text-white */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}
*::-webkit-scrollbar {
    display: none !important;
}

body {
    font-family: Roboto, Inter, system-ui, sans-serif;
    line-height: 1.6;
    color: var(--dark-grey);
    
    /* === NEW BACKGROUND (FROM touch.html) === */
    --italian-green: #009246;
    --italian-white: #FFFFFF;
    --italian-red: #CE2B37;
    position: relative; 
    background-color: #f7f7f7; /* Main fallback */
    min-height: 100vh;
}
body::before {
    content: "";
    position: fixed; 
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1; 
    background: linear-gradient(
      to bottom right, 
      var(--italian-green) 0%, 
      var(--italian-green) 33%, 
      var(--italian-white) 33%,
      var(--italian-white) 66%,
      var(--italian-red) 66%,
      var(--italian-red) 100%
    );
    opacity: 0.2; /* Subtle opacity */
}
/* === END NEW BACKGROUND === */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Dancing Script', cursive, Inter, system-ui, sans-serif;
    font-style: italic; 
    font-weight: 700;
}

a { color: var(--primary-color); text-decoration: none; }
img { max-width: 100%; }

.page-container {
    max-width: 1200px; /* Was 1200px, new theme is 7xl (1280px) */
    margin: 2rem auto;
    padding: 0 1rem;
}
main {
    position: relative;
    z-index: 10;
    background: transparent; /* Let the new body bg show */
}
/* This is a new helper from touch.html for our content */
.content-wrapper {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 2rem;
}


/*
=====================================
=== 2. BUTTONS (UPDATED)
=====================================
*/
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 0.5rem; /* rounded-lg */
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    font-weight: bold;
}
.btn-primary {
    background: var(--secondary-color); /* New: Orange */
    color: white;
}
.btn-primary:hover { background: #ea580c; } /* New: hover-orange-600 */

.btn-secondary {
    background: var(--light-grey);
    color: var(--dark-grey);
    border: 1px solid #ccc;
}
.btn-secondary:hover { background: #e0e0e0; }

.btn-login {
    background: var(--blue-color);
    color: white;
    border: 1px solid var(--blue-color);
}
.btn-login:hover { background: var(--blue-hover); }

.btn-danger {
    background: #f44336;
    color: white;
}
.btn-danger:hover { background: #c62828; }


/*
=====================================
=== 3. HEADER & NAVBAR (NEW THEME)
=====================================
*/
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px; /* h-16 */
    
    /* New theme styles from touch.html */
    background: rgba(23, 23, 23, 0.9); /* bg-neutral-900/90 */
    backdrop-filter: blur(16px); /* backdrop-blur-lg */
    border-bottom: 1px solid var(--theme-dark-border);
    
    padding: 0 1.5rem; /* px-6 */
    position: sticky;
    top: 0;
    z-index: 50;
}
.logo a {
    color: white;
    font-size: 1.25rem;
    font-weight: bold;
}
.logo img {
    height: 40px; /* h-10 */
}

/* --- New Desktop Nav --- */
.nav-links-desktop {
    display: flex;
    align-items: center;
    gap: 1.5rem; /* space-x-6 */
}
.nav-links-desktop a {
    color: var(--theme-dark-text);
    transition: color 0.3s;
}
.nav-links-desktop a:hover {
    color: var(--theme-dark-text-hover);
}
.nav-links-desktop .cart-icon {
    font-size: 1.1rem;
}
/* This is the "Shop Now" button */
.nav-links-desktop .btn-primary {
    padding: 0.5rem 1rem; /* py-2 px-4 */
}
@media (max-width: 768px) {
    .nav-links-desktop {
        display: none;
    }
}

/*
=====================================
=== 4. HAMBURGER & MOBILE MENU (NEW)
=====================================
*/
.hamburger {
    display: none; /* Hidden on desktop */
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    color: var(--theme-dark-text);
}
.hamburger:hover {
    color: var(--theme-dark-text-hover);
}
.hamburger svg {
    height: 24px; /* h-6 */
    width: 24px; /* w-6 */
}
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }
}

/* New Mobile Menu Dropdown */
.mobile-menu {
    display: none; /* hidden */
    background: var(--theme-dark-bg);
    padding: 0 1.5rem 1rem; /* px-6 pb-4 */
    
    /* Position for dropdown */
    position: absolute;
    top: 64px; /* Below the header */
    left: 0;
    width: 100%;
    z-index: 49;
    border-bottom: 1px solid var(--theme-dark-border);
}
.mobile-menu.active {
    display: block; /* Show the menu */
}
.mobile-menu a {
    display: block;
    padding: 0.5rem 0; /* py-2 */
    color: var(--theme-dark-text);
    transition: color 0.3s;
}
.mobile-menu a:hover {
    color: var(--theme-dark-text-hover);
}
.mobile-menu .btn {
    margin-top: 0.5rem;
    text-align: center;
}


/*
=====================================
=== 5. FOOTER (NEW THEME)
=====================================
*/
footer {
    background: #0a0a0a; /* bg-neutral-950 */
    color: var(--theme-dark-text);
    padding: 3rem 1.5rem; /* py-12 px-6 */
    margin-top: 2rem;
}
.footer-grid {
    max-width: 1280px; /* max-w-7xl */
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(1, 1fr); /* Mobile-first */
    gap: 2rem;
}
@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr); /* md:grid-cols-4 */
    }
}
.footer-col .footer-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1rem;
    font-family: Inter, sans-serif; /* Override Dancing Script */
    font-style: normal;
}
.footer-col .logo-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    font-family: Inter, sans-serif; /* Override Dancing Script */
    font-style: normal;
}
.footer-col p, .footer-col .footer-links {
    font-size: 0.875rem; /* text-sm */
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* space-y-2 */
}
.footer-col a:hover {
    color: white;
    transition: color 0.3s;
}
.footer-bottom {
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--theme-dark-border);
    text-align: center;
    font-size: 0.875rem; /* text-sm */
    color: #a3a3a3; /* text-neutral-500 */
    max-width: 1280px;
}


/*
=====================================
=== 6. ALL OUR OLD STYLES (Unchanged)
=====================================
(Forms, Tables, Product Grids, etc. all live here)
*/

/* --- ALERTS & MESSAGES --- */
.error-message {
    background: #ffebee; color: #c62828;
    padding: 1rem; border: 1px solid #c62828;
    border-radius: 4px; margin-bottom: 1rem;
}
.success-message {
    background: #e8f5e9; color: #2e7d32;
    padding: 1rem; border: 1px solid #2e7d32;
    border-radius: 4px; margin-bottom: 1rem;
}

/* --- FORMS (Login, Signup, Admin) --- */
.auth-container {
    max-width: 500px;
    margin: 2rem auto;
    /* Add the new wrapper style */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    padding: 2rem;
}
.auth-form h2 { text-align: center; margin-bottom: 1.5rem; color: var(--primary-color); }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: bold; }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.auth-form .btn { width: 100%; margin-top: 1rem; }
.auth-switch { text-align: center; margin-top: 1rem; }

/* --- ADMIN DASHBOARD TABLE --- */
.admin-table {
    width: 100%;
    margin-top: 2rem;
    border-collapse: collapse;
}
.admin-table th, .admin-table td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
    white-space: nowrap;
}
.admin-table th { background: var(--light-grey); }
.admin-table td form { display: inline-block; margin-left: 0.5rem; }

/* --- HOMEPAGE (Hero & Search) --- */
.hero {
    background: white; /* hero was #f7f7f7, but touch.html is white */
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}
.hero h1 { font-size: 2.5rem; color: var(--primary-color); }
.vehicle-finder {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 150px;
    gap: 1rem;
    align-items: end;
}
.part-search-form { display: flex; gap: 1rem; }
.part-search-form .search-bar {
    flex-grow: 1;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.search-divider {
    font-size: 1.2rem;
    font-weight: bold;
    color: #555;
    margin: 1.5rem 0;
}
.vehicle-finder .cta-button {
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    padding: 0.75rem;
    font-size: 1rem;
    border-radius: 4px;
}
.part-search-form .cta-button {
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 4px;
}

/* --- PRODUCT GRID (Shop & Home) --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.product-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.product-card img { width: 100%; height: 200px; object-fit: cover; }
.product-card h3 { font-size: 1.2rem; margin: 1rem; height: 3.6em; overflow: hidden; }
.product-card .product-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.product-card .btn {
    display: block;
    background: var(--dark-grey);
    color: white;
    padding: 0.75rem;
    margin: 1rem;
    border-radius: 4px;
}
.product-card .btn:hover { background: var(--primary-color); }

/* --- CUSTOM FORM ELEMENTS (SELECT) --- */
.select-wrapper {
  position: relative;
  width: 100%;
}
.select-wrapper::after {
  content: '▼';
  font-size: 0.8rem;
  color: #555;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.form-group select,
.vehicle-finder select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: white;
  cursor: pointer;
}
.vehicle-finder select {
    font-size: 1rem;
}

/*
=====================================
=== 11. RESPONSIVE (MOBILE)
=====================================
*/
@media (max-width: 768px) {
    /* Hide desktop nav, show mobile */
    .nav-links-desktop { display: none; }
    .hamburger { display: block; }

    /* Fix header padding */
    .navbar { padding: 0 1rem; }
    
    /* Fix hero layouts */
    .hero { padding: 3rem 1rem; }
    .vehicle-finder { grid-template-columns: 1fr; }
    
    /* Other page layout fixes */
    .page-container { padding: 0 1rem; }
    .product-grid { grid-template-columns: 1fr; }
    .auth-container { padding: 1.5rem; margin: 1rem; border: none; background: none; }
    .admin-dashboard { padding: 0.5rem; }
    .admin-table { display: block; width: 100%; overflow-x: auto; }
}
/*
=====================================
=== 14. FEDERATED SEARCH RESULTS (NEW)
=====================================
*/
.product-card.web-result {
    /* Make it clear this is an external link */
    border: 2px solid var(--primary-color);
    position: relative;
    padding-top: 1.5rem; /* Make space for the badge */
}
.web-snippet {
    font-size: 0.9rem;
    color: #555;
    padding: 0 1rem;
    height: 6em; /* Limit to ~4 lines */
    overflow: hidden;
}
.web-result-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 8px 0 8px 0;
    font-family: Inter, sans-serif;
    font-style: normal;
}