* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #f2f2f2;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-gray: #ecf0f1;
    --border-color: #bdc3c7;
    --success-color: #27ae60;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f5f5;
}

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

/* Header */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 0.7rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.8rem;
}

.cart-icon {
    position: relative;
    cursor: pointer;
    padding: 10px;
    transition: transform 0.2s;
}

.cart-icon:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Search and Filter Section */
.search-filter-section {
    background-color: white;
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.search-box input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

.search-box button {
    padding: 12px 30px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background-color: #2980b9;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 600;
    color: var(--primary-color);
}

.filter-group select {
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
}

.reset-filters {
    padding: 10px 20px;
    background-color: var(--light-gray);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.reset-filters:hover {
    background-color: var(--border-color);
}

/* Products Section */
.products-section {
    margin: 2rem 0;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.products-header h2 {
    color: var(--primary-color);
    font-size: 2rem;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-options label {
    font-weight: 600;
}

.sort-options select {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.95rem;
    cursor: pointer;
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.product-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

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

.product-image {
    width: 100%;
    height: 250px;
    object-fit: contain;
    background-color: #f8f9fa;
    padding: 20px;
}

.product-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--border-color);
    font-size: 3rem;
}

.product-info {
    padding: 1.5rem;
}

.product-collection {
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.product-category {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.product-colors {
    display: flex;
    gap: 5px;
    margin: 0.75rem 0;
    flex-wrap: wrap;
}

.color-badge {
    background-color: var(--light-gray);
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    color: var(--text-color);
}

.product-variants {
    font-size: 0.85rem;
    color: #95a5a6;
    margin-bottom: 0.75rem;
}

.product-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--accent-color);
}

.price-range {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.no-results {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: #7f8c8d;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 3% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: var(--accent-color);
}

/* Product Details in Modal */
#productDetails {
    padding: 2rem;
}

.product-detail-header {
    margin-bottom: 2rem;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.product-detail-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.product-detail-info h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.color-selector {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.color-option:hover {
    border-color: var(--secondary-color);
    background-color: #f8f9fa;
}

.color-option.selected {
    border-color: var(--secondary-color);
    background-color: #e8f4f8;
}

.color-option input[type="radio"] {
    cursor: pointer;
}

.variant-selector select {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    margin-top: 10px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.quantity-selector input {
    width: 80px;
    padding: 8px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    text-align: center;
    font-size: 1rem;
}

.add-to-cart-btn {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 1.5rem;
}

.add-to-cart-btn:hover {
    background-color: #229954;
}

.variants-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.variants-table th,
.variants-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.variants-table th {
    background-color: var(--light-gray);
    font-weight: 600;
    color: var(--primary-color);
}

.variants-table tr:hover {
    background-color: #f8f9fa;
}

/* Cart Items */
.cart-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background-color: #f8f9fa;
    border-radius: 5px;
    padding: 5px;
}

.cart-item-details h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.cart-item-details p {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin: 2px 0;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.cart-item-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
}

.remove-item-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.3s;
}

.remove-item-btn:hover {
    background-color: #c0392b;
}

.cart-total {
    padding: 1.5rem;
    text-align: right;
    font-size: 1.3rem;
    background-color: var(--light-gray);
    border-radius: 5px;
    margin: 1rem 0;
}

/* Quote Form */
.quote-form {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.quote-form h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

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

.submit-quote {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}

.submit-quote:hover {
    background-color: #2980b9;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.3rem;
    }

    .search-filter-section {
        padding: 1rem;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .product-detail-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    #productDetails {
        padding: 1rem;
    }

    .cart-item {
        grid-template-columns: 1fr;
    }

    .cart-item-actions {
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-image {
        height: 200px;
    }
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Tooltip for product codes */
.code-tooltip-wrapper:hover .code-tooltip {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Override Tailwind bg-gray-100 to white */
.bg-gray-100 {
    background-color: #ffffff !important;
}

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

/* Mobile Header Improvements */
@media (max-width: 768px) {
    header .max-w-container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    header img {
        height: 2.5rem !important; /* h-10 equivalent */
    }
    
    header .fa-shopping-cart {
        font-size: 1rem !important;
    }
    
    header a[href="offerte.php"] {
        padding: 0.625rem 1rem !important;
    }
    
    header a span {
        height: 1.5rem !important;
        width: 1.5rem !important;
        font-size: 0.65rem !important;
    }
}

/* Sidebar Responsive */
@media (max-width: 1024px) {
    .max-w-container > main {
        flex-direction: column;
    }
    
    aside#filterSidebar {
        width: 100% !important;
        position: static !important;
        height: auto !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(229, 229, 229, 0.5);
    }
    
    aside#filterSidebar h3 {
        font-size: 1.125rem !important;
    }
    
    aside#filterSidebar p {
        font-size: 0.75rem !important;
    }
    
    main > section {
        width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Footer Responsive */
@media (max-width: 768px) {
    footer .max-w-container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    footer .flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2rem !important;
    }
    
    footer img {
        height: 2.5rem !important;
    }
    
    footer .text-left.md\\:text-right {
        text-align: left !important;
    }
    
    footer p {
        font-size: 0.875rem !important;
    }
    
    footer .border-t.mt-8 {
        margin-top: 1.5rem !important;
        padding-top: 1.5rem !important;
    }
}

/* Offerte Page - Form Responsive */
@media (max-width: 1024px) {
    .lg\\:col-span-7,
    .lg\\:col-span-5 {
        grid-column: span 12 !important;
    }
    
    .sticky-sidebar {
        position: relative !important;
        top: 0 !important;
    }
}

@media (max-width: 640px) {
    .px-8 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .py-5 {
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
    }
    
    .py-12 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    h1 {
        font-size: 1.875rem !important; /* 3xl to 2xl */
    }
    
    h2 {
        font-size: 1.5rem !important; /* 2xl to xl */
    }
    
    .text-lg {
        font-size: 1rem !important;
    }
    
    .grid.gap-8 {
        gap: 1rem !important;
    }
    
    .md\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
}

/* Product Grid Responsive */
@media (max-width: 1280px) {
    .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3.xl\\:grid-cols-4 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 1024px) {
    .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3.xl\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 640px) {
    .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3.xl\\:grid-cols-4 {
        grid-template-columns: 1fr !important;
    }
    
    .rounded-2xl {
        border-radius: 1rem !important;
    }
    
    .p-6 {
        padding: 1rem !important;
    }
    
    .md\\:p-8 {
        padding: 1rem !important;
    }
}

/* Container Padding Mobile */
@media (max-width: 768px) {
    .max-w-container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Button Responsive */
@media (max-width: 640px) {
    button, a.rounded-xl {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
        font-size: 0.875rem !important;
    }
}

/* Modal Responsive */
@media (max-width: 640px) {
    .max-w-5xl,
    .max-w-4xl {
        max-width: 95% !important;
        margin: 1rem !important;
    }
    
    .max-h-\[90vh\] {
        max-height: 95vh !important;
    }
}

/* Cart Items Responsive */
@media (max-width: 640px) {
    #cartItemsList .flex {
        flex-direction: column !important;
    }
    
    #cartItemsList .w-20,
    #cartItemsList .w-16 {
        width: 100% !important;
        height: auto !important;
        max-height: 200px;
    }
}

/* Input Fields Mobile */
@media (max-width: 640px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}

/* Text Alignment Mobile */
@media (max-width: 640px) {
    .text-center {
        text-align: left !important;
    }
    
    h1.text-center,
    footer .text-center {
        text-align: center !important;
    }
}

/* Spacing Adjustments */
@media (max-width: 640px) {
    .mt-20 {
        margin-top: 2rem !important;
    }
    
    .mt-8 {
        margin-top: 1.5rem !important;
    }
    
    .mb-12 {
        margin-bottom: 2rem !important;
    }
    
    .gap-6 {
        gap: 1rem !important;
    }
    
    .space-y-8 > * + * {
        margin-top: 1.5rem !important;
    }
}

/* Touch Targets - Minimum 44x44px for mobile */
@media (max-width: 768px) {
    button,
    a,
    input[type="submit"],
    select {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Custom Tailwind utilities */
@media (min-width: 1024px) {
    .lg\:p-8 {
        padding: 2rem 1rem;
    }
}
