
.template-detail {
    padding: 60px 0;
}

/* Image Gallery */
.gallery-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(59, 130, 246, 0.15);
}

@media (max-width: 769px) {
    .main-image img {
        height: 100%;
    }
}

.main-image {
    width: 100%;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.main-image:hover {
    transform: scale(1.02);
}

.main-image img {
    width: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.main-image:hover .image-overlay {
    opacity: 1;
}

.zoom-icon {
    color: white;
    font-size: 2rem;
}

.thumbnail-list {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding: 5px 0;
}

.thumbnail {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex-shrink: 0;
    overflow: hidden;
}

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

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--primary-blue);
    transform: scale(1.05);
}

/* Template Info */
.template-header {
    margin-bottom: 30px;
}

.template-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 15px;
}

.template-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stars {
    color: var(--warning-yellow);
}

.rating-text {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.template-category {
    background: var(--light-blue);
    color: var(--primary-blue);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.template-stats {
    display: flex;
    gap: 10px;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 2px;
}

.price-section {
    background: var(--soft-blue);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    border: 2px solid var(--light-blue);
}

.price-main {
    font-size: 25px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.price-original {
    text-decoration: line-through;
    color: var(--text-gray);
    font-size: 1.2rem;
    margin-right: 10px;
}

.price-discount {
    background: var(--success-green);
    color: white;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn-buy {
    flex: 1;
    background: linear-gradient(135deg, var(--success-green), #059669);
    border: none;
    color: white;
    padding: 15px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
}

.btn-buy:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
    color: white;
}

.btn-preview {
    flex: 1;
    font-size: 13px;
}

.btn-wrapper {
    position: fixed; /* Menempatkan tombol di posisi tetap */
    bottom: 20px; /* Jarak dari bawah */
    right: 20px; /* Jarak dari kanan */
    display: flex;
    flex-direction: column; /* Agar tombol-tombol berjajar secara vertikal */
    align-items: flex-end; /* Menempatkan tombol di sebelah kanan */
    gap: 10px; /* Jarak antar tombol */
}

.btn-icon {
    background: var(--light-blue);
    color: var(--primary-blue);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-3px);
}


/* Info Tabs */
.info-tabs {
    margin-top: 50px;
}

.nav-tabs {
    border-bottom: 2px solid var(--border-gray);
    margin-bottom: 30px;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-gray);
    font-weight: 600;
    padding: 15px 20px;
    margin-right: 10px;
    border-radius: 10px 10px 0 0;
}

.nav-tabs .nav-link.active {
    background: var(--primary-blue);
    color: white;
}

.nav-tabs .nav-link:hover:not(.active) {
    background: var(--soft-blue);
    color: var(--primary-blue);
}

.tab-content {
    padding: 20px 0;
}

/* Description */
.description-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-gray);
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list i {
    color: var(--success-green);
    width: 20px;
}

/* Specifications */
.spec-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.1);
}

.spec-table table {
    margin: 0;
}

.spec-table th {
    background: var(--soft-blue);
    color: var(--primary-blue);
    font-weight: 600;
    padding: 15px 20px;
    border: none;
}

.spec-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-gray);
    vertical-align: middle;
}

.spec-table tr:last-child td {
    border-bottom: none;
}

.spec-value {
    font-weight: 500;
    color: var(--dark-blue);
}

/* Reviews */
.review-summary {
    background: var(--soft-blue);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.review-score {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.review-stars {
    font-size: 1.5rem;
    color: var(--warning-yellow);
    margin-bottom: 10px;
}

.review-count {
    color: var(--text-gray);
    font-size: 1.1rem;
}

.rating-breakdown {
    margin-top: 20px;
}

.rating-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.rating-label {
    font-size: 0.9rem;
    color: var(--text-gray);
    width: 60px;
}

.rating-bar {
    flex: 1;
    height: 8px;
    background: var(--border-gray);
    border-radius: 4px;
    overflow: hidden;
}

.rating-fill {
    height: 100%;
    background: var(--warning-yellow);
    transition: width 0.3s ease;
}

.rating-count {
    font-size: 0.85rem;
    color: var(--text-gray);
    width: 40px;
    text-align: right;
}

.review-item {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.1);
    border: 1px solid var(--border-gray);
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.reviewer-avatar {
    width: 50px;
    height: 50px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
}

.reviewer-details h6 {
    margin: 0;
    color: var(--dark-blue);
    font-weight: 600;
}

.review-date {
    color: var(--text-gray);
    font-size: 0.85rem;
}

.review-rating {
    color: var(--warning-yellow);
    margin-bottom: 10px;
}

.review-text {
    color: var(--text-gray);
    line-height: 1.6;
}

/* Image Modal/Popup */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.image-modal.active {
    opacity: 1;
    visibility: visible;
}

.image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: zoomIn 0.3s ease;
}

.image-modal img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: #333;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--primary-blue);
    color: white;
    transform: scale(1.1);
}

.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: all 0.3s ease;
}

.share-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.share-modal-content {
    background: white;
    border-radius: 15px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-50px);
    transition: transform 0.3s ease;
}

.share-modal.active .share-modal-content {
    transform: translateY(0);
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.share-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.share-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.share-close:hover {
    color: #333;
}

.share-options {
    display: flex;
    justify-content: space-around;
    margin-bottom: 25px;
}

.share-option {
    text-align: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 80px;
}

.share-option:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
}

.share-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 20px;
    color: white;
}

.share-icon.facebook {
    background: #1877f2;
}

.share-icon.twitter {
    background: #1da1f2;
}

.share-icon.whatsapp {
    background: #25d366;
}

.share-option span {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.copy-link-section {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.copy-link-section label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.copy-link-container {
    display: flex;
    gap: 10px;
}

.copy-link-container input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #f8f9fa;
    color: #666;
}

.btn-copy {
    padding: 10px 15px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-copy.copied {
    background: #28a745;
}

/* Tambahkan CSS yang hilang setelah CSS share-modal */

/* Preview Modal Styles */
.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10001;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: all 0.3s ease;
}

.preview-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.preview-modal-content {
    background: white;
    border-radius: 15px;
    width: 95%;
    height: 90%;
    max-width: 1200px;
    max-height: 800px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-50px);
    transition: transform 0.3s ease;
    overflow: hidden;
    position: relative;
}

.preview-modal.active .preview-modal-content {
    transform: translateY(0);
}

.preview-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-close:hover {
    color: #333;
    background: #e9ecef;
}

.preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
}

.preview-loading i {
    font-size: 24px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.preview-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #dc3545;
    padding: 20px;
}

.preview-error i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.preview-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 15px 15px 0 0;
    flex-wrap: wrap;
    gap: 15px;
}

.preview-modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    flex: 1;
    min-width: 200px;
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.device-switcher {
    display: flex;
    background: #e9ecef;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.device-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 70px;
    justify-content: center;
}

.device-btn:hover {
    color: #333;
    background: rgba(255, 255, 255, 0.5);
}

.device-btn.active {
    background: #007bff;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.device-btn i {
    font-size: 12px;
}

.preview-iframe-container {
    width: 100%;
    height: calc(100% - 75px);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    padding: 20px;
    box-sizing: border-box;
}

.preview-iframe-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

/* Device Sizes */
.preview-iframe-wrapper.desktop {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    max-height: 800px;
}

.preview-iframe-wrapper.tablet {
    width: 768px;
    height: 1024px;
    max-width: 90%;
    max-height: 90%;
}

.preview-iframe-wrapper.mobile {
    width: 375px;
    height: 667px;
    max-width: 90%;
    max-height: 90%;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.device-frame {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 10px solid #333;
    border-radius: 22px;
    pointer-events: none;
    display: none;
}

.preview-iframe-wrapper.mobile .device-frame,
.preview-iframe-wrapper.tablet .device-frame {
    display: block;
}

.preview-iframe-wrapper.mobile .device-frame {
    border-radius: 25px;
    border-width: 15px;
}

.device-info {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    white-space: nowrap;
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .image-nav {
        display: none;
    }
    
    .touch-indicator {
        display: block;
    }
    
    .image-modal-content {
        max-width: 95vw;
        max-height: 80vh;
    }
    
    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .main-image img {
        height: 60%;
    }
    
    .preview-modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .preview-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .device-switcher {
        flex: 1;
        justify-content: center;
    }
    
    .device-btn {
        flex: 1;
        min-width: auto;
    }
    
    .preview-iframe-container {
        padding: 10px;
    }
    
    .preview-iframe-wrapper.tablet,
    .preview-iframe-wrapper.desktop {
        width: 100%;
        height: 100%;
    }
}


.options-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.options-modal.active {
    opacity: 1;
    visibility: visible;
}

.options-modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

.options-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-gray);
}

.options-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark-blue);
    margin: 0;
}

.options-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-gray);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.options-close:hover {
    color: var(--primary-blue);
}

.option-item {
    border: 2px solid var(--border-gray);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.option-item:hover {
    border-color: var(--primary-blue);
    background: var(--soft-blue);
}

.option-item.selected {
    border-color: var(--primary-blue);
    background: var(--light-blue);
}

.option-item.selected::after {
    content: '\2713';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 25px;
    height: 25px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.option-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 8px;
}

.option-description {
    color: var(--text-gray);
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.option-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.option-pricing {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.option-original-price {
    text-decoration: line-through;
    color: var(--text-gray);
    font-size: 1rem;
}

.option-discount {
    background: var(--success-green);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.options-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid var(--border-gray);
}

.btn-add-to-cart {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border: none;
    color: white;
    padding: 15px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-add-to-cart.enabled {
    opacity: 1;
    cursor: pointer;
}

.btn-add-to-cart.enabled:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    color: #333;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 10002;
}

.image-nav:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.image-nav-prev {
    left: 20px;
}

.image-nav-next {
    right: 20px;
}

.image-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 10002;
}

.touch-indicator {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    text-align: center;
    z-index: 10002;
    display: none;
}

.image-modal img {
    transition: opacity 0.3s ease;
}

.image-modal img.loading {
    opacity: 0.5;
}    

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}