/* Product Detail Page Styles */

.product-detail {
    padding: 140px 60px 80px;
    min-height: 100vh;
}

.product-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
}

/* Product Images */
.product-images {
    position: sticky;
    top: 120px;
    height: fit-content;
}

.main-image {
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    background: var(--white);
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.thumbnail {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--dark);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Info */
.product-info {
    padding: 20px 0;
}

.product-brand-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
    margin-bottom: 10px;
}

.product-title {
    font-size: clamp(32px, 4vw, 48px);
    margin-bottom: 20px;
    line-height: 1.2;
}

.product-price {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--dark);
}

.stock-indicator {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.stock-indicator.in-stock {
    background: #d4edda;
    color: #155724;
}

.stock-indicator.low-stock {
    background: #fff3cd;
    color: #856404;
}

.stock-indicator.out-of-stock {
    background: #f8d7da;
    color: #721c24;
}

.product-description {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 30px;
    opacity: 0.8;
}

/* Quantity Selector */
.quantity-selector {
    margin-bottom: 30px;
}

.quantity-selector label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.qty-btn:hover:not(:disabled) {
    background: var(--dark);
    color: var(--beige);
    border-color: var(--dark);
}

.qty-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.quantity-controls input {
    width: 80px;
    height: 40px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
}

.quantity-note {
    font-size: 13px;
    opacity: 0.6;
}

/* Add to Cart Button */
.add-to-cart-btn {
    width: 100%;
    padding: 18px;
    background: var(--dark);
    color: var(--beige);
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 30px;
}

.add-to-cart-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(42, 39, 37, 0.3);
}

.add-to-cart-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Product Tabs */
.product-tabs {
    margin-bottom: 40px;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    color: var(--dark);
    opacity: 0.6;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    opacity: 1;
    border-bottom-color: var(--dark);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#benefits-list {
    list-style: none;
    padding: 0;
}

#benefits-list li {
    padding: 12px 0;
    padding-left: 30px;
    position: relative;
}

#benefits-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

/* Long Description */
.long-description {
    padding: 30px 0;
    border-top: 1px solid var(--border);
}

.long-description h3 {
    margin-bottom: 15px;
    font-size: 20px;
}

.long-description p {
    line-height: 1.8;
    opacity: 0.8;
}

/* Related Products */
.related-products {
    padding: 80px 60px;
    background: var(--white);
}

.related-products h2 {
    text-align: center;
    font-size: clamp(32px, 5vw, 48px);
    margin-bottom: 60px;
}

.related-products .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.related-products .product-card {
    max-width: 100%;
}

.related-products .product-image {
    aspect-ratio: 3/4;
}

.related-products .product-name {
    font-size: 16px;
    margin-bottom: 6px;
}

.related-products .product-brand {
    font-size: 13px;
}

.related-products .product-price {
    font-size: 15px;
}

@media (max-width: 768px) {
    .related-products .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
}

/* Shopping Cart Modal Additions */
.cart-link {
    position: relative;
    padding-right: 30px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: 0;
    background: var(--dark);
    color: var(--beige);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

.cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.cart-modal.active {
    display: flex;
}

.cart-content {
    background: var(--beige);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.cart-header {
    padding: 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    font-size: 24px;
}

.close-cart {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-items {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-info h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.cart-item-brand {
    font-size: 13px;
    opacity: 0.6;
    margin-bottom: 10px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-quantity button {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.cart-item-price {
    text-align: right;
}

.cart-item-price .price {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.remove-item {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 13px;
    padding: 5px;
}

.cart-footer {
    padding: 30px;
    border-top: 1px solid var(--border);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
}

.checkout-btn,
.continue-shopping {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 10px;
}

.checkout-btn {
    background: var(--dark);
    color: var(--beige);
}

.continue-shopping {
    background: var(--white);
    border: 1px solid var(--dark);
    color: var(--dark);
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    opacity: 0.5;
}

/* Related Products */
.related-products {
    padding: 80px 60px;
    background: var(--light-gray);
}

.related-products h2 {
    font-size: 32px;
    margin-bottom: 40px;
    text-align: center;
}

#related-products-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

#related-products-container .product-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

#related-products-container .product-card:hover {
    transform: translateY(-8px);
}

#related-products-container .product-image-wrapper {
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: 12px;
    overflow: hidden;
    background: var(--white);
    margin-bottom: 16px;
}

#related-products-container .product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

#related-products-container .product-card:hover .product-image {
    transform: scale(1.05);
}

#related-products-container .product-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

#related-products-container .product-brand {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
    margin-bottom: 8px;
}

#related-products-container .product-price {
    font-size: 18px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .product-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .product-images {
        position: static;
    }

    #related-products-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .product-detail {
        padding: 100px 24px 60px;
        overflow-x: hidden;
    }

    .product-container {
        max-width: 100%;
        overflow: hidden;
    }

    .product-images,
    .product-info {
        max-width: 100%;
        overflow: hidden;
    }

    .main-image {
        width: 100%;
        max-width: 100%;
    }

    .product-title {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .product-description {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .thumbnail-images {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }

    .product-tabs {
        max-width: 100%;
        overflow: hidden;
    }

    .tab-buttons {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 5px;
    }

    .tab-buttons::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        padding: 10px 16px;
        font-size: 14px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .tab-content.active {
        max-width: 100%;
        overflow-x: hidden;
    }

    .tab-content p,
    .tab-content ul,
    .tab-content li {
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word;
    }

    #dosage-text,
    #ingredients-text,
    #serving-size {
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    .long-description {
        max-width: 100%;
        overflow: hidden;
    }

    .long-description p {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .related-products {
        padding: 60px 24px;
    }

    .related-products h2 {
        font-size: 24px;
        margin-bottom: 30px;
    }

    #related-products-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    #related-products-container .product-name {
        font-size: 14px;
    }

    #related-products-container .product-brand {
        font-size: 11px;
    }

    #related-products-container .product-price {
        font-size: 16px;
    }

    .cart-item {
        grid-template-columns: 60px 1fr;
        gap: 15px;
    }

    .cart-item-image {
        width: 60px;
        height: 60px;
    }

    .cart-item-price {
        grid-column: 2;
        text-align: left;
    }
}