/* Основні стилі */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    background: #170955;
    color: #e2fa7b;
}

.admin form{display:grid; gap:10px}
label{display:block}
input, textarea{width:100%; padding:8px; border-radius:6px; border:1px solid rgba(255,255,255,0.08); background:rgba(255,255,255,0.02); color:var(--text)}
button{background:var(--accent); color:#000; padding:10px 14px; border-radius:8px; border:0}

.page-title {
    text-align: center;
    margin: -10px 0;
    
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.card h3 {
    padding: 15px 15px 5px;
    margin: 0;
    font-size: 18px;
    color: #333;
}

.card .short {
    padding: 0 15px;
    margin: 0 0 10px;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.card .price {
    padding: 10px 15px;
    margin: 0;
    background: #f8f9fa;
    color: #e44d26;
    font-weight: bold;
    font-size: 18px;
    text-align: right;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.empty-state p {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

.empty-state .btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.empty-state .btn:hover {
    background: #0056b3;
}

/* Модальне вікно */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-content {
    position: relative;
    border-radius: 12px;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    z-index: 1001;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff4444;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.modal-close:hover {
    background: #cc0000;
}

/* Стилі для вмісту модального вікна */
.modal-inner {
    padding: 10px;
}

.modal-title {
    margin-top: 0;
}

.gallery {
    margin: 20px 0;
}

.main-img {
    text-align: center;
    margin-bottom: 15px;
}

.main-img img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
}

.thumbs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.thumb:hover {
    border-color: #007bff;
}

.full-desc {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    line-height: 1.6;
    color: #444;
}

.video {
    margin: 25px 0;
    text-align: center;
}

.video iframe {
    width: 100%;
    max-width: 560px;
    height: 315px;
    border-radius: 8px;
}

.actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.buy-btn {
    display: inline-block;
    background: #e44d26;
    color: white;
    padding: 12px 25px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
}

.buy-btn:hover {
    background: #c73515;
}

.copy-link {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.copy-link:hover {
    background: #0056b3;
}

.loading, .error {
    text-align: center;
    padding: 50px;
    font-size: 18px;
    color: #666;
}

.error {
    color: #ff4444;
}

/* Адаптивність */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .modal-title {
        font-size: 24px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .buy-btn, .copy-link {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    .card img {
        height: 180px;
    }
}

/* Галерея */
.gallery-container {
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    padding: 15px;
}

.gallery-main {
    position: relative;
    text-align: center;
}

.image-zoom-container {
    position: relative;
    display: inline-block;
    overflow: hidden;
    border-radius: 8px;
    max-width: 100%;
    cursor: grab;
}

.image-zoom-container:active {
    cursor: grabbing;
}

.zoomable-image {
    max-width: 100%;
    max-height: 500px;
    display: block;
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.zoom-controls {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.zoom-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.gallery-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
}

.gallery-prev,
.gallery-next {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.3s;
}

.gallery-prev:hover,
.gallery-next:hover {
    background: #0056b3;
}

.gallery-counter {
    font-size: 16px;
    color: #666;
    font-weight: bold;
}

/* Мініатюри */
.gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
}

.gallery-thumbs::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbs::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.gallery-thumbs::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.thumb-item {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s;
}

.thumb-item.active {
    border-color: #007bff;
    transform: scale(1.05);
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Свайп підказка */
.gallery-swipe-hint {
    text-align: center;
    margin-top: 10px;
    color: #666;
    font-size: 14px;
    display: none;
}

.swipe-icon {
    font-size: 20px;
    margin-right: 8px;
    animation: swipe 2s infinite;
}

@keyframes swipe {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

/* Секції */
.full-desc {
    margin: 30px 0;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.full-desc h3 {
    margin-top: 0;
    color: #333;
    font-size: 22px;
    margin-bottom: 15px;
}

.desc-content {
    line-height: 1.6;
    color: #555;
}

.video-section {
    margin: 30px 0;
}

.video-section h3 {
    margin-top: 0;
    color: #333;
    font-size: 22px;
    margin-bottom: 15px;
}

.video-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.actions-section {
    margin: 30px 0;
}

.actions-section h3 {
    margin-top: 0;
    color: #333;
    font-size: 22px;
    margin-bottom: 20px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.buy-btn,
.share-btn,
.copy-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.buy-btn {
    background: linear-gradient(135deg, #e44d26, #d1401e);
    color: white;
}

.buy-btn:hover {
    background: linear-gradient(135deg, #d1401e, #b83518);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(228, 77, 38, 0.3);
}

.share-btn {
    background: #28a745;
    color: white;
}

.share-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.copy-link-btn {
    background: #6c757d;
    color: white;
}

.copy-link-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-icon {
    font-size: 20px;
}

/* Ціна */
.price-section {
    margin: 25px 0;
}

.price-badge {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px 30px;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.price-label {
    font-size: 18px;
    color: #666;
}

.price-value {
    font-size: 28px;
    font-weight: bold;
    color: #e44d26;
}

/* Повноекранний режим */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.fullscreen-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 2001;
}

.fullscreen-prev,
.fullscreen-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    z-index: 2001;
}

.fullscreen-prev {
    left: 20px;
}

.fullscreen-next {
    right: 20px;
}

.fullscreen-prev:hover,
.fullscreen-next:hover,
.fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Адаптивність для телефонів */
@media (max-width: 768px) {
    .gallery-container {
        padding: 10px;
    }
    
    .zoomable-image {
        max-height: 400px;
    }
    
    .zoom-controls {
        bottom: 10px;
        right: 10px;
    }
    
    .zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .gallery-prev,
    .gallery-next {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .gallery-thumbs {
        display: none; /* Ховаємо мініатюри на телефоні */
    }
    
    .gallery-swipe-hint {
        display: block;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .buy-btn,
    .share-btn,
    .copy-link-btn {
        width: 100%;
        justify-content: center;
    }
    
    .price-badge {
        width: 100%;
        justify-content: center;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .fullscreen-prev,
    .fullscreen-next {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .zoomable-image {
        max-height: 300px;
    }
    
    .full-desc,
    .video-container {
        padding: 15px;
    }
    
    .price-badge {
        padding: 15px 20px;
    }
    
    .price-value {
        font-size: 24px;
    }
}

/* Анімації */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
