/
Evil331
/
Apteka
Обзор
Документация
Войти
/
Evil331
/
Apteka
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
style.css
1 315 строк
27 KB
Evil6766
Add files via upload
31 май 2025, 17:06
Не верифицирован
31 май 2025, 17:06
667fe25
Код
Авторство
О чём код?
* { margin: 0; padding: 0; box-sizing: border-box; font-family: Arial, sans-serif; } .logo a { color: white; text-decoration: none; margin-left: 10px; } html, body { height: 100%; margin: 0; } body { display: flex; flex-direction: column; min-height: 100vh; /* Страница занимает всю высоту viewport */ background-color: #f5f5f5; color: #333; } main { flex: 1; /* Основной контент растягивается, чтобы футер был внизу */ padding-bottom: 30px; /* Отступ снизу, чтобы футер не перекрывал контент */ } /* Header Styles */ header { background-color: #4CAF50; color: white; padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); position: sticky; top: 0; z-index: 100; } .logo { font-size: 1.5em; font-weight: bold; } /* Стили для навигационного меню */ .nav-menu { background: linear-gradient(to right, #459848, #6a9537); padding: 12px 0; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15); position: sticky; top: 60px; z-index: 100; } .nav-menu ul { display: flex; list-style: none; justify-content: center; flex-wrap: wrap; gap: 25px; margin: 0; padding: 0; } .nav-menu li { display: inline-block; position: relative; } .nav-menu a { color: #ffffff; text-decoration: none; font-weight: 500; font-size: 1em; padding: 10px 20px; border-radius: 30px; transition: all 0.3s ease; display: inline-block; line-height: 1.5; } .nav-menu a:hover { color: #ffd700; background-color: rgba(255, 255, 255, 0.1); transform: translateY(-2px); } .nav-menu a::after { content: ''; position: absolute; width: 0; height: 2px; bottom: 8px; left: 50%; background-color: #ffd700; transition: width 0.4s ease; transform: translateX(-50%); } .nav-menu a:hover::after { width: 70%; } .nav-menu a.active { color: #ffd700; background-color: rgba(255, 255, 255, 0.1); position: relative; } .nav-menu a.active::after { width: 70%; } /* Мобильная адаптация для навигационного меню */ @media (max-width: 600px) { .nav-menu { padding: 8px 0; /* Уменьшаем отступы */ } .nav-menu ul { justify-content: space-around; /* Равномерное распределение */ gap: 10px; /* Уменьшаем расстояние */ } .nav-menu li { margin: 0 5px; /* Минимизируем отступы */ } .nav-menu a { font-size: 0.85em; /* Уменьшаем размер шрифта */ padding: 8px 14px; /* Уменьшаем область клика */ } } .search-bar { display: flex; align-items: center; flex: 1; margin: 0 15px; position: relative; } .search-bar input { flex: 1; padding: 10px 40px 10px 15px; /* Отступ справа для кнопки */ border: 1px solid #ccc; border-radius: 20px; outline: none; font-size: 1em; } .search-bar input:focus { border-color: #4CAF50; /* Цвет при фокусе */ box-shadow: 0 0 5px rgba(76, 175, 80, 0.3); } .search-bar button { position: absolute; right: 5px; background: none; border: none; cursor: pointer; padding: 5px; display: flex; align-items: center; justify-content: center; transition: background 0.3s ease; border-radius: 50%; width: 30px; height: 30px; } .search-bar button:hover { background: rgba(76, 175, 80, 0.2); /* Лёгкий зелёный фон при наведении */ } .search-bar button img { width: 20px; height: 20px; } /* Стили для секции формы регистрации */ .form-section { width: 500px; height: 150%; margin: 30px auto; padding: 20px; background-color: white; border-radius: 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); text-align: center; } .form-section h2 { font-size: 1.5em; color: #4CAF50; margin-bottom: 20px; text-align: center; } .form-section form { display: flex; flex-direction: column; gap: 15px; } .form-section div { display: flex; flex-direction: column; text-align: left; } .form-section label { font-size: 0.9em; margin-bottom: 5px; color: #333; font-weight: bold; } .form-section input, .form-section textarea { padding: 10px; border: 1px solid #ccc; border-radius: 5px; font-size: 0.9em; outline: none; transition: border-color 0.3s ease, box-shadow 0.3s ease; } .form-section input:focus, .form-section textarea:focus { border-color: #4CAF50; box-shadow: 0 0 5px rgba(76, 175, 80, 0.3); } .form-section textarea { min-height: 80px; resize: vertical; } .form-section button { background-color: #4CAF50; color: white; border: none; padding: 12px 20px; font-size: 1em; border-radius: 5px; cursor: pointer; transition: background-color 0.3s ease, transform 0.3s ease; margin-top: 10px; } .form-section button:hover { background-color: #45a049; transform: translateY(-2px); } .form-section p { margin-top: 15px; font-size: 0.9em; color: #333; } .form-section a { color: #4CAF50; text-decoration: none; transition: color 0.3s ease, transform 0.3s ease; position: relative; } .form-section a:hover { color: #45a049; transform: translateX(2px); } .form-section a::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 1px; background-color: #45a049; transition: width 0.3s ease; } .form-section a:hover::after { width: 100%; } /* Стили для сообщений об ошибках */ .error-messages { background-color: #ffebee; color: #c62828; padding: 10px; border-radius: 5px; margin-bottom: 15px; text-align: left; } .error-messages p { margin: 5px 0; font-size: 0.85em; } /* Адаптивность для формы регистрации */ @media (max-width: 480px) { .form-section { margin: 20px 10px; padding: 15px; } .form-section h2 { font-size: 1.3em; } .form-section input, .form-section textarea { padding: 8px; font-size: 0.85em; } .form-section button { padding: 10px 15px; font-size: 0.9em; } } /* Стили для секции с деталями товара */ .product-details { max-width: 800px; margin: 40px auto; padding: 20px; background-color: #fff; border-radius: 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); text-align: center; } .product-details h1 { font-size: 2.2em; color: #333; margin-bottom: 20px; } .product-details img { max-width: 100%; height: auto; max-height: 400px; object-fit: contain; margin-bottom: 20px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); } .product-details .description { font-size: 1.1em; color: #555; line-height: 1.6; margin-bottom: 20px; text-align: left; } .product-details .price { font-size: 1.5em; color: #4CAF50; font-weight: bold; margin-bottom: 20px; } .product-details button { background-color: #4CAF50; color: white; border: none; padding: 12px 24px; font-size: 1.1em; cursor: pointer; border-radius: 5px; transition: background-color 0.3s ease, transform 0.3s ease; margin-bottom: 20px; /* Отступ снизу для разделения с ссылкой */ margin-left: 15px; /* Отступ слева */ margin-right: 15px; /* Отступ справа */ } .product-details button:hover { background-color: #45a049; transform: translateY(-2px); } .product-details .back-link { display: inline-block; text-decoration: none; color: #4CAF50; font-size: 1.1em; transition: color 0.3s ease, transform 0.3s ease; position: relative; margin-top: 20px; /* Отступ сверху для разделения с кнопкой */ } .product-details .back-link:hover { color: #45a049; transform: translateX(-3px); } .product-details .back-link::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px; background-color: #45a049; transition: width 0.3s ease; } .product-details .back-link:hover::after { width: 100%; } /* Мобильная адаптация */ @media (max-width: 768px) { .product-details { margin: 20px; padding: 15px; } .product-details h1 { font-size: 1.8em; } .product-details img { max-height: 300px; } .product-details .description { font-size: 1em; } .product-details .price { font-size: 1.3em; } .product-details button { padding: 10px 20px; font-size: 1em; margin-bottom: 15px; /* Уменьшен отступ для мобильных */ } .product-details .back-link { margin-top: 15px; /* Уменьшен отступ для мобильных */ } } @media (max-width: 480px) { .product-details { margin: 10px; padding: 10px; } .product-details h1 { font-size: 1.5em; } .product-details img { max-height: 250px; } .product-details button { margin-bottom: 10px; /* Ещё меньше для очень маленьких экранов */ } .product-details .back-link { margin-top: 10px; /* Ещё меньше для очень маленьких экранов */ } } .category a { text-decoration: none; color: inherit; display: block; width: 100%; height: 100%; transition: transform 0.2s, color 0.2s; } .category a:hover { transform: scale(1.05); color: #4CAF50; /* Зелёный цвет при наведении */ } .category a:hover p { font-weight: bold; } .product-link { text-decoration: none; color: #333; display: block; /* Сохраняем блочный тип для корректной работы */ transition: transform 0.3s ease, color 0.3s ease, box-shadow 0.3s ease; position: relative; border-radius: 8px; /* Скругление углов для соответствия карточке */ overflow: hidden; /* Для эффектов с псевдоэлементами */ } .product-link:hover { transform: translateY(-5px); /* Лёгкий подъём при наведении */ color: #4CAF50; /* Зелёный цвет текста при наведении */ box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3); /* Тень для эффекта глубины */ } .product-link::after { content: ''; position: absolute; bottom: 10px; /* Отступ от низа карточки */ left: 50%; width: 0; height: 2px; background-color: #4CAF50; /* Зелёная линия под текстом */ transition: width 0.3s ease; transform: translateX(-50%); } .product-link:hover::after { width: 80%; /* Линия расширяется при наведении */ } .product-link:hover h3 { font-weight: bold; /* Усиление заголовка при наведении */ } /* Мобильная адаптация */ @media (max-width: 350px) { .product-link { transition: transform 0.2s ease, color 0.2s ease; /* Ускоряем анимацию на мобильных */ } .product-link:hover { transform: translateY(-3px); /* Уменьшаем подъём для экономии пространства */ box-shadow: 0 3px 8px rgba(76, 175, 80, 0.2); /* Менее интенсивная тень */ } } .cart a { color: white; text-decoration: none; font-size: 1em; transition: color 0.3s; } .cart a:hover { color: #ffeb3b; } .banner { background: linear-gradient(135deg, #4CAF50, #8BC34A); color: white; text-align: center; padding: 20px; margin-bottom: 10px; } .banner h1 { font-size: 1.5em; margin-bottom: 10px; } .banner button { background-color: #ffeb3b; color: #333; border: none; padding: 10px 20px; font-size: 1em; border-radius: 5px; cursor: pointer; transition: background-color 0.3s; } .banner button:hover { background-color: #fbc02d; } /* Categories Styles */ .categories { padding: 10px; margin-bottom: 10px; } .category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Адаптивная сетка */ gap: 20px; /* Отступы между элементами */ padding: 20px; justify-items: center; /* Центрируем элементы */ } .category { text-align: center; min-width: 150px; /* Минимальная ширина для больших экранов */ max-width: 200px; /* Ограничиваем максимальную ширину */ position: relative; z-index: 10; /* Выше футера при анимации */ } .category img { width: 100%; /* Адаптивная ширина изображения */ max-width: 150px; /* Ограничение по максимальной ширине */ height: 100px; border-radius: 8px; transition: transform 0.3s ease; object-fit: cover; /* Корректное отображение изображения */ } .category img:hover { transform: scale(1.05); /* Эффект увеличения при наведении */ } .category h3 { margin-top: 10px; font-size: 1.1em; color: #333; } .category p { font-size: 0.9em; color: #333; } /* Для мобильных экранов уменьшаем ширину категорий */ @media (max-width: 350px) { .category { min-width: 100px; /* Уменьшаем ширину для узких экранов */ max-width: 120px; } .category img { max-width: 100px; /* Уменьшаем размер изображения */ height: 80px; } .category h3 { font-size: 0.9em; /* Уменьшаем шрифт */ } } /* Products Styles */ .popular-products, .catalog-products { padding: 10px; } .popular-products h2, .catalog-products h2 { font-size: 1.2em; margin-bottom: 10px; color: #4CAF50; } .product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; } .product-card { background-color: white; border-radius: 10px; padding: 10px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); text-align: center; transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; } .product-card:hover { transform: translateY(-3px); box-shadow: 0 5px 10px rgba(0, 0, 0.2); } .product-card img { width: 100px; height: 100px; object-fit: cover; margin-bottom: 5px; border-radius: 5px; } .product-card h3 { font-size: 1em; margin-bottom: 5px; color: #333; } .product-card p { font-size: 0.9em; color: #777; margin-bottom: 5px; } .product-card .price { font-size: 1em; font-weight: bold; color: #4CAF50; margin-bottom: 5px; } .product-card button { background-color: #4CAF50; color: white; border: none; padding: 8px 15px; font-size: 0.9em; border-radius: 5px; cursor: pointer; transition: background-color 0.3s; } .product-card button:hover { background-color: #388E3C; } /* Filters Styles for Catalog */ .filters { padding: 10px; background-color: white; border-radius: 10px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); margin-bottom: 10px; } .filters h3 { font-size: 1.1em; margin-bottom: 10px; color: #4CAF50; } .filters div { margin-bottom: 5px; } .filters input[type="checkbox"] { margin-right: 5px; } .filters button { background-color: #4CAF50; color: white; border: none; padding: 8px 15px; font-size: 0.9em; border-radius: 5px; cursor: pointer; } .filters button:hover { background-color: #388E3C; } /* Cart Styles */ .cart-items { padding: 10px; } .cart-item { background-color: white; border-radius: 10px; padding: 10px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); } .cart-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 5px; margin-right: 10px; } .cart-item-details { flex: 1; } .cart-item-details h3 { font-size: 1em; margin-bottom: 5px; } .cart-item-details p { font-size: 0.9em; color: #777; } .cart-total { font-size: 1.2em; font-weight: bold; text-align: right; padding: 10px; color: #4CAF50; } .checkout-button { display: block; width: 90%; margin: 10px auto; background-color: #4CAF50; color: white; border: none; padding: 12px; font-size: 1em; border-radius: 5px; cursor: pointer; text-align: center; transition: background-color 0.3s; } .checkout-button:hover { background-color: #388E3C; } /* Checkout Form Styles */ .checkout-form { padding: 10px; background-color: white; border-radius: 10px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); margin-bottom: 10px; } .checkout-form h3 { font-size: 1.2em; margin-bottom: 10px; color: #4CAF50; } .checkout-form label { display: block; margin: 5px 0; font-size: 0.9em; } .checkout-form input, .checkout-form select { width: 100%; padding: 8px; margin-bottom: 10px; border: 1px solid #ccc; border-radius: 5px; font-size: 0.9em; outline: none; } .payment-methods { margin: 15px 0; } .payment-methods div { margin-bottom: 5px; } /* Content Styles for Static Pages */ .content { padding: 15px; background-color: white; border-radius: 10px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); margin: 10px 0; } .content h1 { font-size: 1.5em; color: #4CAF50; margin-bottom: 10px; } .content p { font-size: 0.9em; line-height: 1.5; margin-bottom: 10px; } .content ul { padding-left: 20px; font-size: 0.9em; } .content li { margin-bottom: 5px; } /* Footer Styles */ .footer { background-color: #333; color: white; text-align: center; padding: 15px; font-size: 0.9em; margin-top: auto; /* Футер прижимается к низу благодаря flexbox */ position: relative; z-index: 1; width: 100%; } .footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; max-width: 1200px; margin: 0 auto; padding: 0 20px; } .footer-links { display: flex; gap: 20px; } .footer-links a { color: white; text-decoration: none; transition: color 0.3s; } .footer-links a:hover { color: #4CAF50; } .footer-info p { margin: 5px 0; } /* Mobile Responsive Styles */ @media (max-width: 350px) { .banner h1 { font-size: 1.2em; } .product-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } header { flex-wrap: wrap; padding: 5px; } .search-bar { width: 100%; margin: 10px 0; } } @media (max-height: 600px) { .banner { padding: 15px; } .content { padding: 10px; } .categories, .popular-products { padding: 5px; /* Уменьшаем отступы для компактности */ } .category-grid { padding: 10px; /* Уменьшаем отступы */ gap: 10px; /* Уменьшаем расстояние между категориями */ } .category img { height: 80px; /* Уменьшаем высоту изображений */ } } /* Мобильная адаптация для навигационного меню */ @media (max-width: 600px) { .nav-menu { padding: 10px 0; /* Уменьшаем отступы */ } .nav-menu ul { justify-content: space-around; /* Равномерно распределяем элементы */ gap: 10px; /* Уменьшаем расстояние */ } .nav-menu li { margin: 5px 5px; /* Уменьшаем отступы */ } .nav-menu a { font-size: 0.9em; /* Уменьшаем размер шрифта */ padding: 8px 12px; /* Уменьшаем область клика */ } } /* Общие стили */ body { font-family: Arial, sans-serif; margin: 0; padding: 0; line-height: 1.6; color: #333; } .container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 0 20px; } header { background-color: #4CAF50; color: white; padding: 15px 0; } header .container { display: flex; justify-content: space-between; align-items: center; } header nav a { color: white; text-decoration: none; margin-left: 20px; } header nav a:hover { text-decoration: underline; } footer { background-color: #333; color: white; text-align: center; padding: 10px 0; margin-top: 50px; } h2 { margin-top: 30px; color: #4CAF50; text-align: center; } /* Стили для корзины */ .cart-container { display: flex; justify-content: space-between; margin-top: 30px; flex-wrap: wrap; } .cart-items { flex: 3; margin-right: 20px; } .cart-item { display: flex; align-items: center; padding: 15px; border-bottom: 1px solid #ddd; background-color: #f9f9f9; margin-bottom: 10px; border-radius: 5px; } .cart-item-image { width: 80px; height: 80px; object-fit: cover; margin-right: 20px; border-radius: 5px; } .cart-item-details { flex: 2; } .cart-item-details h3 { margin: 0; font-size: 18px; color: #333; } .quantity-control { display: flex; align-items: center; margin-top: 10px; } .quantity-control button { background-color: #4CAF50; color: white; border: none; padding: 5px 10px; cursor: pointer; border-radius: 3px; font-size: 16px; } .quantity-input { width: 50px; text-align: center; margin: 0 10px; padding: 5px; border: 1px solid #ddd; border-radius: 3px; } .cart-item-total { flex: 1; text-align: center; font-weight: bold; color: #4CAF50; } .remove-item { background-color: #ff4444; color: white; border: none; padding: 8px 15px; cursor: pointer; border-radius: 3px; } .remove-item:hover { background-color: #cc0000; } .cart-summary { flex: 1; background-color: #f1f1f1; padding: 20px; border-radius: 5px; height: fit-content; } .cart-summary h3 { margin-top: 0; color: #4CAF50; } .cart-summary p { font-size: 18px; margin: 15px 0; } #cart-total { font-weight: bold; color: #4CAF50; } .checkout-button { width: 100%; background-color: #4CAF50; color: white; border: none; padding: 15px; font-size: 16px; cursor: pointer; border-radius: 5px; } .checkout-button:hover { background-color: #45a049; } .empty-cart { text-align: center; font-size: 18px; color: #666; margin-top: 30px; } .empty-cart a { color: #4CAF50; text-decoration: none; } .empty-cart a:hover { text-decoration: underline; } /* Адаптивность */ @media (max-width: 768px) { .cart-container { flex-direction: column; } .cart-items { margin-right: 0; margin-bottom: 20px; } .cart-item { flex-direction: column; text-align: center; } .cart-item-image { margin-right: 0; margin-bottom: 10px; } .cart-item-details { margin-bottom: 10px; } .cart-item-total { margin-bottom: 10px; } } /* Стили для страницы подтверждения заказа */ .order-confirmation { padding: 20px; background-color: white; border-radius: 10px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); margin: 20px auto; max-width: 800px; } .order-confirmation h1 { font-size: 1.5em; color: #4CAF50; margin-bottom: 15px; text-align: center; } .order-confirmation h2 { font-size: 1.2em; color: #4CAF50; margin: 20px 0 10px; text-align: left; } .order-confirmation p { font-size: 0.9em; line-height: 1.5; margin-bottom: 10px; color: #333; } .order-confirmation table { width: 100%; border-collapse: collapse; margin-top: 10px; margin-bottom: 20px; background-color: #f9f9f9; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); } .order-confirmation th, .order-confirmation td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; font-size: 0.9em; color: #333; } .order-confirmation th { background-color: #4CAF50; color: white; font-weight: bold; } .order-confirmation tr:hover { background-color: #f1f1f1; } .order-confirmation a { display: block; width: fit-content; margin: 20px auto; background-color: #4CAF50; color: white; text-decoration: none; padding: 10px 20px; border-radius: 5px; font-size: 0.9em; transition: background-color 0.3s; text-align: center; } .order-confirmation a:hover { background-color: #388E3C; } /* Адаптивность для страницы подтверждения заказа */ @media (max-width: 600px) { .order-confirmation { padding: 10px; margin: 10px; } .order-confirmation h1 { font-size: 1.3em; } .order-confirmation h2 { font-size: 1.1em; } .order-confirmation th, .order-confirmation td { padding: 8px; font-size: 0.85em; } }