/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "DM Sans", sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Header */
header {
    background: #ffffff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: 1px solid #eaeaea;
}

.logo {
    max-width: 140px;
    height: auto;
}

.back-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.back-link:hover {
    background: #e9ecef;
    transform: translateX(-2px);
}

.back-link i {
    margin-right: 6px;
    font-size: 18px;
}

.mobile-back-btn {display:flex;}
a {text-decoration: none;}

/* Main Layout */
main {
    max-width: 500px;
    margin: 0 auto;
    background: #ffffff;
    min-height: 100vh;
    position: relative;
}

/* Product Gallery */
.product-gallery {
    position: relative;
    background: #f8f9fa;
    overflow: hidden;
}

.main-image {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    cursor: zoom-in;
}

.main-image img.zoomed {
    transform: scale(1.5);
    cursor: zoom-out;
}

/* Product Info */
.product-info {
    padding: 20px;
}

.product-header {
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 8px;
}

.product-title {
    font-size: 22px;
    font-weight: 300;
    color: #2d3748;
    line-height: normal;
}

.product-price {
    font-size: 24px;
    font-weight: 700;
    color: #e53e3e;
}

/* Section Styles */
.section-title {
    padding-top:5px;
    font-size: 14px;
    font-weight: 300;
    color: #9fa7b4;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}



/* Description Section */
.description-section {
    margin-bottom: 24px;
}

.description-section .section-title {
    cursor: default;
}

.description-section .section-title::after {
    display: none;
}

.product-description {
    max-height: none;
    opacity: 1;
    overflow: visible;
    color: #4a5568;
    line-height: 1.7;
    font-size: 14px;
    margin-bottom: 80px;
}

/* Action Footer */
.action-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 500px;
    margin: 0 auto;
    background: #ffffff;
    padding: 16px 30px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    border-top: 1px solid #eaeaea;
}

.add-to-cart-form {
    width: 100%;
}

.btn-add-to-cart {
    width: 100%;
    background: #0066c5;
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-to-cart:hover {
    background: linear-gradient(135deg, #0066c5, #20b7dd);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(32, 177, 221, 0.3);
}

.btn-add-to-cart:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    main {
        max-width: 100%;
    }
    
    .main-image {
        height: 350px;
    }
    
    .product-title {
        font-size: 20px;
    }
    
    .product-price {
        font-size: 22px;
    }
    
    .product-info {
        padding: 16px;
    }
    

}

@media (max-width: 480px) {
    .main-image {
        height: 300px;
    }
    
    .product-title {
        font-size: 18px;
    }
    
    .product-price {
        font-size: 20px;
    }
    
    header {
        padding: 12px 16px;
    }
    
    .logo {
        max-width: 120px;
    }
    
    .action-footer {
        padding: 12px 60px;
    }
    
    .btn-add-to-cart {
        padding: 14px 20px;
        font-size: 15px;
    }
    
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-info > * {
    animation: fadeIn 0.5s ease forwards;
}

.variant-section {
    animation-delay: 0.1s;
}

.description-section {
    animation-delay: 0.2s;
}

/* Loading State */
.btn-add-to-cart.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-add-to-cart.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header Styling */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.store-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.store-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;

    background: #f8f9fa;
    flex-shrink: 0;
}

.store-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-info {
    display: flex;
    flex-direction: column;
}

.store-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

.store-username {
    font-size: 12px;
    color: #666;
}

/* WhatsApp Button Desktop */
.whatsapp-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    position: relative;
    overflow: hidden;
}

.whatsapp-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    background: linear-gradient(135deg, #128C7E, #25D366);
    color: white;
    text-decoration: none;
}

.whatsapp-button:active {
    transform: translateY(0);
}

.whatsapp-button i {
    font-size: 16px;
}

.back-link {
    display: none;
}

/* Container utama untuk swiper */
.product-gallery-container {
    width: 100%;
    position: relative;
    background: #fff;
    overflow: hidden;
}

/* Swiper container */
.swiper-container {
    width: 100%;
    height: 420px;
    background: #f8f9fa;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

/* Wrapper untuk slide */
.swiper-wrapper {
    width: 100%;
    height: 110%;
}

/* Setiap slide */
.swiper-slide {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

/* Gambar di dalam slide */
.swiper-slide-img {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Pagination */
.swiper-pagination {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 10;
}

.swiper-pagination-bullet {
    width: 15px;
    height: 15px;
    border: 1px solid #ffffffc9;
    background: rgba(223, 223, 223, 0.8);
    opacity: 0.7;
    display: inline-block;
    margin: 0 4px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet:hover {
    opacity: 1;
    transform: scale(1.3);
}

.swiper-pagination-bullet-active {
    background: #25D366;
    opacity: 1;
    transform: scale(1.3);
}

/* Indikator jumlah gambar */
.image-counter {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    z-index: 10;
}

/* Fallback jika gambar error */
.img-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #666;
    font-size: 14px;
}

/* Loading indicator */
.swiper-slide-img.loading {
    background-color: #f5f5f5;
    background-image: none;
    position: relative;
}

.swiper-slide-img.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #dd6b20;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* WhatsApp Pulse Animation - Diperbarui */
@keyframes pulse-whatsapp {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes typing-effect {
    0%, 90%, 100% {
        width: 0;
        border-right: 2px solid transparent;
    }
    30%, 60% {
        width: 100%;
        border-right: 2px solid #25D366;
    }
}

@keyframes glow {
    0%, 100% {
        filter: drop-shadow(0 0 2px rgba(37, 211, 102, 0.7));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(37, 211, 102, 0.9));
    }
}

/* WhatsApp Mobile Button - DIUBAH TOTAL */
.whatsapp-button-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: #25D366;
    border: 2px solid #25D366;
    padding: 8px 15px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 120px;
    justify-content: center;
}

.whatsapp-button-mobile::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 211, 102, 0.1), transparent);
    transition: 0.5s;
}

.whatsapp-button-mobile:hover::before {
    left: 100%;
}

.whatsapp-button-mobile:hover {
    background: #25D366;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.whatsapp-button-mobile:active {
    transform: translateY(0);
}

/* WhatsApp Icon Container */
.whatsapp-pulse-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #25D366;
    color: white;
    font-size: 14px;
    position: relative;
    animation: 
        pulse-whatsapp 2s infinite,
        float 3s ease-in-out infinite,
        glow 2s ease-in-out infinite;
    flex-shrink: 0;
}

.whatsapp-pulse-circle i {
    position: relative;
    z-index: 1;
}

/* Typing Text Animation - DIUBAH */
.typing-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    font-weight: 600;
    color: #25D366;
    animation: typing-effect 5s infinite;
    max-width: 80px;
    text-align: center;
}

.whatsapp-button-mobile:hover .typing-text {
    color: white;
    animation: none;
    width: auto !important;
    border-right: none;
}

.whatsapp-button-mobile:hover .whatsapp-pulse-circle {
    animation: none;
    transform: scale(1.1);
    background: white;
    color: #25D366;
}

/* ========================
   RESPONSIVE 480px LAYOUT
   ======================== */
@media (max-width: 480px) {
    header {
        padding: 10px 15px;
        justify-content: flex-start;
        gap: 10px;
    }
    
    /* Layout khusus untuk mobile */
    .mobile-header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 8px;
    }
    
    /* Tombol Back */
    .mobile-back-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: #f8f9fa;
        border-radius: 50%;
        color: #333;
        text-decoration: none;
        flex-shrink: 0;
        transition: all 0.3s ease;
    }
    
    .mobile-back-btn:hover {
        background: #e9ecef;
        transform: scale(1.1);
    }
    
    .mobile-back-btn i {
        font-size: 18px;
    }

    .store-profile.desktop {
        display: none;
    }
    
    /* Avatar lebih kecil */
    .store-avatar {
        width: 36px;
        height: 36px;
        border-width: 1.5px;
        flex-shrink: 0;
    }
    
    /* Store info lebih minimal */
    .store-info {
        flex: 1;
        min-width: 0;
    }
    
    .store-name {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .store-username {
        font-size: 11px;
    }
    
    /* WhatsApp Button Mobile - Responsive */
    .whatsapp-button-mobile {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 110px;
    }
    
    .whatsapp-pulse-circle {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }
    
    .typing-text {
        font-size: 11px;
        max-width: 70px;
    }
    
    /* Sembunyikan desktop WhatsApp button */
    .whatsapp-button {
        display: none;
    }
    
    /* Tampilkan store-profile */
    .store-profile {
        flex: 1;
        min-width: 0;
        gap: 8px;
    }
    
    /* Swiper adjustments */
    .swiper-container {
        height: 320px;
    }
    
    .swiper-pagination {
        bottom: 10px;
    }
    
    .swiper-pagination-bullet {
        width: 12px;
        height: 12px;
    }
    
    .image-counter {
        top: 10px;
        right: 10px;
        font-size: 11px;
        padding: 3px 8px;
    }
}

/* Untuk desktop/tablet */
@media (min-width: 481px) {
    .mobile-header-container,
    .whatsapp-button-mobile {
        display: none;
    }
    
    .store-profile.desktop {
        display: flex;
    }
}

/* Extra Small Devices */
@media (max-width: 360px) {
    .whatsapp-button-mobile {
        min-width: 100px;
        padding: 5px 10px;
    }
    
    .typing-text {
        max-width: 60px;
        font-size: 10px;
    }
    
    .whatsapp-pulse-circle {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
}