/* =======================
   SINGLE PRODUCT STYLES
   ======================= */

.single-product-page {
    padding: 3rem 0;
    background: #fff;
}

.single-product-container {
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .single-product-page .single-product-container {
        padding: 0 15px;
    }
}

.product-breadcrumb {
    padding: 1rem 0;
    margin-top: 20px;
    color: #666;
    font-size: 0.95rem;
}

.product-breadcrumb a {
    color: #4CAF50;
    text-decoration: none;
}

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

.product-breadcrumb span {
    margin: 0 0.5rem;
}

.product-detail-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .product-detail-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        width: 100%;
    }
}

/* Product Images Wrapper - for mobile grouping */
.product-images-wrapper {
    display: contents; /* Transparent wrapper on desktop */
}
/* Fix cho mobile - thêm vào phần @media (max-width: 768px) */
@media (max-width: 768px) {
    .product-images-wrapper {
        display: block;
        background: #fff;
        border-radius: 12px;
        width: 100%;
        max-width: 100%; /* Đảm bảo không vượt quá */
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        overflow: hidden; /* Ngăn nội dung tràn ra ngoài */
    }
    
    .product-images-section {
        position: relative; /* Bỏ sticky trên mobile */
        top: auto;
        width: 100%;
        max-width: 100%;
    }
    
    .main-product-image {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    .main-product-image img {
        width: 100%;
        max-width: 100%; /* Quan trọng! */
        height: auto;
        display: block;
    }
    
    /* Fix thumbnails overflow */
    .product-gallery-thumbnails {
        display: flex;
        overflow-x: auto;
        gap: 0.75rem;
        padding-bottom: 0.5rem;
        width: 100%;
        max-width: 100%;
    }
    
    .thumbnail-item {
        flex: 0 0 80px;
        width: 80px;
        min-width: 80px; /* Đảm bảo không co lại */
        height: 80px;
    }
    .product-detail-title {
        font-size: 2.5rem !important;
    }
 
}

/* Product Images */
.product-images-section {
    position: sticky;
    top: 20px;
    width: 100%;
}

.main-product-image {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 1rem;
}

.main-product-image img {
    width: 100%;
    height: auto;
    display: block;
    cursor: zoom-in;
    transition: transform 0.3s;
}

.main-product-image img.zoomed {
    transform: scale(1.5);
    cursor: zoom-out;
}

.product-tag-large {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 1.5rem;
    font-weight: 700;
    background-color: #45424244;
    border: var(--heifood-primary) solid 1.5px;
    z-index: 2;
}

.product-tag-large.tag-new {
    color: orange;
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
}

.product-tag-large.tag-hot {
    color: red;
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
}

.product-tag-large.tag-sale {
    color: yellow;
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
}
.product-gallery-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .product-gallery-thumbnails {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 0.75rem;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #4CAF50 #e0e0e0;
    }
    
    .product-gallery-thumbnails::-webkit-scrollbar {
        height: 6px;
    }
    
    .product-gallery-thumbnails::-webkit-scrollbar-track {
        background: #e0e0e0;
        border-radius: 3px;
    }
    
    .product-gallery-thumbnails::-webkit-scrollbar-thumb {
        background: #4CAF50;
        border-radius: 3px;
    }
    .product-tag-large {
        font-size: 1.2rem;
        padding: 0.5rem 1rem;
        top: 10px;
        right: 10px;
    }
}

.thumbnail-item {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

@media (max-width: 768px) {
    .thumbnail-item {
        flex: 0 0 80px; /* Fixed width on mobile */
        width: 80px;
        height: 80px;
    }
}

.thumbnail-item:hover {
    border-color: #81c784;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.thumbnail-item.active {
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5);
}

.thumbnail-item.active::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 5px;
    right: 5px;
    background: #4CAF50;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.thumbnail-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.thumbnail-item:hover img {
    transform: scale(1.1);
}

/* Product Info Section */
.product-info-section {
    padding: 1rem 0;
}

@media (max-width: 768px) {
    .product-info-section {
        padding: 1rem 0;
    }
}

.product-detail-title {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    color: #2c5530;
    margin: 0 0 1.5rem 0;
    line-height: 1.3;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.08);
}

.product-categories {
    margin: 1rem 0;
    font-size: 1rem;
}

.category-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: #e8f5e9;
    color: #2c5530;
    border-radius: 20px;
    text-decoration: none;
    margin-right: 0.5rem;
    font-size: 0.95rem;
    transition: background 0.3s;
}

.category-badge:hover {
    background: #c8e6c9;
}

/* Product Variants Section */
.product-variants-section {
    margin: 1.5rem 0;
    padding: 1.2rem;
    background: #f1f8f4;
    border: 2px solid #81c784;
    border-radius: 10px;
}

.product-variants-section label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.8rem;
}

.product-variants-section label i {
    color: #2c5530;
    margin-right: 0.5rem;
}

.variant-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.variant-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid #81c784;
    border-radius: 8px;
    background: white;
    color: #2c5530;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    text-align: center;
}

.variant-item:hover {
    border-color: #66bb6a;
    background: #e8f5e9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(129, 199, 132, 0.3);
}

.variant-item.active {
    background: linear-gradient(135deg, #66bb6a, #4caf50);
    border-color: #388e3c;
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    transform: translateY(-2px);
}

.variant-item.active:hover {
    background: linear-gradient(135deg, #4caf50, #388e3c);
}

.product-price-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0f8f0, #e8f5e9);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.price-sale-large {
    font-size: 2.5rem;
    font-weight: 800;
    color: #4CAF50;
}

.price-original-large {
    font-size: 1.5rem;
    text-decoration: line-through;
    color: #999;
}

.price-regular-large {
    font-size: 2.5rem;
    font-weight: 800;
    color: #2c5530;
}

.price-contact-large {
    font-size: 1.8rem;
    color: #FFC107;
    font-weight: 700;
}

.discount-badge {
    padding: 0.5rem 1rem;
    background: #ff5252;
    color: white;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.2rem;
    position: relative;
    animation: glowGreen 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

/* Animation đổ bóng sáng xanh lá */
@keyframes glowGreen {
    0%, 100% {
        box-shadow: 
            0 0 10px rgba(76, 175, 80, 0.5),
            0 0 20px rgba(76, 175, 80, 0.3),
            0 0 30px rgba(76, 175, 80, 0.2);
    }
    50% {
        box-shadow: 
            0 0 20px rgba(76, 175, 80, 0.8),
            0 0 30px rgba(76, 175, 80, 0.6),
            0 0 40px rgba(76, 175, 80, 0.4),
            0 0 50px rgba(76, 175, 80, 0.2);
    }
}

.product-short-description {
    margin: 1.5rem 0;
    font-size: 1.1rem;
    color: #555;
    line-height: 1.8;
}

/* Contact Buttons */
.product-contact-buttons {
    margin: 2rem 0;
}

.contact-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .contact-actions {
        grid-template-columns: repeat(3, 1fr);
        justify-content: center;
        max-width: 300px;
        margin: 0 auto;
    }
}

.btn-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    text-align: center;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    z-index: 10;
    cursor: pointer;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .btn-contact {
        width: 60px;
        height: 60px;
        padding: 0;
        font-size: 1.5rem;
        border-radius: 50%;
    }
    
    .btn-contact .btn-text {
        display: none;
    }
    
    .btn-contact i {
        margin: 0 !important;
    }
    
    .btn-contact .zalo-icon {
        width: 30px;
        height: 30px;
        margin: 0 !important;
    }
      .product-description-section {
        margin: 2rem 0;
        padding: 1.5rem;
        border-radius: 8px;
    }
    .price-sale-large {
        font-size: 2rem;
    }
    .price-original-large {
        font-size: 1.2rem;
    }
    
    /* Variant selector mobile */
    .product-variants-section {
        padding: 1rem;
    }
    
    .variant-buttons {
        gap: 8px;
    }
    
    .variant-item {
        padding: 0.7rem 1.2rem;
        font-size: 0.95rem;
        min-width: 70px;
    }
}

.btn-contact:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-phone {
    background: linear-gradient(135deg, #4CAF50, #66bb6a);
    color: white;
}

.btn-zalo {
    background: linear-gradient(135deg, #0068FF, #0084FF);
    color: white;
}

.btn-zalo .zalo-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 5px;
}

.btn-email {
    background: linear-gradient(135deg, #FFC107, #FFD54F);
    color: white;
    cursor: pointer;
    pointer-events: auto;
}

/* Share Buttons */
.product-share {
    margin: 2rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.share-btn {
    padding: 0.5rem 1rem;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95rem;
    border: 1px solid #e0e0e0;
    transition: all 0.3s;
}

.share-btn:hover {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* Product Description */
.product-description-section {
    margin: 3rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
}


.section-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    color: #2c5530;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #4CAF50;
    font-weight: 700;
    position: relative;
}

.section-title::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 80px;
    height: 3px;
    background: #2c5530;
}

.product-content {
    line-height: 1.8;
    color: #444;
}

.product-content h2,
.product-content h3 {
    color: #2c5530;
    margin-top: 1.5rem;
}

.product-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}
