.viewer-360-wrapper-v2 {
    max-width: 1400px;
    margin-top: 40px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ====================================
   2 COLUMNS LAYOUT
   ==================================== */
.viewer-360-layout {
    display: grid;
    grid-template-columns: 1fr 400px; /* Ảnh bên trái (lớn), Thông tin bên phải (400px) */
    gap: 40px;
    align-items: stretch;
}

/* ====================================
   LEFT COLUMN - ẢNH 360
   ==================================== */
.viewer-360-left-column {
    position: relative;
    height: 100%;
}

.viewer-360-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

/* Stage */
.viewer-360-stage {
    position: relative;
    width: 100%;
    /* GIẢM padding-bottom để khung chứa bớt khoảng trắng thừa trên/dưới. 
       Cũ là 65%, thử giảm xuống 50% hoặc 55% */
    padding-bottom: 60%; 
    overflow: hidden;
    cursor: grab;
    background: #fff;
}

.viewer-360-stage:active {
    cursor: grabbing;
}

/* Images */
.viewer-360-stage img {
    position: absolute;
    top: 0;     /* Khôi phục về 0 */
    left: 0;
    width: 100%;
    height: 100%; /* Khôi phục về 100% */
    object-fit: contain;
    object-position: center; /* Đưa tâm ảnh về chính giữa */
    
    /* MẤU CHỐT TẠI ĐÂY: Phóng to ảnh lên. 
       1.0 là gốc. 1.3 tức là zoom to 130%. 
       Bạn có thể đổi thành 1.4, 1.5, 1.6 cho đến khi vừa mắt */
    transform: scale(1.0); 
    
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: none;
}



.viewer-360-stage img.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* Color Gallery Management */
.color-gallery {
    display: none;
}

.color-gallery.active {
    display: block;
}

/* Loading Indicator */
.viewer-360-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
}

.viewer-360-loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #cc0000;
    border-radius: 50%;
    animation: viewer360spin 1s linear infinite;
    margin: 0 auto;
}

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

.viewer-360-loader-text {
    margin-top: 15px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Progress Bar */
.viewer-360-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #cc0000, #ff4444);
    transition: width 0.3s ease;
    z-index: 11;
}

/* 360 Badge */
.viewer-360-badge {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    pointer-events: none;
    perspective: 1000px; /* Thêm hiệu ứng 3D */
}

.badge-icon {
    width: 80px;
    height: 40px;
    background-image: url('https://hondahanam.vn/wp-content/uploads/2026/01/icon-360.webp');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: rotate360Horizontal 3s linear infinite; /* Xoay ngang liên tục */
    transform-style: preserve-3d;
}

/* Animation xoay theo chiều ngang (Y-axis) */
@keyframes rotate360Horizontal {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}

/* ====================================
   RIGHT COLUMN - THÔNG TIN SẢN PHẨM
   ==================================== */
.viewer-360-right-column {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Product Title */
.product-title h1 {
    color: #cc0000;
    font-size: 24px;
    font-weight: 900;
    margin: 0 0 20px 0;
    letter-spacing: 0.5px;
  text-transform: uppercase;
}

.product-title h5 {
    color: #333;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 15px 0;
    letter-spacing: 0.5px;
}

/* Color Options */
.product-colors {
    margin-bottom: 5px;
}

.color-options {
    display: grid;
    gap: 12px;
    margin-bottom: 2px;
    grid-template-columns: repeat(4, 1fr);
    max-width: 260px;
}

.color-option {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    padding: 0;
}

.color-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.color-option.active {
    border-color: #cc0000;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(204, 0, 0, 0.4);
}

.color-option::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.color-option.active::after {
    opacity: 1;
}

.color-selected-name {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    padding: 5px 0;
    border-bottom: 2px solid #cc0000;
    display: inline-block;
}

/* Price Section */
.product-price-label {
    font-size: 13px;
    color: #666;
    margin: 10px 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-price {
    margin-bottom: 15px;
}

.price-amount {
    font-size: 36px;
    font-weight: 700;
    color: #333;
    line-height: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.price-currency {
    font-size: 18px;
    font-weight: 500;
    color: #666;
    margin-left: 5px;
}

/* Action Buttons */
.product-actions {
    display: flex;
    flex-direction: row;
    gap: 12px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 14px 14px;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: #cc0000;
    color: white;
}

.btn-primary:hover {
    background: #a00000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(204, 0, 0, 0.3);
}

.btn-secondary {
    background: white;
    color: #cc0000;
    border: 2px solid #cc0000;
}

.btn-secondary:hover {
    background: #cc0000;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(204, 0, 0, 0.3);
}

/* ====================================
   RESPONSIVE - TABLET
   ==================================== */
@media (max-width: 1024px) {
    .viewer-360-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .viewer-360-right-column {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .viewer-360-stage {
        padding-bottom: 75%;
    }
}

/* ====================================
   RESPONSIVE - MOBILE
   ==================================== */

@media (max-width: 768px) {
    .viewer-360-wrapper-v2 {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        position: relative;
        left: 50%;
        margin-left: calc(-50vw + 10px);
        padding: 0;
        margin-top: 15px;
    }
    .viewer-360-layout {
        display: block;
        gap: 0;
    }
    .viewer-360-left-column,
    .viewer-360-container {
         width: 100%;
        border-radius: 8px !important;
        overflow: hidden;
        box-shadow: none;
        background: #fff;
      padding: 0;
      margin-top: 0;
    }
    
    .viewer-360-stage {
        padding-bottom: 60%; /* Giảm chiều cao khung cho gọn */
        background-color: #fff;
    }

    .viewer-360-stage img {
        object-fit: contain !important;
        object-position: center !important;
        /* Phóng to mạnh hơn trên điện thoại để xe rõ hơn */
        transform: scale(1.4) !important; 
    }

    .viewer-360-right-column {
        width: 100%;
        padding: 15px;
        background: #fff;
        border-radius: 8px;
        margin-top: 10px;
    }
    .product-actions {
        display: flex;
        gap: 10px;
    }
    
    .btn-primary, .btn-secondary {
        font-size: 12px;
        padding: 10px;
        white-space: nowrap;
    }
    .product-title h1 {
        font-size: 20px;
        margin-bottom: 10px;
      font-weight: 700;
       color: #cc0000;
  text-transform: uppercase;
    }
}
@media (max-width: 480px) {
    .viewer-360-wrapper-v2 {
        width: calc(100vw - 10px);
        max-width: calc(100vw - 10px);
        margin-left: calc(-50vw + 5px);
    }
  .viewer-360-stage img {
        object-fit: contain !important;
        object-position: center !important;
        /* Đảm bảo vẫn zoom trên điện thoại nhỏ */
        transform: scale(1.5) !important; 
    }

    .viewer-360-right-column {
        padding: 15px;
    }
    
    .product-title h1 {
        font-size: 18px;
      font-weight: 600;
       color: #cc0000;
  text-transform: uppercase;
    }
    
    .color-option {
        width: 40px;
        height: 40px;
    }
    
    .color-options {
        gap: 8px;
    }
    
    .price-amount {
        font-size: 24px;
    }
    
    .viewer-360-stage {
        padding-bottom: 65%; /* Khung vừa phải trên điện thoại đứng */
    }
}

/* ====================================
   FLATSOME THEME COMPATIBILITY
   ==================================== */
.ux-builder-viewport .viewer-360-stage {
    min-height: 400px;
}

.viewer-360-wrapper-v2 * {
    box-sizing: border-box;
}

.viewer-360-wrapper-v2 button {
    font-family: inherit;
}

/* Print Styles */
@media print {
    .viewer-360-badge,
    .product-actions,
    .viewer-360-loader {
        display: none !important;
    }
    
    .viewer-360-stage img:not(.active) {
        display: none !important;
    }
    
    .viewer-360-layout {
        grid-template-columns: 1fr;
    }
}