/*
 * The page of a product. From the inline styles of catalog/detail.php of the old site (.product-detail, .product-gallery,
 * .main-photo, .thumb-grid, .product-info, .stock-status, .quantity-selector, .btn-add-to-cart, .tech-specs); the
 * accordion comes from base.css. The thumbnails are buttons so they work with the keyboard.
 */

.product-breadcrumbs {
    padding: 24px 80px 0;
}

.product-breadcrumbs .breadcrumbs {
    padding: 0;
}

.product-detail {
    padding: 40px 80px 60px;
    display: flex;
    gap: 60px;
    flex-wrap: wrap;
}

.product-gallery {
    flex: 1.2;
    min-width: 280px;
}

.main-photo {
    width: 100%;
    background: #f9f9f9;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
}

.main-photo img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    background: #fff;
}

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.thumb-item {
    aspect-ratio: 1 / 1;
    padding: 0;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #eaeaea;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-item.active {
    border: 2px solid #000;
}

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

.product-info .product-title {
    font-size: 36px;
    font-weight: 300;
    margin-bottom: 8px;
}

.product-info .product-sku {
    font-size: 14px;
    color: #777;
    margin-bottom: 16px;
}

.product-info .product-price {
    font-size: 32px;
    font-weight: 500;
    margin: 20px 0;
}

/*
 * The choice of the finish (wave 13.6): links to the pages of the variants, drawn as the buttons of the filter (a pill with a thin
 * border, black when chosen). The target is at least 44 px, the focus ring is the one of the filter, the buttons wrap into rows.
 */
.finish-pick {
    margin-bottom: 24px;
}

.finish-title {
    font-size: 14px;
    color: #777;
    margin-bottom: 8px;
}

.finish-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}

.finish-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 20px;
    border: 1px solid #ddd;
    border-radius: 40px;
    font-size: 14px;
    color: #1a1a1a;
    text-align: center;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: border-color 0.14s;
}

.finish-btn:hover {
    border-color: #000;
}

.finish-btn[aria-current="page"] {
    background: #000;
    border-color: #000;
    color: #fff;
    font-weight: 500;
}

.finish-btn:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.stock-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    color: #2b7e3a;
    font-weight: 500;
}

.stock-status.on-order {
    color: #8a6d1d;
}

.stock-status.out-of-stock {
    color: #666;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.qty-input {
    width: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
}

.cart-buttons {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-add-to-cart {
    background: #000;
    color: #fff;
    border: none;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 40px;
    cursor: pointer;
}

.btn-add-to-cart:disabled {
    opacity: 0.6;
    cursor: default;
}

.product-info .accordion {
    margin-top: 40px;
}

.accordion-content p + p {
    margin-top: 12px;
}

.tech-specs {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tech-specs td {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.tech-specs td:first-child {
    color: #777;
    width: 55%;
    padding-right: 16px;
}

.tech-specs td:last-child {
    color: #1a1a1a;
    font-weight: 500;
}

@media (max-width: 1024px) {
    .product-breadcrumbs {
        padding: 20px 30px 0;
    }

    .product-detail {
        padding: 30px;
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .product-info .product-title {
        font-size: 28px;
    }
}

/* On a phone the button "Add to cart" stays at the bottom of the screen while the buyer reads the product (stage 23, wave 23.13, У4). */
@media (max-width: 768px) {
    .cart-buttons {
        position: sticky;
        bottom: 0;
        z-index: 50;
        margin: 0 -15px;
        padding: 12px 15px;
        background: #fff;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    }

    .btn-add-to-cart {
        flex: 1;
        min-height: 48px;
    }
}

/* A product not in stock: the phone of the manager and the section of the product, not a dead end (stage 23, wave 23.11, П7). */
.product-info .help-line {
    margin: 12px 0;
}

.stock-out-section {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: #000;
}

/* The delivery and the guarantee by the price; the main photo opens whole (stage 23, wave 23.14, У5). */
.buy-facts {
    margin: 0 0 20px;
    font-size: 14px;
    color: #595959;
}

.buy-facts p + p {
    margin-top: 4px;
}

.buy-facts a {
    color: #000;
}

.main-photo-link {
    display: block;
    cursor: zoom-in;
}

/* The article of the product dark enough for 4.5:1 (stage 23; this file comes after base.css and wins over it). */
.product-info .product-sku {
    color: #595959;
}
