/* Base Styles */
:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --text-color: #333;
    --light-bg: #f9f7f3;
    --dark-bg: #2d3436;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Optimize paint performance */
.recipe-card {
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

/* Reduce repaints */
.recipe-image {
    contain: content;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

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

.logo {
    font-size: clamp(20px, 4vw, 26px);
    font-weight: bold;
    cursor: pointer;
}

.logo span {
    color: var(--primary-color);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

nav ul li a {
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: clamp(14px, 2vw, 16px);
}

/* Hero Section */
.hero {
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('assets/images/Kuchen.webp');
    background-size: cover;
    background-position: center;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 20px;
}

.hero-content {
    max-width: 800px;
    width: 90%;
}

.hero h1 {
    font-size: clamp(24px, 5vw, 48px);
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero p {
    font-size: clamp(16px, 3vw, 20px);
    margin-bottom: 30px;
}

/* Recipe Cards */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin: 0 auto;
}

.recipe-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    height: 100%;
}

.recipe-image {
    height: 200px;
    background-size: cover;
    background-position: center;
}

.recipe-content {
    padding: 20px;
}

.recipe-title {
    font-size: clamp(18px, 3vw, 24px);
    margin-bottom: 10px;
}

/* Product Review Section */
.product-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 40px;
    padding: 20px;
}

.product-image {
    flex: 1;
    text-align: center;
}

.product-image img {
    max-width: 100%;
    height: auto;
}

.product-content {
    flex: 1;
}

.product-title {
    font-size: clamp(20px, 4vw, 28px);
    margin-bottom: 15px;
}

/* Footer */
footer {
    background-color: white;
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: black;
    color: white;
    border-radius: 30px;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: clamp(14px, 2vw, 16px);
}

/* Media Queries */
@media (min-width: 768px) {
    .product-container {
        flex-direction: row;
        align-items: center;
    }

    .product-image {
        flex: 0 0 45%;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero {
        min-height: 40vh;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 0 10px;
    }

    .recipe-card {
        margin: 0 auto;
        width: 100%;
    }

    .footer-content {
        text-align: center;
    }

    .footer-content-col {
        align-items: center;
    }
}

/* Recipe 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.8);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    width: 80%;
    max-width: 900px;
    border-radius: 10px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #777;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: var(--primary-color);
}

.recipe-modal-header {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.recipe-modal-title {
    font-size: 32px;
    margin-bottom: 10px;
}

.recipe-modal-meta {
    display: flex;
    margin-bottom: 15px;
    color: #777;
    font-size: 14px;
}

.recipe-modal-meta div {
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.recipe-modal-image {
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.recipe-section {
    margin-bottom: 30px;
}

.recipe-section h3 {
    margin-bottom: 15px;
    font-size: 22px;
}

.ingredients-list {
    list-style: none;
}

.ingredients-list li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}

.instructions-list {
    list-style: none;
    counter-reset: instruction-counter;
}

.instructions-list li {
    margin-bottom: 15px;
    padding-left: 40px;
    position: relative;
}

.instructions-list li:before {
    counter-increment: instruction-counter;
    content: counter(instruction-counter);
    background-color: var(--primary-color);
    color: white;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 0;
}

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

.nutrition-item {
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.nutrition-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
}

/* Featured Recipe */
.featured-recipe {
    margin-bottom: 60px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 32px;
    position: relative;
}

.section-title:after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 15px auto;
}


.recipe-meta {
    display: flex;
    margin-bottom: 15px;
    color: #777;
    font-size: 14px;
}

.recipe-meta div {
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.recipe-meta i {
    margin-right: 5px;
}

.recipe-excerpt {
    margin-bottom: 20px;
}

/* Recent Posts */
.recent-posts {
    margin-bottom: 60px;
}

.category-filter {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.filter-btn {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn.active, .filter-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Product Review */
.product-review {
    background-color: white;
    padding: 60px 0;
    margin-bottom: 60px;
    margin-top: 30px;
}


.product-description {
    margin-bottom: 20px;
}

.product-features {
    margin-bottom: 20px;
}

.product-features li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.product-features li:before {
    content: '✓';
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

.product-price {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
}

.btn-buy {
    background-color: #ff9900;
    font-size: 18px;
}

.btn-buy:hover {
    background-color: #e68a00;
}


/* Footer */
footer {
  background-color: white;
  padding: 40px 0 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-content-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}


/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #333;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    display: none;
    z-index: 1000;
    animation: fadeIn 0.3s, fadeOut 0.3s 2.5s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Print Button */
.print-recipe {
    display: inline-flex;
    align-items: center;
    margin-left: 20px;
    color: #555;
    font-size: 14px;
    cursor: pointer;
}

.print-recipe:hover {
    color: var(--primary-color);
}

/* Hidden recipes initially */
.hidden-recipe {
    display: none;
}

nav ul li {
    margin-left: 0;
}

nav ul li:first-child {
    margin-left: 0;
}

nav ul li a:hover {
    color: var(--primary-color);
}

nav ul li a.active {
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 6px;
    color: var(--primary-color);
}

.btn:hover {
    background-color: #ff5252;
    transform: translateY(-3px);
}

.footer-widget h3 {
    margin-bottom: 20px;
    font-size: 20px;
}

.footer-widget ul {
    list-style: none;
}

.footer-widget ul li {
    margin-bottom: 10px;
}

.footer-widget ul li a {
    color: #ddd;
    transition: all 0.3s ease;
    cursor: pointer;
}

.footer-widget ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}