/* ============================================
   PRODUCT.CSS - Стили специфичные для страницы продукта
   ============================================ */

/* Product Page Container */
.product-page {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 30px 20px 50px;
}

/* ============================================
   PRODUCT MAIN SECTION
   ============================================ */
.product-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: var(--bg-primary);
    border-radius: 15px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

/* ============================================
   PRODUCT GALLERY
   ============================================ */
.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-image {
    width: 100%;
    height: 450px;
    background: linear-gradient(135deg, var(--gradient-product-start) 0%, var(--gradient-product-end) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.main-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 20px;
}

.main-image i {
    font-size: 8rem;
    color: var(--primary-light);
}

.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.thumbnail {
    width: 100%;
    height: 100px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
    overflow: hidden;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--primary-light);
    transform: scale(1.05);
}

.thumbnail i {
    font-size: 2rem;
    color: var(--primary-light);
}

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

/* ============================================
   PRODUCT INFO SECTION
   ============================================ */
.product-info-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.product-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

.product-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-top: -10px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stars {
    color: var(--accent-yellow);
    font-size: 1.1rem;
}

.rating-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.rating-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.rating-link:hover {
    text-decoration: underline;
}

/* Product Price Section */
.product-price-section {
    background: var(--bg-tertiary);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid var(--primary-lightest);
}

.price-main {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.price-old {
    font-size: 1.3rem;
    color: var(--text-light);
    text-decoration: line-through;
    margin-right: 10px;
}

.price-discount {
    display: inline-block;
    background: var(--accent-pink);
    color: var(--bg-primary);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
}

.price-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
}

.price-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.price-info-item i {
    color: var(--accent-green);
}

/* Product Actions */
.product-actions {
    display: flex;
    gap: 15px;
}

.btn-primary {
    flex: 1;
    padding: 16px 30px;
    background-color: var(--primary-light);
    color: var(--bg-primary);
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    padding: 16px 20px;
    background-color: var(--bg-tertiary);
    color: var(--accent-pink);
    border: 2px solid var(--accent-pink-light);
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background-color: var(--accent-pink-light);
    transform: scale(1.05);
}

/* Product Features */
.product-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.feature-item i {
    color: var(--primary-light);
    font-size: 1.2rem;
    margin-top: 2px;
}

.feature-content {
    flex: 1;
}

.feature-title {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.feature-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ============================================
   STORE AVAILABILITY SECTION
   ============================================ */
.store-availability {
    background: var(--bg-primary);
    border-radius: 15px;
    padding: 35px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.store-availability h2 {
    font-size: 1.8rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.store-availability h2 i {
    color: var(--primary-light);
}

/* City Info in Store Availability */
.city-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.city-info i {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.city-text {
    flex: 1;
}

.city-text .current {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.city-text .hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.change-city-btn {
    padding: 8px 20px;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-light);
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.change-city-btn:hover {
    background: var(--primary-lightest);
}

/* Stores Grid */
.stores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.store-card {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid var(--border-light);
    transition: all 0.3s;
    position: relative;
}

.store-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.store-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.store-name {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.store-address {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.store-address i {
    color: var(--primary-light);
    margin-top: 3px;
}

.store-status {
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.store-status.in-stock {
    background: var(--accent-green-light);
    color: var(--accent-green);
}

.store-status.low-stock {
    background: var(--accent-pink-light);
    color: var(--accent-pink);
}

.store-status.out-of-stock {
    background: var(--border-light);
    color: var(--text-light);
}

/* Store Badges Container */
.store-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* District Badge */
.district-badge {
    background: var(--accent-green);
    color: var(--bg-primary);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Store Logo */
.store-header-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.store-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.store-logo-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.store-logo-placeholder i {
    color: var(--primary-light);
    font-size: 1.5rem;
}

/* No shops message */
.no-shops-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.no-shops-message i {
    font-size: 3rem;
    color: var(--primary-light);
    margin-bottom: 15px;
    display: block;
}

.no-shops-message p {
    font-size: 1.1rem;
    margin: 0;
}

/* Show more stores button */
.show-more-stores {
    text-align: center;
    margin-top: 25px;
}

.btn-show-more {
    background: var(--primary-light);
    color: var(--bg-primary);
    border: none;
    padding: 14px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-show-more:hover:not(:disabled) {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-show-more:disabled {
    opacity: 0.7;
    cursor: wait;
}

.store-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin: 15px 0;
}

.store-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.store-info-item i {
    color: var(--primary-light);
    width: 20px;
}

.store-info-item .highlight {
    color: var(--accent-green);
    font-weight: 600;
}

.store-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.price-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.btn-small {
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-reserve {
    background: var(--primary-light);
    color: var(--bg-primary);
}

.btn-reserve:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

.btn-route {
    background: var(--bg-primary);
    color: var(--primary-color);
    border: 2px solid var(--primary-light);
}

.btn-route:hover {
    background: var(--primary-lightest);
}

/* ============================================
   MAP MODAL
   ============================================ */
.map-modal-content {
    max-width: 900px;
    max-height: 90vh;
}

.map-modal-content .modal-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    max-height: calc(90vh - 80px);
}

.map-info-bar {
    padding: 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.map-shop-info {
    flex: 1;
}

.map-shop-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.map-shop-address {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-open-external {
    padding: 10px 20px;
    background: var(--primary-light);
    color: var(--bg-primary);
    border: none;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-open-external:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

.yandex-map {
    width: 100%;
    height: 500px;
    position: relative;
}

.map-error {
    width: 100%;
    height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.map-error i {
    font-size: 3rem;
    color: var(--accent-red);
    margin-bottom: 15px;
}

.map-error p {
    font-size: 1.1rem;
}

/* Disabled route button */
.btn-route:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--border-light);
    border-color: var(--border-light);
}

.btn-route:disabled:hover {
    background: var(--border-light);
    transform: none;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .map-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .map-info-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-open-external {
        width: 100%;
        justify-content: center;
    }

    .yandex-map {
        height: 400px;
    }
}

.distance-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent-blue-light);
    color: var(--primary-dark);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ============================================
   PRODUCT TABS
   ============================================ */
.product-tabs {
    background: var(--bg-primary);
    border-radius: 15px;
    padding: 35px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.tabs-header {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.tab-button {
    padding: 12px 25px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.product-tabs .tab-content {
    display: none;
}

.product-tabs .tab-content.active {
    display: block;
    animation: fadeInTab 0.3s;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content h3 {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.tab-content p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 15px;
}

.tab-content ul {
    list-style: none;
    padding: 0;
}

.tab-content ul li {
    padding: 10px 0;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.tab-content ul li:before {
    content: "\2713";
    color: var(--accent-green);
    font-weight: bold;
    flex-shrink: 0;
}

/* Specifications Table */
.specifications-table {
    width: 100%;
    border-collapse: collapse;
}

.specifications-table tr {
    border-bottom: 1px solid var(--border-light);
}

.specifications-table td {
    padding: 15px 10px;
}

.specifications-table td:first-child {
    color: var(--text-muted);
    width: 40%;
}

.specifications-table td:last-child {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Error Report Button Footer */
.tab-content-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.btn-error-report {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.875rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-error-report:hover {
    color: var(--primary-color);
    background: var(--primary-lightest);
    border-color: var(--primary-lighter);
}

.btn-error-report i {
    font-size: 0.9rem;
}

/* ============================================
   SIMILAR PRODUCTS
   ============================================ */
.similar-products {
    background: var(--bg-primary);
    border-radius: 15px;
    padding: 35px;
    box-shadow: var(--shadow-lg);
}

.similar-products h2 {
    font-size: 1.8rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.products-slider {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-card-small {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    border: 1px solid var(--border-light);
}

.product-card-small:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-lighter);
}

.product-card-small .product-image-small {
    width: 100%;
    height: 180px;
    background: var(--bg-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
}

.product-card-small .product-image-small i {
    font-size: 3rem;
    color: var(--primary-light);
}

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

.product-card-small .product-name-small {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 1rem;
    line-height: 1.4;
}

.product-card-small .product-name-small a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.product-card-small .product-name-small a:hover {
    color: var(--primary-color);
}

.product-card-small .product-price-small {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.product-card-small .btn-small {
    width: 100%;
}

/* ============================================
   RESPONSIVE - Product Page
   ============================================ */
@media (max-width: 968px) {
    .product-main {
        grid-template-columns: 1fr;
        padding: 25px;
        gap: 30px;
    }

    .stores-grid {
        grid-template-columns: 1fr;
    }

    .main-image {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .product-page {
        padding: 20px 15px 30px;
    }

    .product-main {
        padding: 20px;
        gap: 25px;
    }

    .main-image {
        height: 300px;
    }

    .main-image i {
        font-size: 5rem;
    }

    .thumbnail-gallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .thumbnail {
        height: 70px;
    }

    .thumbnail i {
        font-size: 1.5rem;
    }

    .product-title {
        font-size: 1.5rem;
    }

    .product-subtitle {
        font-size: 1rem;
        margin-top: -5px;
    }

    .product-price-section {
        padding: 20px;
    }

    .price-main {
        font-size: 2rem;
    }

    .price-old {
        font-size: 1.1rem;
    }

    .product-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .btn-secondary {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .store-availability {
        padding: 25px 20px;
    }

    .store-availability h2 {
        font-size: 1.4rem;
    }

    .city-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .change-city-btn {
        width: 100%;
        text-align: center;
    }

    .store-card {
        padding: 15px;
    }

    .store-header {
        flex-direction: column;
        gap: 10px;
    }

    .store-header-left {
        flex-direction: row;
        align-items: flex-start;
    }

    .store-logo,
    .store-logo-placeholder {
        width: 40px;
        height: 40px;
    }

    .store-logo-placeholder i {
        font-size: 1.2rem;
    }

    .store-status {
        align-self: flex-start;
    }

    .store-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .store-actions {
        width: 100%;
    }

    .btn-reserve {
        flex: 1;
    }

    .product-tabs {
        padding: 25px 20px;
    }

    .tabs-header {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }

    .tab-button {
        padding: 10px 18px;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .tab-content h3 {
        font-size: 1.1rem;
    }

    .specifications-table td {
        padding: 12px 5px;
        font-size: 0.9rem;
    }

    .specifications-table td:first-child {
        width: 45%;
    }

    .similar-products {
        padding: 25px 20px;
    }

    .similar-products h2 {
        font-size: 1.4rem;
    }

    .products-slider {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-card-small {
        padding: 15px;
    }

    .product-card-small .product-image-small {
        height: 140px;
    }

    .product-card-small .product-image-small i {
        font-size: 2.5rem;
    }

    .product-card-small .product-name-small {
        font-size: 0.9rem;
    }

    .product-card-small .product-price-small {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .product-main {
        padding: 15px;
    }

    .main-image {
        height: 250px;
    }

    .main-image i {
        font-size: 4rem;
    }

    .product-title {
        font-size: 1.3rem;
    }

    .price-main {
        font-size: 1.8rem;
    }

    .feature-item {
        padding: 10px;
    }

    .feature-item i {
        font-size: 1rem;
    }

    .feature-title {
        font-size: 0.95rem;
    }

    .feature-text {
        font-size: 0.85rem;
    }

    .products-slider {
        grid-template-columns: 1fr;
    }

    .product-card-small .product-image-small {
        height: 160px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .product-main {
        gap: 30px;
        padding: 30px;
    }

    .main-image {
        height: 380px;
    }

    .stores-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
