/* ========================================
   Sanpu Power Portfolio Shortcodes
   Modern B2B Product Gallery Style
   ======================================== */

/* ----------------------------------------
   1. Product Gallery
   ---------------------------------------- */
.portfolio-product-gallery {
    max-width: 600px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Main Image Area */
.portfolio-gallery-main {
    position: relative;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.portfolio-gallery-stage {
    width: 100%;
    height: 100%;
    position: relative;
}

.portfolio-gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.portfolio-gallery-slide.active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

.portfolio-gallery-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Navigation Arrows */
.portfolio-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
    color: #333;
}

.portfolio-gallery-nav:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    color: #ff2000;
}

.portfolio-gallery-prev { left: 12px; }
.portfolio-gallery-next { right: 12px; }

/* Thumbnails Area */
.portfolio-gallery-thumbs-wrapper {
    display: flex;
    align-items: center;
    margin-top: 12px;
    gap: 8px;
}

.portfolio-gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow: hidden;
    flex: 1;
    scroll-behavior: smooth;
}

.portfolio-thumb-item {
    flex: 0 0 calc(20% - 6.4px);
    aspect-ratio: 1 / 1;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f5f5f5;
}

.portfolio-thumb-item:hover {
    border-color: #ddd;
}

.portfolio-thumb-item.active {
    border-color: #ff2000;
}

.portfolio-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Thumbnail Navigation */
.portfolio-thumbs-nav {
    width: 28px;
    height: 28px;
    border: 1px solid #e8e8e8;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #666;
    transition: all 0.2s ease;
}

.portfolio-thumbs-nav:hover {
    border-color: #ff2000;
    color: #ff2000;
}

.portfolio-thumbs-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Image Counter */
.portfolio-gallery-counter {
    display: none;
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    color: #999;
}

.portfolio-current {
    color: #333;
    font-weight: 600;
}

/* ----------------------------------------
   2. Hero Specs (Compact List Style)
   ---------------------------------------- */
.portfolio-hero-specs {
    font-size: 13px;
    line-height: 1.6;
    color: #555;
}

.portfolio-spec-row {
    padding: 5px 0 5px 16px;
    font-size: 14px;
    position: relative;
}

.portfolio-spec-row::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #ff2000;
    font-weight: bold;
}

.portfolio-spec-row:last-child {
    border-bottom: none;
}

.portfolio-spec-label {
    color: #333;
    font-weight: 500;
}

.portfolio-spec-value {
    color: #555;
}

/* ----------------------------------------
   3. Basic Spec & Specs Table
   ---------------------------------------- */
.portfolio-basic-spec,
.portfolio-specs-table {
    line-height: 1.8;
    color: #333;
}

.portfolio-basic-spec img,
.portfolio-specs-table img {
    max-width: 100%;
    height: auto;
}

/* Specs Table - Proper Table Styling */
.portfolio-specs-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.portfolio-specs-table table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 14px;
    margin: 0;
}

.portfolio-specs-table td,
.portfolio-specs-table th {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    vertical-align: top;
}

.portfolio-specs-table td:first-child,
.portfolio-specs-table th:first-child {
    font-weight: 600;
    background: #fafafa;
    width: 20%;
}

.portfolio-specs-table tr:nth-child(even) {
    background: #fafafa;
}

.portfolio-specs-table tr:hover {
    background: #f5f5f5;
}

/* Responsive Table */
@media (max-width: 768px) {
    .portfolio-specs-table table {
        font-size: 13px;
    }
    
    .portfolio-specs-table td,
    .portfolio-specs-table th {
        padding: 8px;
    }
}

/* ----------------------------------------
   4. Brochure Button
   ---------------------------------------- */
.portfolio-brochure-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.portfolio-brochure-btn:hover {
    border-color: #ff2000;
    color: #ff2000;
    box-shadow: 0 2px 8px rgba(255, 32, 0, 0.1);
}

.portfolio-brochure-btn svg {
    flex-shrink: 0;
}

/* ----------------------------------------
   5. CTA Button
   ---------------------------------------- */
.portfolio-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: #ff2000;
    color: #fff;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 32, 0, 0.3);
}

.portfolio-cta-btn:hover {
    background: #e01c00;
    box-shadow: 0 4px 12px rgba(255, 32, 0, 0.4);
    transform: translateY(-1px);
}

.portfolio-cta-btn svg {
    flex-shrink: 0;
}

/* ----------------------------------------
   6. Related Products
   ---------------------------------------- */
.portfolio-related-products {
    margin-top: 0;
    padding-top: 40px;
    border-top: 1px solid #e8e8e8;
}

.portfolio-related-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 24px;
}

.portfolio-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.portfolio-related-item {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.portfolio-related-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.portfolio-related-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.portfolio-related-image {
    aspect-ratio: 1 / 1;
    background: #f5f5f5;
    overflow: hidden;
}

.portfolio-related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.portfolio-related-item:hover .portfolio-related-image img {
    transform: scale(1.05);
}

.portfolio-related-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

.portfolio-related-info {
    padding: 16px;
}

.portfolio-related-category {
    display: inline-block;
    font-size: 12px;
    color: #ff2000;
    font-weight: 500;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.portfolio-related-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portfolio-related-view {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
    transition: color 0.2s ease;
}

.portfolio-related-view::after {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: rotate(45deg);
}

.portfolio-related-item:hover .portfolio-related-view {
    color: #ff2000;
}

/* ----------------------------------------
   Responsive
   ---------------------------------------- */
@media (max-width: 1024px) {
    .portfolio-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .portfolio-gallery-main {
        border-radius: 4px;
    }
    
    .portfolio-gallery-nav {
        width: 36px;
        height: 36px;
    }
    
    .portfolio-thumb-item {
        flex: 0 0 calc(25% - 6px);
    }
    
    .portfolio-thumbs-nav {
        display: none;
    }
    
    .portfolio-related-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .portfolio-hero-specs {
        padding: 16px;
    }
    
    .portfolio-spec-row {
        flex-direction: column;
        gap: 4px;
    }
    
    .portfolio-spec-value {
        text-align: left;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .portfolio-gallery-main {
        touch-action: pan-y;
    }
    
    .portfolio-related-item:hover {
        transform: none;
    }
}
