/* === Global container style === */
#product-detail {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

/* === Main layout container === */
.product-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-start;
}


.product-images {
    flex: 1 1 70%;
    display: flex;
    flex-direction: row;
    gap: 16px;
}


.thumbnail-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}


.thumb-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid #ccc;
    transition: outline 0.2s ease;
}

/* Highlight thumbnail on hover or if active */
.thumb-img:hover,
.thumb-img.active {
    outline: 2px solid #000;
    outline-offset: 2px;
}


.main-image-wrapper {
    position: relative;
    width: 500px;
    height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Fade-in animation */
.main-img.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Image navigation arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    padding: 8px 12px;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 2;
    display: none;
}

.nav-arrow.left { left: 10px; }
.nav-arrow.right { right: 10px; }

/* === Product info section (right panel) === */
.product-info-panel {
    flex: 1 1 25%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-price {
    font-size: 1.8rem;
    font-weight: bold;
}

.product-category {
    font-size: 1rem;
    color: #444;
}

/* Stock status tags */
.stock-status span {
    font-size: 0.95rem;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 5px;
    display: inline-block;
}

.in-stock {
    color: #2e7d32;
    background-color: #e8f5e9;
}

.low-stock {
    color: #ef6c00;
    background-color: #fff3e0;
}

.out-of-stock {
    color: #c62828;
    background-color: #ffebee;
}

form {
    margin-top: 1rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

input[type="number"] {
    width: 60px;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 0.3rem;
    font-size: 1rem;
}

/* Submit button */
button[type="submit"] {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 0.3rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

button[type="submit"]:hover {
    background-color: #333;
}

/* Disabled button */
.disabled-btn {
    background-color: #ddd;
    color: #888;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.3rem;
    cursor: not-allowed;
    opacity: 0.8;
    box-shadow: inset 0 0 0 1px #bbb;
}

.btn-cart {
    margin-top: 12px;
    padding: 10px 20px;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    background-color: #f2f2f2;
    color: #000;
    cursor: pointer;
    margin-right: 10px;
}

.toggle-group {
    margin-top: 40px;
    padding-top: 20px;
    display: flex;
    width: 65%;
    flex-direction: column;
    gap: 10px;
}

.toggle-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: bold;
    color: #222;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.toggle-btn:hover {
    background-color: #f9f9f9;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-chevron {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.toggle-btn.open .toggle-chevron {
    transform: rotate(180deg);
}

.toggle-content {
    display: none;
    font-size: 0.95rem;
    color: #444;
    padding: 10px 15px;
    background: #f8f8f8;
    border-radius: 6px;
}

/* wishlist */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}

.wishlist-heart {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 2rem;
    color: #e8e7e7;
    transition: color 0.3s;
}

.wishlist-heart:hover {
    color: #ff0000;
}

.wishlist-heart.liked {
    color: #ff0000;
}

@media (max-width: 768px) {
    #product-detail {
        padding: 20px 12px;
        width: 100%;
    }

    .product-container {
        flex-direction: column;
        align-items: center;
    }

    .product-images {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .thumbnail-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        margin-bottom: 16px;
    }

    .main-image-wrapper {
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    .main-img {
        width: 100%;
        height: auto;
        max-height: 420px;
        border-radius: 8px;
    }

    .product-info-panel {
        width: 100%;
        padding: 16px;
        flex: none;
    }

    .product-price {
        font-size: 1.6rem;
    }

    .btn-cart {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .toggle-group {
        width: 100%;
        padding: 0 10px;
    }

    .toggle-btn {
        padding: 14px;
        font-size: 1rem;
    }

    .toggle-label {
        font-size: 1rem;
    }

    .toggle-content {
        font-size: 0.95rem;
        padding: 12px;
    }
}
.wishlist-action {
    margin-top: 1rem;
}

.wishlist-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 1rem;
    color: #000000;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: color 0.3s ease;
    text-decoration: none;
}

.wishlist-icon {
    text-decoration: none; /* prevent underline on the icon */
}

.wishlist-btn i.fa-heart {
    font-size: 1.5rem;
    color: #bbb;
    transition: color 0.3s ease;
}

.wishlist-btn:hover i.fa-heart {
    color: #ff0000;
}

.wishlist-btn.liked i.fa-heart {
    color: #ff0000;
}

.wishlist-text {
    text-decoration: underline; /* underline only this */
}

.btn-cart {
    background-color: #000;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
    border-radius: 5px;
}

.btn-cart:hover {
    background-color: #333;
}

/* Disabled state */
.disabled-btn {
    background-color: #ccc !important;
    color: #888 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    pointer-events: none;
}
