/* Reset und Basis */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: #fef9e7; /* Fallback for older browsers */
    background: -webkit-linear-gradient(135deg, #f5d14e 0%, #f7c947 100%);
    background: -moz-linear-gradient(135deg, #f5d14e 0%, #f7c947 100%);
    background: -o-linear-gradient(135deg, #f5d14e 0%, #f7c947 100%);
    background: linear-gradient(135deg, #f5d14e 0%, #f7c947 100%);
    min-height: 100vh;
    color: #333;
    background-color: #fef9e7; /* Ein sehr helles Gelb */
}

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

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    -webkit-box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 50px;
}

.cart-link {
    background: #1565c0;
    color: white;
    padding: 0.7rem 1.2rem;
    -webkit-border-radius: 25px;
    -moz-border-radius: 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    -webkit-box-shadow: 0 4px 15px rgba(21, 101, 192, 0.3);
    -moz-box-shadow: 0 4px 15px rgba(21, 101, 192, 0.3);
    box-shadow: 0 4px 15px rgba(21, 101, 192, 0.3);
}

.cart-link:hover {
    background: #0d47a1;
    -webkit-transform: translateY(-2px);
    -moz-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    -o-transform: translateY(-2px);
    transform: translateY(-2px);
    -webkit-box-shadow: 0 6px 20px rgba(21, 101, 192, 0.4);
    -moz-box-shadow: 0 6px 20px rgba(21, 101, 192, 0.4);
    box-shadow: 0 6px 20px rgba(21, 101, 192, 0.4);
}

/* Main Content */
.main-content {
    background: white;
    margin: 2rem auto;
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    border-radius: 20px;
    -webkit-box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 1200px;
}

.content-inner {
    padding: 2rem;
}

/* Produktgrid */
.product-grid {
    /* IE11 Fallback */
    display: -ms-flexbox;
    -ms-flex-wrap: wrap;
    -ms-flex-pack: justify;
    /* Modern browsers */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* IE11 specific card styling */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .product-grid {
        display: -ms-flexbox;
        -ms-flex-wrap: wrap;
        -ms-flex-pack: justify;
    }
    .card {
        -ms-flex: 0 1 calc(33.333% - 1.5rem);
        margin-bottom: 2rem;
    }
}

.card {
    background: white;
    -webkit-border-radius: 15px;
    -moz-border-radius: 15px;
    border-radius: 15px;
    -webkit-box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-box-direction: normal;
    -webkit-box-orient: vertical;
    -webkit-flex-direction: column;
    -moz-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    gap: 1rem;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    border: 1px solid #1565c0;
}

.card:hover {
    -webkit-transform: translateY(-5px);
    -moz-transform: translateY(-5px);
    -ms-transform: translateY(-5px);
    -o-transform: translateY(-5px);
    transform: translateY(-5px);
    -webkit-box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    -moz-box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border-color: #f5d14e;
}

.card img {
    max-height: 200px;
    width: 100%;
    object-fit: contain;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    cursor: pointer;
    -webkit-transition: -webkit-transform 0.3s ease;
    -moz-transition: -moz-transform 0.3s ease;
    -o-transition: -o-transform 0.3s ease;
    transition: transform 0.3s ease;
}

.card img:hover {
    -webkit-transform: scale(1.05);
    -moz-transform: scale(1.05);
    -ms-transform: scale(1.05);
    -o-transform: scale(1.05);
    transform: scale(1.05);
}

.card h3 {
    font-size: 1.2rem;
    color: #333;
    margin: 0;
}

.card h3 a {
    text-decoration: none;
    color: inherit;
}

.card small {
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
}

.card .price {
    color: #667eea;
    font-weight: 700;
    font-size: 1.1rem;
}

.card form {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Buttons */
button, input[type="submit"], .button {
    background: #667eea; /* Fallback for older browsers */
    background: -webkit-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: -moz-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: -o-linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    -webkit-border-radius: 25px;
    -moz-border-radius: 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    -webkit-box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    -moz-box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

button:hover, input[type="submit"]:hover, .button:hover {
    -webkit-transform: translateY(-2px);
    -moz-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    -o-transform: translateY(-2px);
    transform: translateY(-2px);
    -webkit-box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    -moz-box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.button-secondary {
    background: #f8f9fa;
    color: #667eea;
    border: 2px solid #667eea;
}

.button-secondary:hover {
    background: #667eea;
    color: white;
}

/* Form Styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #1565c0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #f5d14e;
    -webkit-box-shadow: 0 0 0 3px rgba(245, 209, 78, 0.3);
    -moz-box-shadow: 0 0 0 3px rgba(245, 209, 78, 0.3);
    box-shadow: 0 0 0 3px rgba(245, 209, 78, 0.3);
}

.checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-weight: normal;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.checkbox-group span {
    flex: 1;
}

.quantity {
    width: 80px !important;
    text-align: center;
}

/* Tabellen */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    overflow: hidden;
    -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

table thead {
    background: #1565c0; /* Fallback for older browsers */
    background: -webkit-linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    background: -moz-linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    background: -o-linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    color: white;
}

table th, table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #1565c0;
}

table tbody tr:hover {
    background-color: #faf5e6;
}

/* Checkout & Warenkorb */
.progress-bar {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin: 2rem 0;
}

.progress {
    height: 10px;
    background-color: #667eea;
    width: 0;
    -webkit-transition: width 0.5s ease-in-out;
    -moz-transition: width 0.5s ease-in-out;
    -o-transition: width 0.5s ease-in-out;
    transition: width 0.5s ease-in-out;
}

.checkout-container {
    /* IE11 Fallback */
    display: block;
    /* Modern browsers */
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 2rem;
    background-color: #fef9e7; /* Stellt sicher, dass die Kasse denselben Hintergrund hat */
}

/* IE11 specific checkout styling */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .checkout-container {
        display: block;
    }
    .checkout-container > * {
        margin-bottom: 2rem;
    }
}

.address-form {
    margin-top: 2rem;
}

.grid-2 {
    /* IE11 Fallback */
    display: block;
    /* Modern browsers */
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* IE11 specific grid-2 styling */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .grid-2 {
        display: -ms-flexbox;
        -ms-flex-wrap: wrap;
    }
    .grid-2 > * {
        -ms-flex: 0 1 calc(50% - 0.5rem);
        margin-right: 1rem;
        margin-bottom: 1rem;
    }
    .grid-2 > *:nth-child(2n) {
        margin-right: 0;
    }
}

.grid-3 {
    /* IE11 Fallback */
    display: block;
    /* Modern browsers */
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

/* IE11 specific grid-3 styling */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .grid-3 {
        display: -ms-flexbox;
        -ms-flex-wrap: wrap;
    }
    .grid-3 > * {
        -ms-flex: 0 1 calc(33.333% - 0.75rem);
        margin-right: 1rem;
        margin-bottom: 1rem;
    }
    .grid-3 > *:nth-child(3n) {
        margin-right: 0;
    }
}

.product-title {
    color: #333; /* Dunkler, lesbarer Text */
    margin-bottom: 0.5rem;
}

.section-title {
    color: #4a5568; /* Etwas helleres Dunkelgrau */
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.product-subtitle {
    font-style: italic;
    font-weight: 400;
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.price-box {
    background: #fff9c4;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.price-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1565c0;
    margin: 0;
}

.price-info {
    color: #666;
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
}

.product-specs {
    background: white;
    border: 2px solid #1565c0;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.product-specs-title {
    margin-top: 0;
    color: #333;
}

.product-specs-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-specs-list li {
    margin-bottom: 0.5rem;
}

.add-to-cart-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
}

.quantity-label {
    font-weight: 600;
}

.quantity-input {
    width: 60px; /* Feste Breite für das Mengenfeld */
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    text-align: center;
}

.add-to-cart-button {
    flex-grow: 1;
    font-size: 1.1rem;
    padding: 1rem;
}

.availability-box {
    background: #f0fff4;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #38a169;
}

.availability-box p {
    margin: 0;
    color: #38a169;
    font-weight: 600;
}

.product-section {
    margin: 3rem 0;
}

.related-products-section {
    margin-top: 4rem;
}

.product-section-content {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 2rem;
    line-height: 1.8;
}

.pdf-container {
    padding: 1rem;
    border: 1px solid #e2e8f0;
}

.pdf-embed {
    width: 100%;
    height: 500px;
    border-radius: 8px;
}

.related-product-card {
    text-align: center;
}

.related-product-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.related-product-title {
    margin: 0.5rem 0;
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

.related-product-price {
    color: #1565c0;
    font-weight: 600;
    margin: 0;
}

/* Card title on index.php - High specificity to override defaults */
.product-grid .card .card-title a {
    color: #333 !important; /* Dunkle, lesbare Farbe, !important zur Sicherheit */
    font-weight: 700;
}
.product-grid .card .card-title a:hover {
    color: #1565c0 !important;
}

/* Card subtitle on index.php */
.card-subtitle {
    color: #666;
    font-size: 0.9rem;
}

.detail {
    background: white;
    border-radius: 15px;
}

.detail img {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.related {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.related a {
    text-decoration: none;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    display: block;
    transition: all 0.2s ease-in-out;
}

.related a:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.related img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    margin-bottom: 1rem;
    border-radius: 5px;
}

/* Footer */
.footer {
    background: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    border-top: 1px solid #e2e8f0;
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    margin: 0 1rem;
    color: #1565c0;
    text-decoration: none;
    font-weight: 600;
}

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

.badges {
    margin: 1rem 0;
}

.badges img {
    height: 40px;
    margin: 0 0.5rem;
}

/* Hilfsklassen */
.error {
    background: #fbe9e7;
    color: #c62828;
    padding: 1rem;
    border: 1px solid #ffccbc;
    border-radius: 5px;
    margin: 1rem 0;
}

.success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 1rem;
    border: 1px solid #c8e6c9;
    border-radius: 5px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .main-content {
    animation: fadeIn 0.5s ease-out;
}

/* Legal Pages */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
}

.legal-content h1, .legal-content h2, .legal-content h3 {
    color: #1565c0; /* Ein kräftiges Blau */
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.legal-content h1 {
    font-size: 2.5rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

.legal-content h2 {
    font-size: 2rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

.legal-content h3 {
    font-size: 1.5rem;
    color: #1976d2; /* Ein etwas helleres Blau */
}

.legal-content p, .legal-content ul {
    margin-bottom: 1rem;
}

.legal-content ul {
    list-style-position: inside;
    padding-left: 1rem;
}

.legal-content a {
    color: #1976d2;
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.cart-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.cart-actions-right {
    display: flex;
    gap: 0.5rem;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
    max-width: 360px;
}

.cart-container {
    /* IE11 Fallback */
    display: block;
    /* Modern browsers */
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* IE11 specific cart container styling */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .cart-container {
        display: block;
    }
    .cart-container > * {
        margin-bottom: 2rem;
    }
}

.cart-summary {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    position: sticky;
    top: 100px; /* Anpassen, je nach Header-Höhe */
}

.cart-summary h3 {
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    color: #333;
}

.cart-summary-mobile {
    display: none;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.summary-total {
    font-weight: 700;
    font-size: 1.3rem;
    border-top: 2px solid #ddd;
    padding-top: 1rem;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 992px) {
    .checkout-page {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 992px) {
    .checkout-page-container {
        grid-template-columns: minmax(0, 750px) auto;
    }
}

@media (max-width: 768px) {
    .checkout-container {
        grid-template-columns: 1fr;
    }
    .cart-container {
        grid-template-columns: 1fr;
    }
    .header-content {
        flex-direction: column;
        gap: 0.5rem;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    .cart-summary {
        display: none;
    }
    .cart-summary-mobile {
        display: block;
    }
    .cart-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    .cart-actions-right {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    .cart-actions-right > *, .cart-actions > a {
        width: 100%;
        text-align: center;
    }
}

.checkout-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.card-subtitle {
    color: #666;
    margin-bottom: 1.5rem;
    margin-top: -0.5rem;
    display: block;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-button {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #1565c0;
    background: #f8f9fa;
    color: #1565c0;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-button.active {
    background: #1565c0;
    color: white;
}

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

.form-section-title {
    font-size: 1.1rem;
    color: #333;
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.cart-summary-checkout {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    height: fit-content;
}

.checkout-page-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: flex-start;
    margin-top: 2rem;
}

.checkout-forms {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.checkout-card-full {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

/* Progressive Enhancement for Modern Features */

/* Feature detection for CSS Grid support */
@supports (display: grid) {
    .product-grid {
        display: grid;
    }
    .checkout-container,
    .cart-container {
        display: grid;
    }
    .grid-2,
    .grid-3 {
        display: grid;
    }
}

/* Feature detection for backdrop-filter support */
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
    header {
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(10px)) and not (-webkit-backdrop-filter: blur(10px)) {
    header {
        background: rgba(255, 255, 255, 0.98); /* More opaque background */
    }
}

/* Feature detection for object-fit support */
@supports not (object-fit: contain) {
    .card img {
        height: 200px;
        width: auto;
        max-width: 100%;
    }
}