/* Global Styles - Tobacco Shop Theme */
:root {
    --primary-color: #3a3a3a;
    --secondary-color: #f8f9fa;
    --accent-color: #8b4513;
    --text-color: #333;
    --light-gray: #e9ecef;
    --dark-gray: #6c757d;
    --danger-color: #dc3545;
    --success-color: #28a745;
    --warning-color: #e74c3c;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--secondary-color);
    margin: 0;
    padding: 0;
}

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

/* Header */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.navbar-brand::before {
    content: '🚬';
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-left: 1.5rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--accent-color);
}

/* Cards */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
}

.card-img-placeholder {
    width: 100%;
    height: 200px;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 14px;
    cursor: pointer;
}

.card-img-placeholder::after {
    content: 'Товар';
}

.product-img-placeholder {
    width: 100%;
    height: 300px;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 16px;
    border-radius: 8px;
}

.admin-img-placeholder {
    width: 50px;
    height: 50px;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 10px;
    border-radius: 4px;
}

.edit-img-placeholder {
    width: 100%;
    height: 200px;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 14px;
    border-radius: 8px;
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.3s;
}

.card-title:hover {
    color: var(--accent-color);
}

.card-text {
    color: var(--dark-gray);
    margin-bottom: 1rem;
}

.card-price {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #3a5a8a;
    border-color: #3a5a8a;
}

.btn-success {
    color: #fff;
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-danger {
    color: #fff;
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-outline-primary {
    color: var(--primary-color);
    background-color: transparent;
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(74, 109, 167, 0.25);
}

label {
    display: inline-block;
    margin-bottom: 0.5rem;
}

/* Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col, .col-md-4, .col-lg-3 {
    position: relative;
    width: 100%;
    min-height: 1px;
    padding-right: 15px;
    padding-left: 15px;
}

@media (min-width: 768px) {
    .col-md-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

@media (min-width: 992px) {
    .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* Category Filter */
.category-filter {
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-btn {
    padding: 0.5rem 1rem;
    background-color: var(--light-gray);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

/* Search */
.search-container {
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--light-gray);
    border-radius: 25px;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 109, 167, 0.25);
}

/* Admin Panel */
.admin-actions {
    margin-bottom: 2rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.admin-table th, .admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

.admin-table th {
    background-color: var(--light-gray);
    font-weight: bold;
}

.admin-table tr:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.admin-table .actions {
    display: flex;
    gap: 10px;
}

/* Image Preview */
.image-preview {
    width: 100%;
    max-width: 300px;
    height: 200px;
    border: 1px dashed var(--light-gray);
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-gray);
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

footer p {
    margin-bottom: 0.5rem;
}

footer small {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.favorite-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.favorite-icon:hover {
    transform: scale(1.1);
}

.favorite-icon.active {
    color: var(--warning-color);
}

/* Product Detail */
.product-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 2rem;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.product-image {
    flex: 1;
    min-width: 300px;
}

.product-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.product-info {
    flex: 2;
    min-width: 300px;
}

.product-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.product-category {
    display: inline-block;
    background-color: var(--light-gray);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.product-price {
    font-size: 1.5rem;
    color: var(--accent-color);
    font-weight: bold;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--light-gray);
    border-bottom: 1px solid var(--light-gray);
}

.product-description {
    margin-bottom: 2rem;
    line-height: 1.8;
}

.product-age-warning {
    background-color: rgba(231, 76, 60, 0.1);
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid var(--warning-color);
    margin-top: 1rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background-color: white;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    margin-bottom: 10px;
    border-radius: 4px;
    animation: slideIn 0.3s ease-out;
}

.toast-success {
    border-left-color: var(--success-color);
}

.toast-error {
    border-left-color: var(--danger-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Стили для недоступных товаров */
.product-unavailable {
    opacity: 0.6;
    position: relative;
}

.product-unavailable::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(45deg, rgba(220, 53, 69, 0.1) 25%, transparent 25%, transparent 50%, rgba(220, 53, 69, 0.1) 50%, rgba(220, 53, 69, 0.1) 75%, transparent 75%, transparent);
    background-size: 10px 10px;
    pointer-events: none;
    z-index: 1;
}

.product-unavailable .card-title {
    text-decoration: line-through;
    color: var(--dark-gray);
}

.product-unavailable .product-title {
    text-decoration: line-through;
    color: var(--dark-gray);
}

.product-unavailable .card-img-top,
.product-unavailable .product-image img {
    filter: grayscale(100%);
}

.product-detail-wrapper.product-unavailable {
    position: relative;
}

.product-detail-wrapper.product-unavailable::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(45deg, rgba(220, 53, 69, 0.1) 25%, transparent 25%, transparent 50%, rgba(220, 53, 69, 0.1) 50%, rgba(220, 53, 69, 0.1) 75%, transparent 75%, transparent);
    background-size: 10px 10px;
    pointer-events: none;
    z-index: 1;
}

/* Стили для языковых кнопок */
.language-btn {
    padding: 0.25rem 0.5rem;
    margin-left: 0.5rem;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.language-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.language-btn.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.language-selector {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

/* Стили для корзины */
.cart-item {
    display: flex;
    border-bottom: 1px solid var(--light-gray);
    padding: 15px 0;
    position: relative;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    border-radius: 8px;
}

.cart-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 20px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cart-item:hover .cart-item-image {
    transform: scale(1.05);
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-name {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.2rem;
    color: #333;
}

.cart-item-price {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
}

.cart-quantity-control {
    display: flex;
    align-items: center;
    margin-right: 20px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cart-quantity-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--light-gray);
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    user-select: none;
    transition: all 0.2s ease;
}

.cart-quantity-btn:hover {
    background-color: #e9ecef;
}

.cart-quantity-btn:active {
    transform: scale(0.95);
}

.cart-quantity-input {
    width: 50px;
    height: 36px;
    border: 1px solid var(--light-gray);
    border-left: none;
    border-right: none;
    text-align: center;
    font-weight: bold;
    color: #333;
    background-color: white;
}

.cart-remove-btn {
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.cart-remove-btn:hover {
    background-color: rgba(220, 53, 69, 0.1);
    transform: scale(1.1);
}

.cart-remove-btn:active {
    transform: scale(0.95);
}

.cart-empty {
    text-align: center;
    padding: 50px 30px;
    background-color: #f8f9fa;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.cart-empty:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.cart-empty p {
    font-size: 1.2rem;
    color: #6c757d;
    margin-bottom: 20px;
}

.cart-empty button {
    padding: 10px 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    border-radius: 30px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cart-empty button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

/* Стили для итогов корзины */
#cart-summary {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-top: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

#cart-summary:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

#cart-summary h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.3rem;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 5px 0;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 1.2rem;
    border-top: 1px solid #dee2e6;
    padding-top: 15px;
    margin-top: 10px;
}

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

.cart-buttons button {
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
}

#clear-cart-btn {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

#clear-cart-btn:hover {
    background-color: #e9ecef;
    color: #495057;
}

#checkout-btn {
    background-color: var(--success-color);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.cart-badge {
    position: relative;
    display: inline-block;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .navbar-nav {
        margin-top: 1rem;
        flex-direction: column;
    }
    
    .nav-item {
        margin-left: 0;
        margin-bottom: 0.5rem;
    }
    
    .product-detail {
        flex-direction: column;
    }
    
    .language-selector {
        margin-top: 1rem;
        margin-left: 0;
    }
    
    .cart-item {
        flex-direction: column;
    }
    
    .cart-item-image {
        margin-bottom: 10px;
    }
}
