/*
  public/css/product.css
  This file styles the new product page.
*/

/* --- 1. Main Layout --- */
.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* --- 2. Image Gallery --- */
.product-gallery .main-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 8px;
}
.product-gallery .thumbnails {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.product-gallery .thumb-item {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s, border-color 0.3s;
}
.product-gallery .thumb-item:hover {
    opacity: 1;
}
.product-gallery .thumb-item.active {
    opacity: 1;
    border-color: var(--primary-color);
}

/* --- 3. Purchase Box --- */
.product-purchase-box {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    background: #f9f9f9;
}
.product-purchase-box h1 {
    font-size: 2rem;
    color: var(--secondary-color);
    line-height: 1.2;
}
.product-purchase-box .product-sku {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 1rem;
}
.product-purchase-box .product-price-large {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.product-purchase-box .stock-level {
    font-weight: bold;
    font-size: 1.1rem;
}
.stock-level.in-stock { color: #5cb85c; }
.stock-level.low-stock { color: #f0ad4e; }
.stock-level.out-of-stock { color: #d9534f; }

.product-purchase-box .cart-form {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}
.cart-form .form-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cart-form input[type="number"] {
    width: 70px;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.cart-form .btn {
    flex-grow: 1;
}

/* --- 4. Tabbed Info --- */
.product-info-tabs {
    margin-top: 2rem;
    border-top: 2px solid var(--light-grey);
}
.tab-nav {
    display: flex;
    list-style: none;
    border-bottom: 1px solid #ddd;
}
.tab-nav .tab-link {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    border: none;
    background: none;
    color: #555;
    position: relative;
    top: 1px;
}
.tab-nav .tab-link.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}
.tab-content {
    display: none; /* Hide all content by default */
    padding: 1.5rem 0;
}
.tab-content.active {
    display: block; /* Show only the active one */
}
.tab-content h2 {
    margin-bottom: 1rem;
}
.tab-content ul {
    margin-left: 1.5rem;
}

/* --- 5. NEW SPECIFICATION LIST --- */
.spec-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 600px;
}
.spec-list li {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--light-grey);
}
.spec-list li:last-child {
    border-bottom: none;
}
.spec-list li strong {
    flex: 1; /* Key (e.g., "Brand") takes 1/3 space */
    min-width: 150px;
    color: #555;
}
.spec-list li span {
    flex: 2; /* Value (e.g., "Bosch") takes 2/3 space */
}

/* --- 6. Related Products --- */
.related-products {
    margin-top: 3rem;
    border-top: 2px solid var(--light-grey);
    padding-top: 2rem;
}
.related-products h2 {
    text-align: center;
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

/* --- 7. Responsive --- */
@media (max-width: 768px) {
    .product-layout {
        grid-template-columns: 1fr; /* Stack gallery and purchase box */
    }
    .product-purchase-box {
        order: -1; /* Move purchase box to the top on mobile */
    }
    .tab-nav .tab-link {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
    .spec-list li {
        flex-direction: column; /* Stack key/value on mobile */
        padding-bottom: 1rem;
    }
    .spec-list li strong {
        min-width: 0;
        margin-bottom: 0.25rem;
    }
}