/* style.css */
img {
    border: 0;
    padding: 0;
    margin: 0;
    vertical-align: top;
}
.border-frame {
    display: flex;
    flex-wrap: wrap;
}

.border-frame img {
    display: block;
    border: 0;
    margin: 0;
    padding: 0;
}

/* General styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

/* Navigation menu styles */
.sm a, .Und a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.Und a {
    font-weight: bold;
    color: #000;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.lang-switcher a {
    color: #000;
    padding: 3px;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    background-color: #E7E7E7;
}

.lang-switcher a:hover {
    text-decoration: underline;
}

/* Catalog and Home styles */
.catalog-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 20px;
}

.catalog-item {
    border: 1px solid #ddd;
    padding: 10px;
    width: 200px;
    text-align: center;
    background-color: #fff;
    border-radius: 5px;
}

.catalog-item img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    object-position: center;
    border-radius: 5px;
}

.home-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 2px;
    border: 2px solid #ddd;
    gap: 10px;
    text-align: center;
    background-color: #fff;
    border-radius: 5px;
}

.home-item img {
    width: 150px;
    height: 150px;
    border-radius: 15px;
}

/* Item page styles */
.item-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.item-images {
    flex: 1;
    min-width: 300px;
    text-align: center;
}

#main-image {
    width: 300px;
    height: 300px;
    object-fit: cover;
    margin-bottom: 10px;
    border-radius: 5px;
}

.thumbnails {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.thumbnails img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.thumbnails img:hover {
    border-color: #ff69b4;
}

.item-details {
    flex: 1;
    min-width: 300px;
}

.item-details p {
    margin: 10px 0;
}

/* Button styles */
button, .add-to-cart-button, .buy-now-button, .remove-button, .view-details-button, .translate-button {
    padding: 10px 20px;
    margin: 5px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.add-to-cart-button {
    background-color: #ff69b4; /* Pink */
    color: white;
}

.add-to-cart-button:hover {
    background-color: #ff1493;
}

.buy-now-button {
    background-color: #ffa500; /* Orange */
    color: white;
}

.buy-now-button:hover {
    background-color: #ff8c00;
}

.remove-button {
    background-color: #dc3545; /* Red */
    color: white;
}

.remove-button:hover {
    background-color: #c82333;
}

.view-details-button {
    display: inline-block;
    background-color: #007bff; /* Blue */
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
}

.view-details-button:hover {
    background-color: #0056b3;
}
.translate-button {
    display: inline-block;
    background-color: #98d3b2; /* Green */
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
}

.translate-button:hover {
    background-color: #0056b3;
}


/* Cart styles */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: #fff;
}

.cart-table th, .cart-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

.cart-table img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
}

/* Error and success styles */
.error {
    color: red;
    font-weight: bold;
}

.success {
    color: green;
    font-weight: bold;
}

.unavailable {
    color: red;
    font-weight: bold;
}

/* Admin and Account forms */
.admin-form {
    max-width: 800px;
    margin: 0px auto;
    padding: 0px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.admin-form label {
    display: block;
    margin: 10px 0 5px;
    font-weight: bold;
}
.textname {
    display: block;
font-size: larger;
    font-weight: bold;
}

.admin-form input, .admin-form select, .admin-form textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

.admin-form textarea {
    height: 100px;
    font-size: larger;
}

/* Orders table */
.orders-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: #fff;
}

.orders-table th, .orders-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.orders-table th {
    background-color: #f8f9fa;
}

.orders-table img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 5px;
}

.orders-table tbody tr {
    cursor: pointer;
}

.orders-table tbody tr:hover {
    background-color: #f1f1f1;
}
/* Add Items table */
.add-items-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: #fff;
}

.add-items-table th, .add-items-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.add-items-table th {
    background-color: #f8f9fa;
}

.add-items-table img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 5px;
}

.add-items-table tbody tr {
    cursor: pointer;
}

.add-items-table tbody tr:hover {
    background-color: #f1f1f1;
}

/* Items table container */
.items-table-container {
    max-height: 400px; /* Roughly 10 rows */
    overflow-y: auto;
    margin-bottom: 20px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    position: relative;
    border-radius: 5px;
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .catalog-item, .home-item {
        width: 100%;
    }

    .catalog-item img, .home-item img {
        width: 100% !important;
        height: auto !important;
    }

    .item-container {
        flex-direction: column;
        align-items: center;
    }

    #main-image {
        width: 100%;
        height: auto;
        max-width: 500px;
    }

    .thumbnails img {
        width: 250px;
        height: 250px;
    }

    .admin-form, .cart-table, .orders-table {
        width: 100%;
    }

    .items-table-container {
        max-height: 300px;
    }
}
/* Исправленные стили для контейнеров загрузки изображений */

.image-upload-container {
    position: relative;
    width: 250px;
    height: 250px; 
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.main-image-upload-container {
    position: relative;
    width: 250px;
    height: 250px; 
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex; /* Исправлено: было display-flex */
    justify-content: center; /* Исправлено: было normal */
    align-items: center; /* Исправлено: было stretch */
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.3s ease;
    margin: 0 auto; /* Добавлено для центрирования контейнера */
}

.image-upload-container:hover,
.main-image-upload-container:hover {
    border-color: #007bff;
}

.image-upload-label {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    cursor: pointer;
    position: relative; /* Добавлено для корректной работы с absolute позиционированием */
}

.upload-icon {
    width: 280px; /* Исправлено: фиксированный размер иконки вместо 100% */
    height: 280px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.main-image-upload-container .upload-icon {
    width: 240px; /* Больший размер иконки для главного изображения */
    height: 240px;
}

.image-upload-container:hover .upload-icon,
.main-image-upload-container:hover .upload-icon {
    opacity: 1;
}

.uploaded-image-preview {
    width: 100%; /* Изображение заполняет весь контейнер */
    height: 100%;
    display: block;
    object-fit: cover; 
}

/* Дополнительные стили для лучшей компоновки */
.main-image-upload-container {
    margin-bottom: 20px;
}

/* Стили для таблицы с изображениями */
.add-items-table td {
    vertical-align: top;
    padding: 10px;
}

/* Центрирование главного изображения в ячейке таблицы */
.add-items-table td[colspan="2"] {
    text-align: center;
}
/* Фиксированное вертикальное меню справа */
.fixed-menu {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

.fixed-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fixed-menu li {
    margin-bottom: 10px;
}

.fixed-menu li:last-child {
    margin-bottom: 0;
}

.fixed-menu a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: bold;
    border-radius: 5px;
    text-align: center;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    min-width: 100px;
}

.fixed-menu a:hover {
    background-color: #007bff;
    color: white;
    transform: translateX(-5px);
}

.fixed-menu a.active {
    background-color: #ff69b4;
    color: white;
}

/* Dropdown для фиксированного меню */
/* Улучшенное фиксированное вертикальное меню справа */
.fixed-menu .dropdown {
    position: relative;
}

.fixed-menu .dropdown-content {
    display: none;
    position: absolute;
    right: 100%;
    top: 0;
    margin-right: 5px; /* Уменьшили зазор с 10px до 5px */
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    min-width: 150px;
}

/* Добавляем невидимый мостик для плавного перехода */
.fixed-menu .dropdown::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 0;
    width: 10px;
    height: 100%;
    background: transparent;
}

.fixed-menu .dropdown:hover .dropdown-content {
    display: block;
}

/* Показываем подменю при наведении на мостик */
.fixed-menu .dropdown::after:hover + .dropdown-content,
.fixed-menu .dropdown-content:hover {
    display: block;
}
.fixed-menu .dropdown:hover .dropdown-content {
    display: block;
}

.fixed-menu .dropdown-content a {
    padding: 10px 15px;
    margin: 0;
    border: none;
    border-radius: 0;
    background-color: transparent;
}

.fixed-menu .dropdown-content a:hover {
    background-color: #f1f1f1;
    color: #333;
    transform: none;
}

/* Скрыть оригинальное меню на мобильных */
@media (max-width: 768px) {
    .fixed-menu {
        right: 10px;
        padding: 10px;
    }
    
    .fixed-menu a {
        padding: 8px 15px;
        font-size: 12px;
        min-width: 80px;
    }
}
/* Стиль для кнопки Сохранить в админ меню */
.fixed-menu .save-button {
    background-color: #28a745 !important;
    color: white !important;
}

.fixed-menu .save-button:hover {
    background-color: #218838 !important;
    transform: translateX(-5px);
}
