/* ========================================
   PRODUCT CARDS
   ======================================== */

/* Базовые стили карточек */
.product-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    background: white;
    min-height: 450px;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    border-color: rgba(217, 35, 50, 0.3);
}

/* Изображения */
.product-image {
    height: 200px;
    object-fit: cover;
    width: 100%;
    object-position: center center;
    flex-shrink: 0;
}

/* Контент карточки */
.product-card .p-4 {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-info {
    flex-shrink: 0;
    min-height: 80px;
    margin-bottom: 0.5rem;
}

.product-info h3 {
    min-height: 48px;
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.product-info p {
    flex: 1;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.product-actions {
    margin-top: auto;
    flex-shrink: 0;
}

/* ========================================
   ПРОСТАЯ РАМОЧКА ДЛЯ ЦЕНЫ
   ======================================== */

.simple-price-box {
    background: #ffffff;
    border: 1px solid #dc2626;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    text-align: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.simple-price-main {
    font-size: 1.25rem;
    font-weight: 700;
    color: #dc2626;
    margin: 4px 0;
    line-height: 1.2;
}

.simple-price-info {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 2px;
    font-weight: 500;
}

/* Hover эффекты для рамочки */
.product-card:hover .simple-price-box {
    border-color: #b91c1c;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
    transform: translateY(-1px);
}

.product-card:hover .simple-price-main {
    transform: scale(1.05);
}

/* Старая цена в рамочке */
.simple-price-box .old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 2px;
    font-weight: 500;
}

/* ========================================
   БЕЙДЖИ ВНУТРИ РАМОЧКИ
   ======================================== */

.simple-quality-badge {
    background: #28a745;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    display: inline-block;
    margin-top: 6px;
}

.simple-savings-badge {
    background: #ffc107;
    color: #212529;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 6px;
}

.simple-new-badge {
    background: #6f42c1;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    display: inline-block;
    margin-top: 6px;
}

.simple-popular-badge {
    background: #17a2b8;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    display: inline-block;
    margin-top: 6px;
}

/* ========================================
   БЕЙДЖИ НА КАРТОЧКАХ (УГЛЫ)
   ======================================== */

/* Контейнер бейджей */
.badges-container {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: row;
    gap: 4px;
    z-index: 5;
    align-items: flex-start;
    justify-content: flex-end;
    flex-wrap: wrap;
    max-width: calc(100% - 20px);
}

/* Базовые стили бейджей */
.badge {
    position: relative;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 35px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Типы бейджей */
.badge-new {
    background-color: #D92332;
    color: white;
    order: 2;
}

.badge-sale {
    background-color: #f8bd24;
    color: #222;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    order: 3;
}

.badge-1\+1,
.badge-1plus1 {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: 2px solid #a78bfa;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
    order: 1;
}

.badge-hot {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    order: 4;
}

.badge-limited {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    order: 5;
}

.badge-popular {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    order: 6;
}

.badge-best {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1f2937;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
    border: 1px solid #fcd34d;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    order: 7;
}

.badge-seasonal {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
    order: 8;
}

/* Hover эффекты для бейджей */
.product-card:hover .badge {
    transform: scale(1.05);
}

/* ========================================
   КНОПКИ
   ======================================== */

.btn-simple {
    background: #dc2626;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-simple:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.btn-simple:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

/* ========================================
   QUANTITY SELECTION (1+1)
   ======================================== */

.quantity-option {
    transition: all 0.3s ease;
    cursor: pointer;
}

.quantity-option:hover {
    border-color: #3b82f6 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quantity-selected {
    border-color: #10b981 !important;
    background-color: #ecfdf5 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.quantity-selected .text-green-700 {
    color: #047857 !important;
}

.quantity-selected .text-green-800 {
    color: #065f46 !important;
}

.quantity-selected .text-green-600 {
    color: #059669 !important;
}

.quantity-selector {
    display: none;
}

/* ========================================
   CART OVERLAY
   ======================================== */

.cart-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    background-color: white;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.cart-overlay.active {
    right: 0;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary-color);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-new {
    transition: all 0.2s ease;
}

.cart-item-new:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cart-overlay a[href^="tel:"] {
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.cart-overlay a[href^="tel:"]:hover {
    transform: scale(1.05);
}

/* ========================================
   MOBILE NAVIGATION
   ======================================== */

.mobile-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    height: 100vh;
    background-color: white;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.mobile-nav.active {
    left: 0;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Accordion */
.accordion-item {
    border-bottom: 1px solid #eee;
}

.accordion-header {
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.active {
    max-height: 500px;
}

.accordion-content .submenu-mobile-item {
    padding: 0.75rem 1rem;
    padding-left: 2rem;
    transition: all 0.3s ease;
}

/* ========================================
   CAROUSEL
   ======================================== */

.carousel-container {
    position: relative;
    overflow: hidden;
}

.carousel-slide {
    display: none;
    transition: all 0.5s ease;
}

.carousel-slide.active {
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255,255,255,0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-btn:hover {
    background-color: rgba(255,255,255,0.8);
}

.carousel-btn-prev {
    left: 10px;
}

.carousel-btn-next {
    right: 10px;
}

/* ========================================
   СТАРЫЕ ЦЕНЫ И СПЕЦИАЛЬНЫЕ ЦЕНЫ
   ======================================== */

.old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 4px;
}

.special-price {
    color: #dc2626;
    font-weight: 900;
    font-size: 1.5rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ========================================
   АДАПТИВНОСТЬ
   ======================================== */

/* Мобильные устройства */
@media (max-width: 768px) {
    /* Карточки */
    .product-card {
        min-height: 430px;
    }
    
    .product-image {
        height: 220px;
    }
    
    .product-card h3 {
        min-height: 40px;
        font-size: 1rem;
    }
    
    .product-info {
        min-height: 70px;
    }
    
    /* Рамочка цены */
    .simple-price-box {
        padding: 10px;
        margin: 10px 0;
    }
    
    .simple-price-main {
        font-size: 1.1rem;
    }
    
    .simple-price-info {
        font-size: 0.75rem;
    }
    
    /* Бейджи в рамочке */
    .simple-quality-badge,
    .simple-savings-badge,
    .simple-new-badge,
    .simple-popular-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }
    
    /* Кнопки */
    .btn-simple {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .btn-primary {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    /* Бейджи на углах */
    .badges-container {
        top: 8px;
        right: 8px;
        gap: 3px;
        max-width: calc(100% - 16px);
    }
    
    .badge {
        font-size: 0.6rem;
        padding: 3px 6px;
        min-width: 30px;
    }
    
    /* Селектор количества */
    .quantity-option {
        padding: 0.5rem;
    }
    
    .quantity-option .text-lg {
        font-size: 1rem;
    }
    
    .quantity-option .text-sm {
        font-size: 0.75rem;
    }
    
    .quantity-option .text-xs {
        font-size: 0.625rem;
    }
}

/* Планшеты */
@media (min-width: 481px) and (max-width: 768px) {
    .product-image {
        height: 240px;
    }
    
    .product-card {
        min-height: 450px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .product-card {
        min-height: 400px;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-info {
        min-height: 60px;
    }
    
    .simple-price-box {
        padding: 8px;
        border-radius: 6px;
    }
    
    .simple-price-main {
        font-size: 1rem;
    }
    
    .badges-container {
        top: 6px;
        right: 6px;
        gap: 2px;
        max-width: calc(100% - 12px);
    }
    
    .badge {
        font-size: 0.55rem;
        padding: 2px 5px;
        min-width: 25px;
    }
}

/* ========================================
   СПЕЦИАЛЬНЫЕ СТИЛИ ДЛЯ СЕТОВ И ГОРЯЧИХ СУШИ
   ======================================== */

/* Увеличенные изображения для страницы сетов */
#products-grid .product-image {
    height: 250px;
}

/* Специально для горячих суши - они высокие */
body:has([href*="karstie-sushi"]) .product-image,
body:has([href*="gorjachie-sushi"]) .product-image,
[data-page="hot-sushi"] .product-image,
.hot-sushi-page .product-image {
    height: 280px;
}

@media (min-width: 769px) {
    /* Сеты на десктопе */
    #products-grid .product-image {
        height: 240px;
    }
    
    #products-grid .product-card {
        min-height: 520px;
    }
    
    /* Горячие суши на десктопе */
    body:has([href*="karstie-sushi"]) .product-image,
    body:has([href*="gorjachie-sushi"]) .product-image,
    [data-page="hot-sushi"] .product-image,
    .hot-sushi-page .product-image {
        height: 320px;
    }
    
    body:has([href*="karstie-sushi"]) .product-card,
    body:has([href*="gorjachie-sushi"]) .product-card,
    [data-page="hot-sushi"] .product-card,
    .hot-sushi-page .product-card {
        min-height: 540px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    #products-grid .product-image {
        height: 260px;
    }
    
    /* Горячие суши на планшетах */
    body:has([href*="karstie-sushi"]) .product-image,
    body:has([href*="gorjachie-sushi"]) .product-image,
    [data-page="hot-sushi"] .product-image,
    .hot-sushi-page .product-image {
        height: 300px;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.quantity-option:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.badge:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Высокий контраст */
@media (prefers-contrast: high) {
    .badge {
        border: 2px solid currentColor;
        font-weight: 900;
    }
}

/* Отключение анимаций для пользователей с ограниченными возможностями */
@media (prefers-reduced-motion: reduce) {
    .badge,
    .product-card,
    .badges-container,
    .quantity-option,
    .cart-item-new {
        animation: none !important;
        transition: none !important;
    }
}