/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f9f5f0;
    color: #3e2723;
    line-height: 1.6;
}

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

/* Шапка */
header {
    background-color: #5d4037;
    color: #fff;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

/* Нажатие на логоитп */
.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: transform 0.3s, opacity 0.3s;
    cursor: pointer;
}

.logo-link:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.logo-link:active {
    transform: scale(0.95);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}


.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
    line-height: 1;
    color: white !important;
}

.logo-sub {
    font-size: 12px;
    color: #d7ccc8 !important;
    letter-spacing: 2px;
}

.logo-link,
.logo-link:visited,
.logo-link:hover,
.logo-link:active {
    color: inherit;
    text-decoration: none;
}

/* Иконки Font Awesome */
.user-actions button i {
    font-size: 16px;
    width: 16px;
    height: 16px;
    display: inline-block;
}

.cart-icon i {
    font-size: 18px;
}

.user-actions .fas {
    margin-right: 5px;
}

.cart-icon .fas {
    margin-right: 5px;
}

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

nav ul li {
    margin-left: 25px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
    margin-right: 30px;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #d7ccc8;
    transition: width 0.3s;
}

nav ul li a:hover {
    color: #d7ccc8;
}

nav ul li a:hover::after {
    width: 100%;
}

.user-actions {
    display: flex;
    align-items: center;
}

.user-actions button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    margin-left: 15px;
    font-size: 16px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-actions button:hover {
    color: #d7ccc8;
}

.cart-icon {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff9800;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Основная секция */
.hero {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://www.rating-franshiz.ru/wp-content/uploads/2023/02/1-14-1024x512.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 100px 0;
    text-align: center;
    margin-bottom: 50px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    animation: fadeInDown 1s;
}

.hero p {
    font-size: 20px;
    max-width: 700px;
    margin: 0 auto 30px;
    animation: fadeInUp 1s;
}

.btn {
    display: inline-block;
    background-color: #5d4037;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    text-decoration: none;
}

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

/* Каталог */
.catalog {
    padding: 50px 0;
}

.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: #5d4037;
    margin: 10px auto;
}

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

.coffee-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.coffee-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.coffee-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.coffee-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(transparent, rgba(0,0,0,0.1));
}

.coffee-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.coffee-name {
    font-size: 20px;
    margin-bottom: 10px;
    color: #5d4037;
}

.coffee-description {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
    flex-grow: 1;
}

.coffee-price {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 15px;
    color: #5d4037;
}

.milk-options {
    margin-bottom: 15px;
}

.milk-options select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.add-to-cart {
    width: 100%;
    padding: 10px;
    background-color: #5d4037;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 500;
}

.add-to-cart:hover {
    background-color: #3e2723;
}

/* Каталог десертов */
.desserts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.dessert-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    opacity: 0;
    animation: fadeIn 0.5s forwards;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.dessert-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.dessert-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.dessert-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(transparent, rgba(0,0,0,0.1));
}

.dessert-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.dessert-name {
    font-size: 20px;
    margin-bottom: 10px;
    color: #5d4037;
}

.dessert-description {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
    flex-grow: 1;
}

.dessert-price {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 15px;
    color: #5d4037;
}

.dessert-weight {
    font-size: 14px;
    color: #888;
    margin-bottom: 15px;
}

.add-to-cart-dessert {
    width: 100%;
    padding: 10px;
    background-color: #5d4037;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 500;
}

.add-to-cart-dessert:hover {
    background-color: #3e2723;
}

/* Иконка над десертами*/
.vegetarian-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #4caf50;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 2;
}

.popular-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: #ff9800;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 2;
}

/* Модальное окно корзины */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.3s;
    position: relative;
}

.modal h2 {
    margin-bottom: 20px;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

.cart-modal {
    max-width: 500px;
}

.cart-items {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 500;
}

.cart-item-milk {
    font-size: 12px;
    color: #666;
}

.cart-item-price {
    font-weight: 500;
}

.cart-total {
    font-weight: bold;
    font-size: 18px;
    text-align: right;
    margin-bottom: 20px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* Оповещение о добавлении в корзину */
.cart-notification {
    position: fixed;
    top: 100px;
    right: 30px;
    background-color: #5a4128;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(175, 116, 76, 0.3);
    z-index: 1002;
    opacity: 0;
    transform: translateX(100px) scale(0.5);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cart-notification.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.cart-notification.hide {
    opacity: 0;
    transform: translateX(100px) scale(0.5);
}

.cart-notification.success {
    background-color: #5d4037;
}

.cart-notification.error {
    background-color: #f44336;
}

.cart-notification i {
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

/* Подвал */
footer {
    background-color: #5d4037;
    color: white;
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

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

.footer-section p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-links a {
    color: white;
    font-size: 20px;
    transition: color 0.3s;
}

.social-links a:hover {
    color: #d7ccc8;
}

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

/* Анимации */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        margin: 20px 0;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav ul li {
        margin: 5px 10px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero p {
        font-size: 18px;
    }
    
    .coffee-grid,
    .desserts-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .logo-container {
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .coffee-grid,
    .desserts-grid {
        grid-template-columns: 1fr;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .user-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .user-actions button {
        margin: 5px;
    }
}