* {
    box-sizing: border-box;
}

/* Product page(single) */
.product-page-container {
    padding: 40px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Breadcrumbs */
.navigation {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #777;
}
.navigation a { text-decoration: none; color: var(--secondary-dark); margin: 0 5px; }
.navigation span { color: #ccc; }
.navigation .current{ color: #003738; font-weight: bold;}

/* Main Content Layout */
.product-main-content {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
}

.details {
    flex: 1.2;
    min-width: 350px; /* This is overridden in the @media query for mobile */
}

.details h1 {
    text-align: right;
    margin: 0 0 30px 0;
    font-size: 1.8rem;
}

.details h1:after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--secondary-dark);
    margin: 10px 0 0 auto; /* Aligns line to the right for RTL */
}

/* Right Side: Images */
.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 500px;
    flex: 1;
}

.main-image {
    width: 100%;
    aspect-ratio: 4 / 3; 
    background-color: #fcfcfc;
    border-radius: 12px;
    border: 1px solid #eee;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    padding: 10px;
    transition: transform 0.3s ease;
}

.thumbnails {
    display: flex;
    gap: 10px;
    padding-bottom: 5px;
    overflow-x: auto;
}

.thumb {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
    background: #fff;
}

.thumb:hover {
    border-color: var(--secondary-dark);
}

/* Product Info Section */
.product-info-section {
    margin-top: 40px;
    background: white;
    border-radius: 12px;
    border: 1px solid #eee;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.info-tabs {
    background-color: #fcfcfc;
    border-bottom: 1px solid #eee;
    display: flex;
}

.tab-btn {
    padding: 15px 30px;
    background: none;
    border: none;
    border-bottom: 3px solid var(--primary-dark);
    color: var(--primary-dark);
    font-weight: bold;
    font-size: 1rem;
    cursor: default;
}

.info-content {
    padding: 30px;
}

.description-text {
    line-height: 1.8;
    color: #444;
    font-size: 0.95rem;
    text-align: justify;
}

/* Form Styling */
.order-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group select{
    color: #6c757d;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--primary-dark);
}

select, input[type="number"], textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    background-color: #fff;
    outline: none;
    box-sizing: border-box;
    font-family: 'Vazirmatn FD', sans-serif;
}


select:focus, textarea:focus { 
    border-color: var(--secondary-dark); 
    box-shadow: 0 0 0 3px rgba(0, 34, 35, 0.1);
}

select:invalid {
    color: #999;
}
option {
    color: #000;
}

/* Custom File Upload */
#file-upload {
    opacity: 0;
    position: absolute;
    z-index: -1;
    width: 0.1px;
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    background-color: #fff;
    border: 2px dashed var(--secondary-dark);
    color: var(--secondary-dark);
    padding: 30px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.file-label:hover {
    background-color: #f0f7f7;
    border-style: solid;
}

/* Force the text input to match your number input design */
.custom-number-style {
    background-color: #f8f9fa !important;
    cursor: not-allowed;
    color: #6c757d;
    font-family: 'Vazirmatn', sans-serif !important;
    direction: ltr;
    text-align: right;
    
    /* These properties ensure it matches standard form-control heights */
    height: 45px; /* Adjust based on your other inputs */
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border: 1px solid #ced4da;
    border-radius: 8px;
}

/* Receipt Box */
.receipt-box {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #666;
}

.receipt-row.total {
    color: var(--primary-dark);
    font-weight: bold;
    font-size: 1.15rem;
    margin-top: 15px;
    border-top: 1px dashed #ddd;
    padding-top: 15px;
}

.submit-btn {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background-color: var(--primary-dark);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 15px;
}

.submit-btn:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-2px);
}

/* RESPONSIVE FIXES */
@media (max-width: 850px) {
    .product-page-container {
        padding: 15px 15px;
    }

    .product-main-content {
        flex-direction: column; /* Stack vertically */
        gap: 25px;
    }

    .details {
        width: 100%;
        min-width: 0; /* CRITICAL: Allows form to shrink below 350px */
        order: 2;
    }

    .product-gallery {
        max-width: 100%;
        order: 1; /* Image on top */
    }

    .form-row {
        grid-template-columns: 1fr; /* Stack Select inputs on top of each other */
        gap: 15px;
    }

    .main-image {
        aspect-ratio: 1 / 1; /* Square is better for mobile space */
    }

    .receipt-box {
        padding: 15px;
    }

    .receipt-row {
        font-size: 0.9rem;
    }

    .receipt-row.total {
        font-size: 1.05rem;
        flex-wrap: wrap; /* Prevents long price text from breaking the box */
    }

    .info-content {
        padding: 20px;
    }

    .product-info-section {
        order: 3; /* Description at very bottom */
    }
}

