/* static/css/enhanced-product-detail.css - MOBILE-FIRST Product detail page */

/* ========================================
   BASE STYLES - MOBILE (320px+)
   ======================================== */

/* Container & Layout */
.product-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px;
    background: #fff;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
}

/* ===== PRODUCT IMAGE SECTION ===== */
.product-image-section {
    position: relative;
    width: 100%;
}

.main-image {
    position: relative;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 2px solid #e9ecef;
    cursor: zoom-in;
}

.product-main-image {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
}

.zoom-hint {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.main-image:hover .zoom-hint {
    opacity: 1;
}

/* Variant Image Preview - Mobile: 2 columns */
.variant-images-preview {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.preview-image {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-image:hover {
    border-color: #009D94;
    transform: scale(1.05);
}

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

/* ===== VIEW SELECTOR SECTION ===== */
.view-selector-section {
    margin-top: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.current-variant-color {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 6px 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.color-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 13px;
}

.color-value {
    color: #009D94;
    font-weight: 600;
    font-size: 14px;
    text-transform: capitalize;
}

.view-perspective-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.view-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: 500;
    color: #6c757d;
}

.view-btn:hover {
    border-color: #009D94;
    background: #f0fffe;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 157, 148, 0.15);
}

.view-btn.active {
    border-color: #009D94;
    background: linear-gradient(135deg, #009D94 0%, #007d75 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 157, 148, 0.3);
}

.view-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.view-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.view-btn span {
    font-size: 10px;
    font-weight: 600;
}

.view-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    padding: 6px;
    color: #6c757d;
    font-size: 12px;
}

.view-loading-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #e9ecef;
    border-top-color: #009D94;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ===== PRODUCT INFO SECTION ===== */
.product-info-section {
    padding: 12px 0;
}

.product-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.2;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 600;
    color: #009D94;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-from {
    font-size: 1rem;
    color: #6c757d;
    font-weight: 400;
}

.price-currency {
    font-size: 1rem;
    color: #6c757d;
    font-weight: 400;
}

.product-description {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #009D94;
}

.product-description p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
}

/* ===== PRODUCT FORM ===== */
.product-form {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #2c3e50;
    font-size: 14px;
}

/* Variant Selection */
.variant-selection {
    margin-bottom: 20px;
}

.variant-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    font-size: 16px;
    transition: border-color 0.3s ease;
    cursor: pointer;
}

.variant-select:focus {
    outline: none;
    border-color: #009D94;
}

/* Quantity Controls */
.quantity-selection {
    margin-bottom: 20px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

.qty-btn {
    width: 44px;
    height: 44px;
    border: 2px solid #009D94;
    background: white;
    color: #009D94;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.qty-btn:hover:not(:disabled) {
    background: #009D94;
    color: white;
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty-input {
    width: 80px;
    padding: 10px 12px;
    text-align: center;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
}

.qty-input:focus {
    outline: none;
    border-color: #009D94;
}

/* ===== ADD TO CART BUTTON ===== */
.product-actions {
    margin-bottom: 20px;
}

.add-to-cart-btn {
    width: 100%;
    background: linear-gradient(135deg, #009D94 0%, #007d75 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-to-cart-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 157, 148, 0.3);
}

.add-to-cart-btn:active:not(:disabled) {
    transform: translateY(0);
}

.add-to-cart-btn .btn-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.add-to-cart-btn:hover .btn-icon {
    transform: scale(1.1);
}

.add-to-cart-btn:disabled,
.add-to-cart-btn.btn-disabled {
    background: #6c757d !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.7;
}

.add-to-cart-btn.loading {
    pointer-events: none;
    background: #6c757d !important;
}

.add-to-cart-btn.success {
    background: #28a745 !important;
}

.add-to-cart-btn.error {
    background: #dc3545 !important;
}

/* ===== PRODUCT FEATURES ===== */
.product-features {
    display: grid;
    gap: 2px;
    padding: 4px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 10px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #495057;
    font-size: 14px;
}

.feature-icon {
    width: 18px;
    height: 18px;
    color: #009D94;
}

/* ===== SOCIAL SHARE ===== */
.social-share-compact {
    display: flex;
    gap: 6px;
    margin: 6px 0;
    align-items: center;
    justify-content: flex-start;
}

.social-share-compact-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 13px;
}

.social-share-compact-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.share-facebook { background: #1877f2; }
.share-instagram { background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%); }
.share-pinterest { background: #bd081c; }

/* ===== SIZE GUIDE SECTION ===== */
.size-guide-section {
    margin: 12px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.size-guide-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: 2px solid #009D94;
    color: #009D94;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.size-guide-button:hover {
    background: #009D94;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 157, 148, 0.3);
}

.size-guide-button svg {
    width: 18px;
    height: 18px;
}

/* Size Guide Modal */

.size-guide-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
}

.size-guide-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
}

.size-guide-images {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.size-guide-page {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ===== ZOOM OVERLAY ===== */
.zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.zoom-overlay.active {
    display: flex;
}

.zoom-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    border-radius: 8px;
}

.zoom-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    background: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.zoom-close:hover {
    background: rgba(0,0,0,0.8);
}

/* ===== PRODUCT TABS (Bottom Section) ===== */
.product-bottom-section {
    margin-top: 2rem;
    width: 100%;
    grid-column: 1 / -1;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    overflow: hidden;
    position: relative;
    z-index: 10;
}

.product-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-button {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #6c757d;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.tab-button:hover {
    color: #009D94;
    background: #fff;
}

.tab-button.active {
    color: #009D94;
    background: #fff;
    border-bottom-color: #009D94;
    font-weight: 600;
}

.tab-content {
    min-height: 200px;
}

.tab-panel {
    display: none;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

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

/* Description Content */
.product-description-content p {
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 0.75rem;
}

.product-features-list h4 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-size: 16px;
}

.product-features-list ul {
    list-style: none;
    padding: 0;
}

.product-features-list li {
    padding: 6px 0 6px 20px;
    position: relative;
    color: #495057;
    font-size: 14px;
}

.product-features-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #009D94;
    font-weight: bold;
}

/* Product Details */
.product-details-content h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 18px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

.detail-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 12px;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 500;
}

/* Shipping Content */
.shipping-content h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 18px;
}

.shipping-content h5 {
    color: #009D94;
    margin: 1rem 0 0.5rem 0;
    font-size: 14px;
}

.shipping-section {
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.shipping-section ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.shipping-section li {
    margin: 0.25rem 0;
    color: #495057;
    font-size: 14px;
}

.shipping-content a {
    color: #009D94;
    text-decoration: none;
    font-weight: 500;
}

.shipping-content a:hover {
    text-decoration: underline;
}

/* ===== VIDEO SECTION ===== */
#product-video-container {
    margin: 1.5rem 0;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.product-video-wrapper {
    width: 100%;
}

.video-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: #2c3e50;
}

.video-icon {
    width: 20px;
    height: 20px;
    color: #009D94;
    flex-shrink: 0;
}

.video-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.video-embed-container {
    position: relative;
    width: 100%;
    padding-bottom: 177.78%; /* 9:16 for mobile */
    max-width: 400px;
    margin: 0 auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.video-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.youtube-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.youtube-thumbnail:hover {
    transform: scale(1.02);
}

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

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 34px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.youtube-thumbnail:hover .play-button {
    transform: translate(-50%, -50%) scale(1.1);
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.4));
}

.play-button svg {
    width: 100%;
    height: 100%;
}

.video-caption {
    margin-top: 0.5rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.8rem;
    font-style: italic;
}

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

/* ========================================
   LARGE PHONES (480px+)
   ======================================== */
@media (min-width: 480px) {
    .product-title {
        font-size: 1.5rem;
    }

    .variant-images-preview {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .view-btn {
        padding: 10px 6px;
    }

    .view-icon {
        width: 18px;
        height: 18px;
    }

    .view-btn span {
        font-size: 11px;
    }

    .social-share-compact-button {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* ========================================
   TABLETS (768px+)
   ======================================== */
@media (min-width: 768px) {
    .product-detail-container {
        padding: 20px;
    }

    .product-detail-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }

    .product-image-section {
        position: sticky;
        top: 2rem;
        z-index: 1;
        align-self: start;
    }

    .main-image {
        margin-bottom: 20px;
    }

    .variant-images-preview {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .view-selector-section {
        margin-top: 16px;
        padding: 12px;
    }

    .current-variant-color {
        font-size: 14px;
        padding: 8px 12px;
    }

    .color-label {
        font-size: 14px;
    }

    .color-value {
        font-size: 16px;
    }

    .view-perspective-buttons {
        gap: 8px;
    }

    .view-btn {
        padding: 12px 8px;
        font-size: 13px;
    }

    .view-icon {
        width: 20px;
        height: 20px;
    }

    .view-btn span {
        font-size: 12px;
    }

    .product-info-section {
        padding: 18px 0;
    }

    .product-title {
        font-size: 1.8rem;
        margin-bottom: 14px;
    }

    .product-price {
        font-size: 1.8rem;
        margin-bottom: 16px;
    }

    .price-from,
    .price-currency {
        font-size: 1.2rem;
    }

    .product-description {
        margin-bottom: 30px;
        padding: 20px;
    }

    .product-description p {
        font-size: 16px;
    }

    .form-label {
        font-size: 16px;
    }

    .variant-selection,
    .quantity-selection {
        margin-bottom: 24px;
    }

    .qty-btn {
        width: 40px;
        height: 40px;
    }

    .add-to-cart-btn {
        font-size: 18px;
    }

    .add-to-cart-btn .btn-icon {
        width: 20px;
        height: 20px;
    }

    .feature {
        font-size: 16px;
    }

    .feature-icon {
        width: 20px;
        height: 20px;
    }

    .social-share-compact {
        margin: 8px 0;
    }

    .size-guide-section {
        margin: 16px 0;
        padding: 12px;
    }

    .size-guide-button {
        font-size: 16px;
    }

    .size-guide-button svg {
        width: 20px;
        height: 20px;
    }

    .size-guide-header h3 {
        font-size: 20px;
    }

    .size-guide-images {
        gap: 20px;
    }

    .zoom-close {
        top: 20px;
        right: 30px;
        font-size: 40px;
        width: 50px;
        height: 50px;
    }

    .tab-button {
        padding: 16px 20px;
    }

    .tab-panel {
        padding: 30px;
    }

    .tab-content {
        min-height: 300px;
    }

    .product-description-content p {
        font-size: 16px;
    }

    .product-features-list h4 {
        font-size: 18px;
    }

    .product-features-list li {
        font-size: 15px;
    }

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

    .detail-item {
        padding: 12px 0;
    }

    .detail-label {
        font-size: 14px;
    }

    .detail-value {
        font-size: 16px;
    }

    .product-details-content h4,
    .shipping-content h4 {
        font-size: 20px;
        margin-bottom: 1.5rem;
    }

    .shipping-content h5 {
        font-size: 16px;
    }

    .shipping-section {
        padding: 1rem;
        margin-bottom: 2rem;
    }

    .shipping-section li {
        font-size: 15px;
    }

    /* Video - switch to 16:9 on tablet */
    .video-embed-container {
        padding-bottom: 56.25%;
        max-width: 100%;
    }

    .video-icon {
        width: 24px;
        height: 24px;
    }

    .video-header h3 {
        font-size: 1.25rem;
    }

    .play-button {
        width: 56px;
        height: 40px;
    }

    .video-caption {
        font-size: 0.875rem;
    }
}

/* ========================================
   DESKTOP (1024px+)
   ======================================== */
@media (min-width: 1024px) {
    .product-title {
        font-size: 2.0rem;
    }

    .zoom-hint {
        bottom: 15px;
        right: 15px;
        padding: 8px 12px;
        font-size: 14px;
    }

    .view-selector-section {
        padding: 16px;
    }

    .product-bottom-section {
        margin-top: 3rem;
    }

    #product-video-container {
        margin: 2rem 0;
        padding: 1.5rem;
    }

    .play-button {
        width: 68px;
        height: 48px;
    }
}

/* ========================================
   ACCESSIBILITY & PERFORMANCE
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .product-main-image,
    .preview-image,
    .view-btn,
    .add-to-cart-btn,
    .tab-panel,
    .youtube-thumbnail {
        transition: none !important;
        animation: none !important;
    }

    .main-image:hover,
    .preview-image:hover,
    .view-btn:hover,
    .add-to-cart-btn:hover {
        transform: none !important;
    }
}