/* ========== Product Detail Page ========== */

.discount-badge-detail {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: #ef4444;
    color: white;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 800;
    border-radius: 0;
    z-index: 10;
}

.product-price-detail {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.old-price-detail {
    font-size: 18px;
    color: #9ca3af;
    text-decoration: line-through;
    opacity: 0.85;
}

.new-price-detail {
    font-size: 28px;
    font-weight: 800;
    color: #10b981;
}

.product-thumbnails {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
    flex-wrap: wrap;
    overflow-x: auto;
    padding-bottom: 10px;
}

.thumbnail-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
    flex-shrink: 0;
}

.thumbnail-img:hover {
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.product-detail-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 28px;
    background-color: white;
    border-radius: 0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    box-sizing: border-box;
}

.product-image-section {
    width: 100%;
    text-align: center;
    margin-bottom: 30px;
}

.main-product-image {
    position: relative;
    overflow: hidden;
    width: 70%;
    margin-bottom: 15px;
}

.main-product-image img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 0;
    display: block;
    transition: transform 0.3s ease;
}

.main-product-image:hover img {
    transform: scale(1.02);
}

.product-info-section {
    width: 100%;
    color: #111;
}

.product-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #0f1720;
    line-height: 1.2;
}

.product-description {
    font-size: 16px;
    margin-bottom: 18px;
    color: #555;
    line-height: 1.6;
}

/* --- NEW: Action Grouping --- */
.product-actions-group {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: stretch; /* Ensures forms stretch to similar height if needed */
}

.action-form {
    flex: 1;
    min-width: 200px; /* Increased min-width for a more substantial look */
}

/* Specific Buy Now form styling to group quantity */
.buy-now-form {
    padding: 15px; /* Added internal padding */
    border: 2px solid #e5e7eb; /* Subtle border for separation */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn {
    padding: 12px 18px;
    background-color: #10b981;
    color: white;
    border: none;
    border-radius: 0;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    font-size: 15px;
    box-sizing: border-box;
}

.btn:hover {
    background-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.add-to-cart-btn {
    background-color: #10b981;
    margin-top: 15px; /* Align with Order Now button vertically */
    width: 100%;
    padding-top: 50px;
    padding-bottom: 50px;
}

.add-to-cart-btn:hover {
    background-color: #059669;
}

.buy-now-btn {
    background-color: #111827;
}

.buy-now-btn:hover {
    background-color: #0b1220;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.share-btn-detail {
    background-color: transparent;
    margin-bottom: 24px; /* Separating from details section */
    flex: 1 1 100%; /* Make it full width below the main actions */
    min-width: auto;
    max-width: 100%;
    border: 2px solid #10b981;
    color: #10b981;
}

.share-btn-detail:hover {
    background-color: #2e0d0d1a;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.product-details h4,
.product-reviews h4 {
    margin-top: 28px;
    font-size: 18px;
    font-weight: 800;
    border-bottom: 2px solid #10b981;
    display: inline-block;
    margin-bottom: 16px;
    padding-bottom: 6px;
}

.product-details ul {
    list-style-type: none;
    padding-left: 0;
}

.product-details li {
    margin-bottom: 10px;
    font-size: 15px;
    color: #333;
    line-height: 1.4;
}

.product-details li strong {
    color: #0f1720;
    font-weight: 700;
}

.review {
    background-color: #f9fafb;
    padding: 14px;
    border-radius: 0;
    margin-bottom: 12px;
    border-left: 4px solid #10b981;
}

.review strong {
    color: #000;
    font-weight: 700;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    font-size: 16px;
    margin: 15px 20px;
    color: #444;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb a {
    color: #000;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #10b981;
    font-weight: 600;
}

/* ---------- Desktop Layout ---------- */
@media (min-width: 769px) {
    .product-detail-container {
        display: flex;
        gap: 48px;
        align-items: flex-start;
    }
    
    .product-image-section {
        flex: 1;
        max-width: 50%;
        margin-bottom: 0;
    }
    
    .product-info-section {
        flex: 1;
        max-width: 50%;
    }

    /* Stack Add to Cart above Buy Now */
    .product-actions-group {
        flex-direction: column;
        gap: 15px;
    }

    .action-form {
        width: 100%;
        min-width: auto;
    }
    
    /* Ensure Buy Now form is slightly wider or more prominent */
    .buy-now-form {
        order: -1; /* Place Buy Now above Add to Cart */
    }

    .add-to-cart-form {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .add-to-cart-btn {
        margin-top: 0; /* Remove top margin when using flex column */
    }
}

/* ---------- Mobile Layout ---------- */
@media (max-width: 768px) {
    .product-detail-container {
        padding: 16px;
        margin: 20px auto;
        width: calc(100% - 20px);
        display: block;
    }

    .product-image-section,
    .product-info-section {
        width: 100%;
        max-width: 100%;
    }

    .product-actions-group {
        flex-direction: column;
        gap: 15px;
    }

    .action-form,
    .share-btn-detail {
        width: 100%;
        min-width: auto;
    }

    .product-title {
        font-size: 24px;
    }

    .product-price-detail {
        gap: 8px;
    }

    .product-price-detail .new-price-detail {
        font-size: 24px;
    }

    .product-price-detail .old-price-detail {
        font-size: 16px;
    }

    .discount-badge-detail {
        top: 8px;
        right: 8px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .thumbnail-img {
        width: 70px;
        height: 70px;
    }

    .breadcrumb {
        margin: 10px;
        font-size: 14px;
    }
    
    .buy-now-form {
        order: -1; /* Place Buy Now above Add to Cart on mobile too */
    }
}

@media (max-width: 480px) {
    .product-detail-container {
        padding: 12px;
        margin: 10px auto;
        width: calc(100% - 10px);
    }

    .product-title {
        font-size: 22px;
    }

    .product-description {
        font-size: 15px;
    }

    .product-price-detail .new-price-detail {
        font-size: 22px;
    }

    .product-price-detail .old-price-detail {
        font-size: 15px;
    }

    .btn {
        padding: 14px 18px;
        font-size: 16px;
    }

    .thumbnail-img {
        width: 60px;
        height: 60px;
    }

    .breadcrumb {
        font-size: 13px;
    }
}



/* ========== Quantity Selector (Updated) ========== */
.quantity-selector {
    /* Removed padding/background from previous design as it's now inside .buy-now-form */
    margin-bottom: 0;
    padding: 0;
    background-color: transparent;
    border-left: none;
    flex-grow: 1; /* Allow it to take up available space in the form */
}

.quantity-selector label {
    display: block;
    margin-bottom: 12px;
    font-size: 16px;
    color: #111827;
    font-weight: 700;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px; /* Reduced gap slightly for professional look */
    margin-bottom: 15px;
    justify-content: flex-start; /* Align left */
}

.quantity-btn {
    width: 38px;
    height: 38px;
    border: 2px solid #10b981;
    background-color: white;
    color: #10b981;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background-color: #10b981;
    color: white;
}

.quantity-input {
    width: 70px; /* Adjusted width */
    height: 38px;
    text-align: center;
    border: 2px solid #e5e7eb;
    border-radius: 0;
    font-size: 16px;
    font-weight: 600;
    padding: 0 8px;
}

.quantity-input:focus {
    outline: none;
    border-color: #10b981;
}

.quantity-price {
    font-size: 18px;
    font-weight: 700;
    color: #10b981;
    text-align: left; /* Aligned left for professionalism */
    padding-top: 5px;
    border-top: 1px dashed #e5e7eb;
    margin-top: 10px;
}

/* Mobile adjustments for quantity selector */
@media (max-width: 768px) {
    .quantity-selector {
        padding: 0;
    }
    
    .quantity-controls {
        justify-content: center; /* Center controls on mobile for better touch target */
    }
    
    .quantity-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .quantity-input {
        width: 70px;
        height: 36px;
    }
    
    .quantity-price {
        font-size: 16px;
        text-align: center;
    }
    
    .buy-now-form {
        padding: 10px;
    }
}