@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700&display=swap');

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 2px;
    background-color: #c1c1c192;
}

/* Категории */
.category-container {
    padding: 0 12px;
    margin: 12px auto;
    max-width: 100%;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
}

.categories-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding: 10px 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInUp 0.5s ease-out 0.2s forwards;
    scrollbar-width: none;
}

.categories-grid::-webkit-scrollbar {
    display: none;
}

.category-card {
    flex: 0 0 auto;
    width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(245, 245, 247, 0.7));
    backdrop-filter: blur(10px);
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.4);
    scroll-snap-align: start;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(0, 113, 227, 0.2), transparent 70%);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 0;
}

.category-card:hover::before,
.category-card.active::before {
    opacity: 1;
}

.category-card:active {
    transform: scale(0.92);
    box-shadow: 0 2px 6px rgba(0, 113, 227, 0.2);
}

.category-card:active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(0, 113, 227, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 0.5s ease-out;
}

.category-card.active {
    background: linear-gradient(145deg, rgba(255, 255, 255, 1), rgba(240, 240, 247, 0.9));
    box-shadow: 0 4px 10px rgba(0, 113, 227, 0.25);
}

.category-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 6px;
    transition: transform 0.2s ease;
    z-index: 1;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(1);
    transition: filter 0.2s ease;
}

.category-card.active .category-icon img {
    filter: brightness(1.1);
    transform: scale(1.1);
}

.category-name {
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
    text-align: center;
    z-index: 1;
    transition: color 0.2s ease;
}

.category-card.active .category-name {
    color: #0071e3;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 150px;
        height: 150px;
        opacity: 0;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .category-container {
        padding: 0 8px;
        margin: 8px auto;
    }

    .categories-grid {
        gap: 8px;
        padding: 8px 0;
    }

    .category-card {
        width: 80px;
        padding: 8px;
        border-radius: 12px;
    }

    .category-icon {
        width: 32px;
        height: 32px;
        margin-bottom: 5px;
    }

    .category-name {
        font-size: 12px;
        font-weight: 500;
    }
}

@media (min-width: 769px) {
    .category-container {
        padding: 0 24px;
        margin: 24px auto;
        max-width: 1200px;
    }

    .categories-grid {
        display: grid;
        flex-wrap: wrap;
        overflow-x: visible;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        scroll-snap-type: none;
    }

    .category-card {
        width: auto;
        padding: 12px 8px;
        border-radius: 18px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .category-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 8px;
    }

    .category-name {
        font-size: 13px;
        font-weight: 600;
    }
}

@media (min-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 16px;
    }

    .category-card {
        padding: 16px 12px;
        border-radius: 20px;
    }

    .category-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 10px;
    }

    .category-name {
        font-size: 14px;
    }
}

/* Остальные стили */
.install-banner {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    background: #ff5722;
    color: white;
    padding: 15px;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    display: none;
}

.install-banner p {
    margin: 0 0 10px 0;
}

#installButton, #dismissInstall {
    padding: 8px 15px;
    margin: 0 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#installButton {
    background: #fff;
    color: #ff5722;
}

#dismissInstall {
    background: transparent;
    color: white;
    border: 1px solid white;
}

.bottom-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    z-index: 1000;
    background-color: white;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(10px);
    border-top: 0.5px solid rgba(0, 0, 0, 0.615);
}

.nav-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    transition: background-color 0.3s ease;
}

.nav-button:active {
    background-color: rgba(0, 0, 0, 0.1);
}

.nav-button img {
    width: 23px;
    height: 23px;
    margin-bottom: 3px;
}

.nav-button span {
    font-size: 10px;
}

.products {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: -12px;
    justify-content: center;
    margin-block-end: 50px;
    padding: 10px;
}

.product-card {
    background: rgba(255, 255, 255, 0.85);
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    text-align: center;
    box-sizing: border-box;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
}

@media (max-width: 767px) {
    .product-card {
        width: calc(50% - 8px);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .product-card {
        width: calc(33.33% - 10px);
    }
}

@media (min-width: 1024px) {
    .product-card {
        width: calc(20% - 12px);
    }
}

@media (hover: hover) {
    .product-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
        background: rgba(255, 255, 255, 0.95);
    }
}

.product-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-origin: center center;
    will-change: transform;
}

.product-card img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-card img:active {
    transform: scale(1.1) translateZ(5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card h2 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #333;
    line-height: 1.3;
}

.product-card p {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    margin-top: auto;
}

.product-card .price {
    font-size: 16px;
    font-weight: 700;
    color: #ff5722;
    margin-bottom: 10px;
}

.product-card .add-to-cart {
    background: linear-gradient(90deg, #ff7e5f, #feb47b);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
}

.product-card:active {
    transform: scale(0.98);
}

.product-card img.active {
    transform: scale(1.1) translateZ(5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-link, .back-link {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 24px;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.admin-link {
    background: #34c759;
}

.admin-link:hover {
    background: #248a3d;
}

.back-link {
    background: #8e8e93;
}

.back-link:hover {
    background: #6c6c70;
}

.cart-items {
    margin-top: 20px;
    padding: 0 16px;
}

.cart-item {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.cart-item h3 {
    font-size: 18px;
    font-weight: 500;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.cart-item p {
    font-size: 14px;
    color: #6e6e73;
    margin-bottom: 4px;
}

.cart-item button {
    background: #007aff;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cart-item button:hover {
    background: #0063cc;
}

.out-of-stock {
    color: #FF1900;
    font-weight: bold;
}

.error {
    color: #ff3b30;
}

.product-card textarea {
    width: 100%;
    height: 100px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    font-family: inherit;
    font-size: 14px;
}

.delete-button {
    background-color: #ff3b30;
    color: white;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    margin-top: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.delete-button:hover {
    background-color: #cc2e25;
}

.notification {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.notification.success {
    background-color: #34C759;
}

.notification.error {
    background-color: #FF3B30;
}

.notification i {
    font-size: 16px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.notification.show {
    opacity: 1;
    animation: slideIn 0.3s ease-out forwards;
}

.korzina i {
    margin-right: 8px;
}

.korzina {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    cursor: pointer;
    border: none;
    border-radius: 13px;
    background: #0071e3;
    color: white;
    font-weight: bold;
    transition: background 0.2s;
}

.korzina:hover {
    background: #0071e3;
}

.korzina .fa-trash {
    margin-right: 8px;
}

.search-container {
    max-width: 600px;
    margin: 20px auto;
    position: sticky;
    top: 0;
    z-index: 100;
    margin-top: -8px;
}

.search-box {
    display: flex;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 30px;
    overflow: hidden;
    background: white;
}

#searchInput {
    flex: 1;
    padding: 10px 15px;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
}

#searchButton {
    background: linear-gradient(145deg, #007aff, #0063cc);
    border: none;
    padding: 0 20px;
    cursor: pointer;
    transition: background 0.3s;
}

#searchButton:hover {
    background: linear-gradient(145deg, #007aff, #0063cc);
}

#searchButton img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.no-products-message {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 18px;
}

.pwa-prompt {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.pwa-prompt-content {
    background: white;
    border-radius: 14px;
    width: 300px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.pwa-prompt-header {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.pwa-prompt-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 10px;
    border-radius: 14px;
    background: #b9aeabb6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 30px;
}

.pwa-prompt-icon::before {
    content: "";
    display: inline-block;
    width: 45px;
    height: 45px;
    background: url('logodona.png') center/cover;
}

.pwa-prompt-body {
    padding: 16px;
    text-align: center;
}

.pwa-prompt-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 18px;
}

.pwa-prompt-text {
    color: #666;
    font-size: 14px;
    margin-bottom: 16px;
}

.pwa-prompt-buttons {
    display: flex;
    border-top: 1px solid #f0f0f0;
}

.pwa-prompt-button {
    flex: 1;
    padding: 12px;
    text-align: center;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
}

.pwa-prompt-button:first-child {
    border-right: 1px solid #f0f0f0;
    color: #666;
}

.pwa-prompt-button:last-child {
    font-weight: 600;
    color: #007aff;
}

.dodo-notifications {
    position: fixed;
    bottom: 70px;
    left: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.dodo-notification {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 12px 15px 12px 60px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.dodo-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.dodo-notification.hide {
    transform: translateY(20px);
    opacity: 0;
}

.dodo-notification-badge {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-color: #f8f8f8;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dodo-notification.new .dodo-notification-badge {
    background-image: url('https://img.icons8.com/ios-filled/49/realtime-protection.png');
}

.dodo-notification.pending .dodo-notification-badge {
    background-image: url('https://img.icons8.com/color/48/chef-cooking-skin-type-4.png');
}

.dodo-notification.deliveri .dodo-notification-badge {
    background-image: url('https://img.icons8.com/ios-filled/48/order-on-the-way.png');
}

.dodo-notification.success .dodo-notification-badge {
    background-image: url('https://img.icons8.com/tiny-color/49/ok.png');
}

.dodo-notification.otmen .dodo-notification-badge {
    background-image: url('https://img.icons8.com/cotton/48/cancel--v4.png');
}

.dodo-notification-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}

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

.dodo-notification-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}

.dodo-notification-time {
    font-size: 12px;
    color: #888;
}

.dodo-notification-body {
    display: flex;
    flex-direction: column;
}

.dodo-notification-status {
    font-weight: 700;
    font-size: 15px;
    color: #222;
}

.dodo-notification-details {
    font-size: 12px;
    color: #666;
}

.dodo-notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.05);
    color: #888;
    font-size: 14px;
    border: none;
    padding: 0;
}

.dodo-notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 100%;
    overflow: hidden;
}

.dodo-notification-progress:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    animation: progressBar 8s linear forwards;
}

.dodo-notification.new .dodo-notification-progress:after {
    background: linear-gradient(90deg, #FF6900, #FF8C00);
}

.dodo-notification.pending .dodo-notification-progress:after {
    background: linear-gradient(90deg, #FFA800, #FFC000);
}

.dodo-notification.deliveri .dodo-notification-progress:after {
    background: linear-gradient(90deg, #00B956, #00D166);
}

.dodo-notification.success .dodo-notification-progress:after {
    background: linear-gradient(90deg, #00B956, #00D166);
}

.dodo-notification.otmen .dodo-notification-progress:after {
    background: linear-gradient(90deg, #FF2E00, #FF4D00);
}

@keyframes progressBar {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(0); }
}

@media (min-width: 768px) {
    .dodo-notifications {
        bottom: 80px;
        left: 20px;
        right: auto;
        width: 350px;
    }
    
    .dodo-notification {
        padding: 15px 20px 15px 70px;
    }
    
    .dodo-notification-badge {
        width: 40px;
        height: 40px;
        font-size: 18px;
        left: 15px;
    }
    
    .dodo-notification-title {
        font-size: 15px;
    }
    
    .dodo-notification-time {
        font-size: 13px;
    }
    
    .dodo-notification-status {
        font-size: 16px;
    }
    
    .dodo-notification-details {
        font-size: 13px;
    }
    
    .dodo-notification-close {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }
}

@keyframes reappear {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.reappear-notification {
    animation: reappear 0.3s ease-out forwards;
}

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

/* Встроенные стили из HTML */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
}

.modal-header {
    position: relative;
    padding: 20px;
}

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

.modal-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.modal-body {
    padding: 20px;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #333;
}

.modal-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.size-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.size-button {
    flex: 1;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.size-button.active {
    border-color: #ff6900;
    background: #fff5e6;
}

.size-button:hover {
    border-color: #ff6900;
}

.size-button span {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.size-button .price {
    font-size: 14px;
    color: #666;
}

.modal-footer {
    padding: 20px;
    background: #f8f8f8;
    border-top: 1px solid #eee;
}

.add-to-cart {
    width: 100%;
    padding: 15px;
    background: #ff6900;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.add-to-cart:hover {
    background: #e55f00;
}

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

.stories-title {
    text-align: center;
    font-size: 22px;
    margin-bottom: 10px;
    color: #333;
}

.stories-list {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 0px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.story-rect {
    width: 100px;
    height: 150px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #ff6900;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.story-rect:hover {
    transform: scale(1.05);
}

.story-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 1001;
    align-items: center;
    justify-content: center;
}

.story-modal-content {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 90vh;
    max-height: 100vh;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.story-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    display: none;
    transition: opacity 0.3s ease;
}

.story-image.active {
    display: block;
    opacity: 1;
}

.story-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.5);
    border: none;
    font-size: 20px;
    color: white;
    cursor: pointer;
    z-index: 1002;
    padding: 5px 10px;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.story-close:hover {
    background: rgba(0,0,0,0.8);
}

.story-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.story-nav.prev {
    left: 0;
}

.story-nav.next {
    right: 0;
}

.story-progress-container {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    z-index: 1002;
}

.story-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.4);
    border-radius: 2px;
    overflow: hidden;
}

.story-progress {
    height: 100%;
    background: white;
    width: 0;
    transition: width linear;
}

.favorite-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    color: #ccc;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

.favorite-icon.active {
    color: #ff0000;
    animation: heartPulse 0.3s ease;
}

@keyframes heartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.5s ease;
}

.loader-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #ff6900;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    margin-top: 20px;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.main-content {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.main-content.loaded {
    opacity: 1;
}

@media (max-width: 768px) {
    .stories-container {
        padding: 0 10px;
    }

    .stories-title {
        font-size: 18px;
    }

    .story-rect {
        width: 80px;
        height: 120px;
    }

    .story-modal-content {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }

    .story-image {
        max-height: 85%;
        border-radius: 0;
    }

    .story-close {
        font-size: 18px;
        padding: 8px 12px;
    }

    .story-progress-container {
        top: 8px;
        left: 8px;
        right: 8px;
        gap: 3px;
    }

    .story-progress-bar {
        height: 2px;
    }

    .favorite-icon {
        font-size: 20px;
        top: 8px;
        right: 8px;
    }

    .loader-text {
        font-size: 18px;
    }

    .loader-spinner {
        width: 40px;
        height: 40px;
        border-width: 4px;
    }
}