/* from_product.css */
/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    height: 100%;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Package System Container */
.fullscreen-package-system {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    padding: 2rem 1rem;
    background-color: #f5f5f7;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Header Section */
.packages-header {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 2rem;
}

.packages-header h1 {
    font-size: clamp(2rem, 5vw, 2.625rem);
    color: #1d1d1f;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.packages-subtitle {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: #86868b;
    line-height: 1.5;
}

/* Text Animation */
.fade-up-title {
    display: inline-block;
    overflow: hidden;
}

.fade-up-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(1em);
    animation: fadeUp 0.5s forwards;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Package Grid Layout */
.package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    align-self: center;
    padding: 0 1rem;
}

.main-package {
    position: relative;
    height: 600px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1/1.5;
}

.main-package:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.package-image {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: all 0.5s ease;
    background-color: transparent !important;
    mix-blend-mode: multiply;
}

.package-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 50%);
}

.package-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    color: white;
    z-index: 2;
}

.package-content h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.3;
}

.view-details {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.main-package:hover .view-details {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateX(5px);
}

/* Fullscreen Overlay */
.fullscreen-package-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.fullscreen-package-overlay.active {
    display: flex;
    opacity: 1;
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1100;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.fs-package-content {
    display: flex;
    width: 90%;
    max-width: 1200px;
    margin: auto;
    background-color: white;
    border-radius: 20px;
    overflow: hidden;
    animation: packageAppear 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
    transform: scale(0.9);
    max-height: 90vh;
    flex-direction: column;
}

@keyframes packageAppear {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Image Container - Modified for Mobile */
.fs-image-container {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f5f5f7;
    padding: 1rem;
    min-height: 300px;
    max-height: 70vh;
    overflow: hidden;
    position: relative;
}

.gallery-container {
    width: 100%;
    height: calc(100% - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Main Image - Mobile Optimized */
.responsive-package-image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
    background-color: #f5f5f7;
    background-image: linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%, #eee),
        linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%, #eee);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

/* Thumbnail Container - Bottom Position */
.thumbnail-box {
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    background-color: rgba(255, 255, 255, 0.95);
    position: relative;
    z-index: 20;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
    order: 2;
    margin-top: auto;
}

.image-thumbnails {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    scrollbar-width: thin;
    scrollbar-color: #0071e3 #f5f5f7;
}

.image-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.image-thumbnails::-webkit-scrollbar-track {
    background: #f5f5f7;
    border-radius: 3px;
}

.image-thumbnails::-webkit-scrollbar-thumb {
    background-color: #0071e3;
    border-radius: 3px;
}

/* Thumbnail Items */
.thumbnail-item {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.thumbnail-item.active {
    border-color: #0071e3;
    transform: scale(1.1);
}

.thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.2s ease;
}

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

.thumbnail-item.error {
    display: none;
}

/* Navigation Arrows */
.image-navigation {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 10;
    pointer-events: none;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.nav-arrow:hover {
    background-color: white;
    transform: translateY(-50%) scale(1.1);
}

.prev-image {
    left: 1rem;
}

.next-image {
    right: 1rem;
}

.nav-arrow i {
    color: #1d1d1f;
    font-size: 1rem;
}

/* Details Container */
.fs-details-container {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    max-height: 60vh;
    min-width: 300px;
}

.package-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature-item {
    padding: 1rem;
    background-color: #f5f5f7;
    border-radius: 12px;
}

.feature-title {
    display: block;
    font-size: 0.875rem;
    color: #86868b;
    margin-bottom: 0.5rem;
}

.feature-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1d1d1f;
}

.description {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 1.5rem;
}

/* Action Buttons */
.action-buttons {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.line-inquiry-btn {
    background-color: #00B900;
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 185, 0, 0.2);
    transition: all 0.3s ease;
    flex-grow: 1;
    justify-content: center;
}

.line-inquiry-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 185, 0, 0.3);
}

.hover-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.line-inquiry-btn:hover .hover-effect {
    transform: translateX(0);
}

.package-contact-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #1d1d1f;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    background-color: #f5f5f7;
    border-radius: 50px;
    flex-grow: 1;
    justify-content: center;
}

.no-images-message {
    text-align: center;
    width: 100%;
    padding: 1rem;
    color: #86868b;
    font-size: 0.875rem;
}

/* Mobile Responsive Styles */
@media (max-width: 767px) {
    .fullscreen-package-system {
        padding: 1.5rem 1rem;
    }

    .packages-header {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }

    .package-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .main-package {
        height: 350px;
        aspect-ratio: 1/1.4;
    }

    /* Fullscreen Overlay Mobile */
    .fs-package-content {
        width: 95%;
        max-height: 90vh;
        flex-direction: column;
    }

    .fs-image-container {
        max-height: 50vh;
        padding: 0.5rem;
    }

    .gallery-container {
        height: calc(100% - 60px);
    }

    /* Larger Image on Mobile */
    .responsive-package-image {
        max-height: 45vh;
        width: 100%;
    }

    /* Thumbnails for Mobile */
    .thumbnail-box {
        padding: 8px 0;
        height: 60px;
    }

    .image-thumbnails {
        gap: 6px;
        padding: 0 5px;
        justify-content: flex-start;
    }

    .thumbnail-item {
        width: 48px;
        height: 48px;
        border-radius: 6px;
    }

    /* Navigation Arrows for Mobile */
    .nav-arrow {
        width: 32px;
        height: 32px;
    }

    .prev-image {
        left: 8px;
    }

    .next-image {
        right: 8px;
    }

    /* Details Section for Mobile */
    .fs-details-container {
        padding: 1.5rem;
        max-height: 40vh;
    }

    .package-features-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .feature-item {
        padding: 0.75rem;
    }

    .action-buttons {
        margin-top: 1.5rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .line-inquiry-btn,
    .package-contact-phone {
        width: 100%;
        text-align: center;
    }
}

/* Small Mobile Devices (iPhone SE etc.) */
@media (max-width: 374px) {
    .main-package {
        height: 300px;
    }

    .fs-image-container {
        max-height: 45vh;
    }

    .responsive-package-image {
        max-height: 40vh;
    }

    .thumbnail-item {
        width: 42px;
        height: 42px;
    }

    .fs-details-container {
        padding: 1rem;
    }
}

/* Mobile Landscape Orientation */
@media (max-width: 767px) and (orientation: landscape) {
    .fs-package-content {
        flex-direction: row;
        max-height: 85vh;
    }

    .fs-image-container {
        max-height: 85vh;
        width: 50%;
    }

    .gallery-container {
        height: calc(100% - 70px);
    }

    .responsive-package-image {
        max-height: 80vh;
    }

    .fs-details-container {
        max-height: 85vh;
        width: 50%;
        padding: 1.5rem;
    }

    .thumbnail-box {
        width: 50%;
        left: 0;
    }
}

/* Desktop Styles */
@media (min-width: 768px) {
    .fs-package-content {
        flex-direction: row;
        max-height: 80vh;
        gap: 1rem;
    }

    .fs-image-container,
    .fs-details-container {
        flex: 1;
        max-height: 80vh;
        overflow: hidden;
    }

    .fs-image-container {
        padding: 1rem;
        display: flex;
        flex-direction: column;
    }

    .gallery-container {
        flex: 1;
        height: auto;
        max-height: calc(80vh - 80px - 2rem);
    }

    .responsive-package-image {
        max-height: 100%;
        width: auto;
    }

    .fs-details-container {
        min-width: auto;
        padding: 2rem;
        overflow-y: auto;
    }

    .package-grid {
        gap: 2rem;
        padding: 0;
    }

    .action-buttons {
        flex-wrap: nowrap;
    }

    .line-inquiry-btn,
    .package-contact-phone {
        flex-grow: 0;
    }
}

@media (min-width: 992px) {
    .fs-package-content {
        max-height: 85vh;
    }

    .gallery-container {
        max-height: calc(85vh - 80px - 2rem);
    }

    .package-features-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .responsive-package-image {
        max-width: 90%;
        max-height: 100%;
    }
}

/* Hide Slide Indicators */
.slide-indicators {
    display: none !important;
}

/* ส่วนที่แก้ไขเพื่อปรับขนาดกรอบตามภาพ */
.image-frame {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: calc(100% / (var(--aspect-ratio)));
    overflow: hidden;
}

.main-package {
    --aspect-ratio: 1/1.5;
}

.package-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: all 0.5s ease;
}

/* ปรับขนาดรูปในโหมดเต็มหน้าจอ */
.gallery-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
}

.responsive-package-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.main-package {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}