/* Product Detail Specific Styles */

/* Breadcrumb */
.breadcrumb {
    background-color: var(--gray-100);
    padding: var(--spacing-md) 0;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.review-author {
    font-weight: 600;
}

.verified-badge {
    display: inline-block;
    padding: 2px 6px;
    background-color: var(--primary);
    color: white;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 5px;
}

.review-content {
    margin-bottom: 15px;
    line-height: 1.5;
}

.review-feedback {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.btn-helpful {
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-helpful:hover:not(:disabled) {
    background-color: #f5f5f5;
}

.btn-helpful.active {
    background-color: #f0f0f0;
    border-color: var(--primary);
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 5px;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(.disabled) {
    background-color: #f5f5f5;
}

.pagination-btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Related Products */
.related-products {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e0e0e0;
}

.related-products h2 {
    margin-bottom: 30px;
    text-align: center;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.product-card .product-image {
    height: 200px;
    overflow: hidden;
}

.product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-card .product-info {
    padding: 15px;
}

.product-card h3 {
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.product-card p {
    color: var(--gray-600);
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.product-card .product-price {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.product-card .product-actions {
    display: flex;
    gap: 10px;
}

.product-card .product-actions a,
.product-card .product-actions button {
    flex: 1;
    text-align: center;
    padding: 8px 0;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .product-detail {
        grid-template-columns: 1fr;
    }
    
    .product-gallery {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .reviews-summary {
        flex-direction: column;
        gap: 20px;
    }
    
    .reviews-controls {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .tab-buttons {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1 1 auto;
        text-align: center;
    }
    
    .directions-content,
    .ingredients-list,
    .benefits-list {
        grid-template-columns: 1fr;
    }
    
    .product-meta {
        flex-direction: column;
    }
    
    .meta-item {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .product-price {
        font-size: 1.2rem;
    }
    
    .add-to-cart-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .quantity-selector {
        width: 100%;
        justify-content: center;
        margin-right: 0;
    }
    
    .add-to-cart {
        width: 100%;
    }
    
    .reviews-controls {
        flex-direction: column;
    }
    
    .reviews-sort {
        width: 100%;
    }
    
    .write-review-btn {
        width: 100%;
    }
}rem;
}

.breadcrumb a {
    color: var(--gray-600);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb span {
    color: var(--gray-800);
    font-weight: 600;
}

/* Product Detail */
.product-detail {
    display: grid;
    grid-template-columns: minmax(300px, 45%) 1fr;
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-2xl);
}

/* Product Gallery */
.product-gallery {
    max-width: 100%;
    position: relative;
}

.product-gallery .main-image {
    height: 400px;
    background-color: #f8f8f8;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-gallery .main-image img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border: 2px solid transparent;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.thumbnail.active {
    border-color: var(--primary);
}

.thumbnail:hover:not(.active) {
    border-color: var(--gray-300);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Gallery Navigation */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.gallery-nav.prev {
    left: 10px;
}

.gallery-nav.next {
    right: 10px;
}

.main-image:hover .gallery-nav {
    opacity: 1;
}

.gallery-nav:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

/* Animation for gallery */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Product Info */
.product-info {
    padding: var(--spacing-md) 0;
}

.product-title {
    color: var(--gray-900);
    margin-bottom: var(--spacing-xs);
    font-size: 2rem;
}

.product-subtitle {
    color: var(--gray-700);
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
}

.product-rating {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.stars {
    color: #FFD700;
    margin-right: var(--spacing-sm);
}

.rating-value {
    font-weight: 600;
    margin-right: var(--spacing-sm);
}

.rating-count {
    color: var(--gray-600);
}

.product-price {
    margin: var(--spacing-md) 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.regular-price {
    text-decoration: line-through;
    color: var(--gray-500);
    margin-right: var(--spacing-sm);
    font-size: 1.2rem;
}

.current-price {
    color: var(--primary);
}

.product-description {
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
}

/* Purchase Options */
.purchase-options {
    margin-bottom: var(--spacing-lg);
}

.option-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.option-button {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-button input[type="radio"] {
    margin-right: 15px;
}

.option-button.active {
    border-color: var(--primary);
    background-color: rgba(0, 128, 0, 0.05);
}

.option-content {
    display: flex;
    flex-direction: column;
}

.option-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.option-price {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.option-description {
    font-size: 0.9rem;
    color: var(--gray-600);
}

.subscription-details {
    display: none;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* Quantity Selector and Add to Cart Button */
.add-to-cart-row {
    display: flex;
    align-items: center;
    margin-top: 20px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    width: fit-content;
    margin-right: 15px;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: #e0e0e0;
}

.quantity-selector input {
    width: 40px;
    text-align: center;
    border: none;
    height: 36px;
    font-weight: 600;
}

.quantity-selector input::-webkit-outer-spin-button,
.quantity-selector input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.add-to-cart {
    height: 42px;
    padding: 8px 20px 20px;
}

/* Product Meta (Benefits) */
.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.meta-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
    flex: 1 1 200px;
}

.meta-item i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-right: 15px;
}

.meta-content {
    display: flex;
    flex-direction: column;
}

.meta-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.meta-description {
    font-size: 0.9rem;
    color: var(--gray-600);
}

/* Product Tabs */
.product-tabs {
    margin-top: 40px;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}

.tab-buttons::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    color: #666;
    white-space: nowrap;
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

/* Ingredients Tab */
.ingredients-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.ingredient-item {
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.ingredient-image {
    height: 180px;
    overflow: hidden;
}

.ingredient-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ingredient-info {
    padding: 15px;
}

.ingredient-info h3 {
    margin-bottom: 10px;
    color: var(--primary);
}

/* Benefits Tab */
.benefits-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.benefit-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-right: 15px;
}

.benefit-content h3 {
    margin-bottom: 10px;
    color: var(--gray-800);
}

/* Directions Tab */
.directions-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.directions-info h3, .supplement-facts h3 {
    margin-bottom: 15px;
    color: var(--primary);
}

.facts-table {
    width: 100%;
    border-collapse: collapse;
}

.facts-table th, .facts-table td {
    padding: 8px;
    border: 1px solid #e0e0e0;
}

.facts-table th {
    background-color: #f5f5f5;
}

.facts-note {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--gray-600);
}

/* FAQs Tab */
.faq-item {
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 15px;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    cursor: pointer;
}

.faq-question h3 {
    margin: 0;
    flex-grow: 1;
}

.faq-toggle {
    margin-left: 15px;
    transition: transform 0.3s ease;
    min-width: 24px;
    text-align: center;
}

.faq-item.active .faq-toggle i {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 0 15px;
    display: none;
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 0;
}

.faq-answer p {
    margin-top: 0;
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    display: block;
}

/* Reviews Tab */
.reviews-header {
    margin-bottom: 30px;
}

.reviews-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-top: 20px;
}

.average-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rating-number {
    font-size: 2rem;
    font-weight: 700;
}

.reviews-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.reviews-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.review-item {
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.review-stars {
    color: #FFD700;
}

.review-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.review-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9
}

/* Mobile Responsive Styles for Product Detail Page */

/* Base responsive adjustments */
@media (max-width: 1024px) {
    .product-detail {
        grid-template-columns: 1fr;
    }
    
    .product-gallery {
        max-width: 500px;
        margin: 0 auto 30px;
    }
    
    .product-info {
        padding-top: 0;
    }
}

@media (max-width: 768px) {
    .thumbnails {
        margin-bottom: 100px;
    }
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .product-title {
        font-size: 1.6rem;
    }
    
    .product-subtitle {
        font-size: 1rem;
    }
    
    /* Product gallery adjustments */
    .product-gallery .main-image {
        height: 300px;
    }
    
    .thumbnail {
        width: 60px;
        height: 60px;
    }
    
    /* Tab navigation - horizontal scrolling */
    .tab-buttons {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 10px;
        margin-bottom: 15px;
        scrollbar-width: none; /* Hide scrollbar Firefox */
        -ms-overflow-style: none; /* Hide scrollbar IE and Edge */
    }
    
    .tab-buttons::-webkit-scrollbar {
        display: none; /* Hide scrollbar Chrome, Safari, Opera */
    }
    
    .tab-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    /* Tab content */
    .tab-content {
        padding: 0;
    }
    
    /* Ingredients, Benefits, Directions */
    .ingredients-list,
    .benefits-list,
    .directions-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ingredient-item,
    .benefit-item {
        margin-bottom: 15px;
    }
    
    /* Product meta */
    .product-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .meta-item {
        width: 100%;
    }
}

@media (max-width: 576px) {
    /* Header and product title */
    .breadcrumbs {
        font-size: 0.8rem;
    }
    
    .product-title {
        font-size: 1.4rem;
    }
    
    /* Gallery */
    .product-gallery .main-image {
        height: 250px;
    }
    
    /* Price */
    .product-price {
        font-size: 1.2rem;
    }
    
    .regular-price {
        font-size: 1rem;
    }
    
    /* Purchase options */
    .option-buttons {
        gap: 8px;
    }
    
    .option-button {
        padding: 10px;
    }
    
    /* Add to cart */
    .add-to-cart-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .quantity-selector {
        width: 100%;
        justify-content: center;
        margin-right: 0;
    }
    
    .add-to-cart {
        width: 100%;
    }
    
    /* Reviews */
    .reviews-summary {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }
    
    .reviews-controls {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }
    
    .reviews-sort {
        width: 100%;
        justify-content: space-between;
    }
    
    .write-review-btn {
        width: 100%;
    }
    
    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .review-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .review-feedback {
        flex-wrap: wrap;
    }
    
    /* Related products */
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    /* FAQ accordion */
    .faq-question h3 {
        font-size: 1rem;
    }
    
    /* Supplement facts table */
    .facts-table {
        font-size: 0.9rem;
    }
    
    /* Pagination */
    .pagination-btn {
        width: 35px;
        height: 35px;
    }
}

/* Fix for subscription details spacing */
.subscription-details {
    margin-top: 10px;
}

/* Improve form elements on mobile */
@media (max-width: 576px) {
    select, 
    input[type="number"],
    button {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    
    .subscription-interval {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    
    .subscription-interval select {
        width: 100%;
        padding: 8px;
    }
}

/* Touch-friendly improvements */
@media (max-width: 768px) {
    .thumbnail,
    .tab-btn,
    .faq-question,
    .quantity-btn,
    .option-button {
        min-height: 44px; /* Minimum touch target size */
    }
    
    .quantity-selector input {
        min-width: 44px;
    }
}