/* static/css/pages/product_detail.css */
/* ====================================================
   PRODUCT DETAIL PAGE SPECIFIC STYLES
   ==================================================== */

/* ====================================================
   BREADCRUMB
   ==================================================== */
.breadcrumb {
    padding: 0.75rem 0;
    background: var(--white);
    border-bottom: 1px solid var(--light-gray);
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.breadcrumb-list li {
    display: inline;
}

.breadcrumb-list li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--dark-charcoal);
    opacity: 0.5;
}

.breadcrumb-list a {
    color: var(--primary-blue);
    text-decoration: none;
}

.breadcrumb-list a:hover {
    text-decoration: underline;
}

.breadcrumb-list [aria-current="page"] {
    color: var(--dark-charcoal);
    opacity: 0.7;
}

/* ====================================================
   PRODUCT DETAIL GRID
   ==================================================== */
.product-detail {
    padding: 2rem 0;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

/* ====================================================
   GALLERY
   ==================================================== */
.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gallery-main {
    background: var(--light-blue-bg);
    border-radius: 0.75rem;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
}

.gallery-thumbnails {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.thumbnail-btn {
    width: 60px;
    height: 60px;
    border: 2px solid var(--light-gray);
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: var(--white);
    transition: border-color var(--transition-fast);
}

.thumbnail-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.25rem;
}

.thumbnail-btn:hover {
    border-color: var(--primary-blue);
}

.thumbnail-btn.active {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 59, 128, 0.2);
}

/* ====================================================
   PRODUCT INFO
   ==================================================== */
.product-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--dark-charcoal);
    margin: 0 0 0.5rem;
}

.product-price-stock {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.product-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.product-stock {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.2rem 0.8rem;
    border-radius: 2rem;
}

.product-stock.in-stock {
    color: var(--dark-green);
    background: var(--light-green-bg);
}

.product-stock.out-of-stock-text {
    color: #991B1B;
    background: #FEE2E2;
}

.product-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--dark-charcoal);
    opacity: 0.85;
    margin-bottom: 1.5rem;
}

.divider {
    border: none;
    border-top: 1px solid var(--light-gray);
    margin: 1.5rem 0;
}

/* ====================================================
   QUANTITY SELECTOR
   ==================================================== */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.quantity-selector label {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--dark-charcoal);
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--light-gray);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
    color: var(--dark-charcoal);
}

.qty-btn:hover {
    background: var(--light-blue-bg);
}

.qty-btn:active {
    transform: scale(0.95);
}

.quantity-control input {
    width: 50px;
    height: 36px;
    border: none;
    border-left: 1px solid var(--light-gray);
    border-right: 1px solid var(--light-gray);
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-family);
    color: var(--dark-charcoal);
    background: var(--white);
    -moz-appearance: textfield;
    appearance: textfield;
}

.quantity-control input::-webkit-inner-spin-button,
.quantity-control input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stock-info {
    font-size: 0.85rem;
    color: var(--dark-charcoal);
    opacity: 0.7;
}

.add-to-cart-submit {
    width: 100%;
    max-width: 300px;
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* ====================================================
   PRODUCT EXTRAS (Trust badges)
   ==================================================== */
.product-extras {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
}

.extra-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--dark-charcoal);
    opacity: 0.8;
}

.extra-item svg {
    flex-shrink: 0;
    color: var(--primary-green);
}

/* ====================================================
   RELATED PRODUCTS
   ==================================================== */
.related-products {
    padding: 2rem 0 3rem;
    border-top: 1px solid var(--light-gray);
}

.related-products .section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-charcoal);
    margin-bottom: 1.5rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
}

.related-card .product-image {
    aspect-ratio: 1 / 1;
    background: var(--light-blue-bg);
    overflow: hidden;
}

.related-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.related-card:hover .product-image img {
    transform: scale(1.05);
}

.related-card .product-info {
    padding: 0.5rem 0.75rem 0.75rem;
    text-align: center;
}

.related-card .product-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--dark-charcoal);
    margin: 0 0 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4rem;
}

.related-card .product-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-blue);
}

/* ====================================================
   RESPONSIVE BREAKPOINTS
   ==================================================== */
@media (max-width: 1024px) {
    .product-detail-grid {
        gap: 2rem;
    }
    .product-title {
        font-size: 1.6rem;
    }
    .product-price {
        font-size: 1.5rem;
    }
    .related-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .product-gallery {
        order: -1;
    }
    .gallery-main {
        aspect-ratio: 1 / 1;
        max-height: 400px;
    }
    .thumbnail-btn {
        width: 50px;
        height: 50px;
    }
    .product-title {
        font-size: 1.4rem;
    }
    .product-price {
        font-size: 1.3rem;
    }
    .add-to-cart-submit {
        max-width: 100%;
    }
    .related-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }
    .breadcrumb-list {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .product-detail {
        padding: 1rem 0;
    }
    .gallery-main {
        max-height: 300px;
    }
    .thumbnail-btn {
        width: 40px;
        height: 40px;
    }
    .product-title {
        font-size: 1.2rem;
    }
    .product-price {
        font-size: 1.1rem;
    }
    .quantity-control {
        width: 100%;
    }
    .quantity-control input {
        flex: 1;
    }
    .stock-info {
        width: 100%;
        text-align: center;
    }
    .product-extras {
        gap: 0.75rem;
    }
    .extra-item {
        font-size: 0.85rem;
    }
    .related-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    .related-card .product-name {
        font-size: 0.8rem;
        min-height: 2rem;
    }
    .related-card .product-price {
        font-size: 0.9rem;
    }
}

.variant-btn {
    cursor: pointer;
}
.variant-btn.active {
    border-color: var(--primary-blue, #2563eb);
    background: var(--light-blue-bg, #eef4ff);
    font-weight: 600;
}