/* assets/css/products.css */

/* --- General Layout --- */
.page-header {
    background-color: #f7f9fc;
    padding: 2.5rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1e1b4b;
    /* Deep Indigo */
    margin-bottom: 0.5rem;
}

.breadcrumb {
    color: #6c757d;
    font-size: 0.9rem;
}

/* --- Product Grid --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Force 2 columns on mobile */
    gap: 10px;
    /* Tight gap for mobile */
    padding-bottom: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Home Specific Grid (Center aligned desktop) */
.products-grid.home-grid {
    justify-items: center;
    /* Center items in grid */
}

@media (min-width: 768px) {
    .products-grid.home-grid {
        display: flex;
        justify-content: center;
        gap: 2rem;
    }

    .products-grid {
        gap: 2rem;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

/* --- Product Card (Compact Premium) --- */
.product-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 280px;
    /* Max width for desktop */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08);
    border-color: #e5e7eb;
}

/* Badge */
.badge-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.badge-delivery {
    background-color: #10b981;
    color: white;
    font-size: 0.6rem;
    /* Smaller font */
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.badge-offer {
    background-color: #ff3b30;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Image */
.product-img-wrapper {
    position: relative;
    height: 160px;
    /* Reduced height */
    padding: 15px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img {
    max-height: 130px;
    width: auto;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.product-card:hover .product-img {
    transform: scale(1.1);
}

/* Content */
.product-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: center;
    justify-content: space-between;
}

.product-title {
    font-size: 0.95rem;
    /* Compact Title */
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
    height: 2.6em;
    /* Fixed height for alignment */
}

.product-title:hover {
    color: #6366f1;
}

/* Free Product Label */
.free-product-label {
    font-size: 0.75rem;
    color: #6a3da1;
    margin-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: 600;
    background: #eef2ff;
    padding: 2px 6px;
    border-radius: 4px;
    align-self: center;
}

/* Price */
.price-block {
    margin-bottom: 0.8rem;
}

.price-row {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.sales-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.mrp-price {
    font-size: 0.8rem;
    color: #94a3b8;
    text-decoration: line-through;
}

.discount-text {
    font-size: 0.75rem;
    color: #ef4444;
    font-weight: 700;
}

/* Button */
.btn-buy {
    width: 100%;
    background-color: #ffd814;
    color: #000;
    border: none;
    padding: 8px 0;
    /* Compact padding */
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-buy:hover {
    background-color: #f7ca00;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Specific Yellow Style for Buy Now */
.product-card .btn-buy {
    background-color: #ffd814;
    /* Amazon Yellow */
    color: #111;
    border: 1px solid #fcd200;
    font-weight: 600;
}

.product-card .btn-buy:hover {
    background-color: #f7ca00;
}


/* --- Product Details Page --- */
.product-detail-container {
    padding: 3rem 0;
    background: #fff;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

/* Gallery */
.gallery-main {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    background: #f9fafb;
}

.gallery-main img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 500px;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.thumb-item {
    width: 70px;
    height: 70px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    opacity: 0.6;
    transition: all 0.2s;
}

.thumb-item.active,
.thumb-item:hover {
    border-color: #4f46e5;
    opacity: 1;
    box-shadow: 0 0 0 1px #4f46e5;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Info */
.product-info h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #111;
}

.ratings {
    color: #fbaceb;
    /* Star color */
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.ratings i {
    color: #ffa41c;
}

.deal-badge {
    background: #cc0c39;
    color: #fff;
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 2px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.detail-price-block {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.huge-price {
    font-size: 2rem;
    font-weight: 500;
    color: #0f1111;
}

.free-prod-highlight {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.free-prod-highlight img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-add-cart {
    flex: 1;
    background: #ffd814;
    border: 1px solid #fcd200;
    color: #0f1111;
    padding: 12px;
    border-radius: 20px;
    font-weight: 600;
}

.btn-buy-now {
    flex: 1;
    background: #ffa41c;
    border: 1px solid #ff8f00;
    color: #0f1111;
    padding: 12px;
    border-radius: 20px;
    font-weight: 600;
}

.description-section {
    margin-top: 3rem;
}

.description-content {
    line-height: 1.6;
    color: #333;
}

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Homepage Section Styles --- */
.products-section {
    background-color: #fff;
    position: relative;
    padding-top: 4rem;
    padding-bottom: 4rem;
    margin-top: 3rem;
    /* Spacing from Hero */
}

/* Ensure margin applies on mobile too */
@media (max-width: 768px) {
    .products-section {
        padding-top: 2rem;
        padding-bottom: 2rem;
        margin-top: 2rem;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    width: 100%;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1e1b4b;
    /* Deep Indigo */
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
}



.section-subtitle {
    color: #64748b;
    /* Slate 500 */
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* View All Button */
.btn-view-all-wrapper {
    text-align: center;
    margin-top: 3rem;
}

.btn-view-all {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 35px;
    background: transparent;
    border: 2px solid #1e1b4b;
    color: #1e1b4b;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-view-all:hover {
    background: #1e1b4b;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(30, 27, 75, 0.2);
}

.btn-view-all i {
    transition: transform 0.3s ease;
}

.btn-view-all:hover i {
    transform: translateX(5px);
}

@media (max-width: 768px) {
    .section-title {
        font-size: 1.75rem;
    }

    .section-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }
}

/* --- Reviews Section --- */
.section-heading {
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-size: 1.5rem;
    color: #1e1b4b;
    font-weight: 700;
}

/* Footer Fix */
.product-detail-container {
    padding-bottom: 4rem;
}

.reviews-container {
    display: grid;
    grid-template-columns: 300px 1fr 380px;
    gap: 3rem;
    align-items: start;
}

/* Rating Summary */
.rating-summary {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 12px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

/* Review Form Wrapper (In Grid) */
.review-form-wrapper {
    background: #fff;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.review-form-wrapper .form-header h4 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 0.5rem;
}

.average-rating {
    text-align: center;
    margin-bottom: 1.5rem;
}

.rating-number {
    font-size: 3.5rem;
    font-weight: 800;
    color: #1e1b4b;
    line-height: 1;
    display: block;
}

.average-rating .stars {
    color: #ffd700;
    font-size: 1.2rem;
    margin: 5px 0;
}

.total-reviews {
    color: #64748b;
    font-size: 0.9rem;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #475569;
}

.progress-bar {
    flex-grow: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: #ffd700;
    border-radius: 4px;
}

/* Review List */
.review-card {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.review-card:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.user-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: #6366f1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.user-name {
    font-weight: 600;
    color: #1e293b;
}

.review-date {
    font-size: 0.8rem;
    color: #94a3b8;
}

.review-rating {
    color: #ffd700;
    font-size: 0.9rem;
}

.review-text {
    color: #334155;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.review-images {
    display: flex;
    gap: 10px;
}

.review-images img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
}

/* --- Mobile Responsiveness --- */
/* --- Global Product Card Customization (Green Theme) --- */
.product-card .free-product-label {
    background: #10b981;
    color: #fff;
    width: 100%;
    justify-content: center;
    white-space: normal;
    padding: 4px 8px;
    line-height: 1.2;
    text-align: center;
}

.product-card .free-product-label i {
    color: #fff;
}

.product-card .btn-buy {
    background-color: #ffd814;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.product-card .btn-buy:hover {
    background-color: #f7ca00;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .product-detail-container {
        padding: 1.5rem 0;
    }

    .detail-grid {
        gap: 2rem;
    }

    /* Hide Section Header on Mobile */
    .section-header {
        display: none;
    }

    .gallery-main img {
        max-height: 350px;
    }

    .product-info h1 {
        font-size: 1.5rem;
    }

    .huge-price {
        font-size: 1.8rem;
    }

    .detail-price-block {
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    /* Stack Reviews */
    .reviews-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Reset sticky for mobile */
    .rating-summary,
    .review-form-wrapper {
        position: static;
    }
}

/* --- Premium Review Form --- */
.review-form-wrapper {
    background: #fff;
    padding: 2.5rem;
    border-radius: 16px;
    margin-bottom: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.review-form-wrapper .form-header h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 0.5rem;
}

/* Star Rating Widget */
.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 10px;
}

.star-rating-input input {
    display: none;
}

.star-rating-input label {
    cursor: pointer;
    font-size: 2rem;
    color: #cbd5e1;
    transition: color 0.2s;
}

.star-rating-input label:hover,
.star-rating-input label:hover~label,
.star-rating-input input:checked~label {
    color: #ffd700;
}

/* Form Fields */
.form-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #334155;
    margin-bottom: 8px;
    display: block;
}

.review-form-wrapper .form-control {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s;
}

.review-form-wrapper .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    height: 100px;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    transition: all 0.3s;
}

.file-upload-wrapper:hover {
    border-color: #6366f1;
    background: #eff6ff;
}

.file-upload-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-upload-box {
    text-align: center;
    color: #64748b;
    z-index: 1;
}

.file-upload-box i {
    font-size: 1.5rem;
    display: block;
    color: #6366f1;
}

/* Submit Button */
.btn-submit-review {
    background: #1e1b4b;
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 600;
    width: 100%;
    font-size: 1.1rem;
    margin-top: 1rem;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-submit-review:hover {
    background: #312e81;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(30, 27, 75, 0.2);
}

/* --- Write Review Button (Professional) --- */
.btn-write-review {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
    text-transform: capitalize;
    letter-spacing: 0.3px;
}

.btn-write-review:hover {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(79, 70, 229, 0.3);
}

.btn-write-review:active {
    transform: translateY(0);
}

.btn-write-review i {
    font-size: 0.9rem;
}