/* ==========================================================================
   Smyou Pro Product Stylesheet (product.css)
   ========================================================================== */

/* 1. Product Cards & Grids */
.products-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-top: 25px;
}

.products-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 25px;
}

.products-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Product Card Styling */
.product-card {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius);
    padding: 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    box-shadow: var(--box-shadow-soft);
    transition: transform var(--transition-speed), border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow-medium);
}

/* Badges */
.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 5;
}

.badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
}

.badge-sale {
    background-color: var(--primary-color);
}

.badge-hot {
    background-color: var(--warning-yellow);
}

/* Image Container */
.product-card-img {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
}

.product-card-img img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-card-img img {
    transform: scale(1.08);
}

/* Card Body */
.product-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.product-brand {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 10px;
    height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-name a:hover {
    color: var(--primary-color);
}

/* Prices */
.product-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: auto;
    min-height: 25px;
}

.price-current {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
}

.price-old {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: line-through;
    white-space: nowrap;
}

/* Actions Footer */
.product-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    width: 100%;
}

.add-to-cart-form {
    flex: 0 0 38px;
}

.buy-now-form {
    flex: 1;
    display: flex;
}

.btn-icon-add {
    background-color: var(--primary-color-light);
    color: var(--primary-color);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background var(--transition-speed), color var(--transition-speed);
}

.btn-icon-add:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-buy-now {
    flex: 1;
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background var(--transition-speed);
}

.btn-buy-now:hover {
    background-color: var(--primary-color-hover);
}

/* 2. Catalog View Layout */
.catalog-layout {
    display: grid;
    grid-template-columns: 3fr 9fr;
    gap: 30px;
    margin-top: 30px;
}

/* Sidebar Filters styling */
.sidebar-filters {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
}

.filter-section {
    margin-bottom: 30px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color-light);
}

.filter-list li {
    margin-bottom: 8px;
}

.filter-list li a {
    display: block;
    font-size: 0.9rem;
    padding: 6px 10px;
    border-radius: 4px;
    color: var(--text-dark);
}

.filter-list li a:hover {
    background-color: var(--bg-gray);
    color: var(--primary-color);
    padding-left: 15px;
}

.filter-list li a.active {
    background-color: var(--primary-color-light);
    color: var(--primary-color);
    font-weight: 600;
}

/* Custom Price Form */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.price-inputs input {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.btn-filter-price {
    width: 100%;
    background-color: var(--text-dark);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-speed);
}

.btn-filter-price:hover {
    background-color: var(--primary-color);
}

/* Catalog Header Row */
.catalog-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.catalog-title {
    font-size: 1.6rem;
    font-weight: 700;
}

.catalog-count {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.catalog-sorting {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.catalog-sorting select {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: white;
}

/* Empty search states */
.empty-results-box {
    text-align: center;
    padding: 60px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-large);
    background-color: var(--bg-gray);
}

.empty-icon {
    font-size: 3.5rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.empty-results-box h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.empty-results-box p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Best Sellers Landing Hero */
.best-sellers-hero {
    background-size: cover;
    background-position: center;
    padding: 60px 40px;
    color: white;
    border-radius: var(--border-radius-large);
    min-height: 220px;
    display: flex;
    align-items: center;
}

.hero-inner h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin: 8px 0;
}

.hero-inner p {
    font-size: 1.05rem;
    opacity: 0.95;
    max-width: 600px;
}

.badge-hot-tag {
    background-color: white;
    color: var(--primary-color);
    font-weight: 800;
    padding: 4px 12px;
    font-size: 0.8rem;
    border-radius: 50px;
    display: inline-block;
}

/* 3. Product Details Page Styling */
.product-details-grid {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 40px;
    margin-top: 30px;
}

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-image-wrapper {
    position: relative;
    border: 1px solid var(--border-color-light);
    border-radius: var(--border-radius-large);
    overflow: hidden;
    background-color: white;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image-wrapper img {
    max-height: 90%;
    max-width: 90%;
    object-fit: contain;
}

.detail-badge-sale {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--primary-color);
    color: white;
    font-weight: 700;
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
    z-index: 5;
}

/* Product Info Panel */
.product-info-panel {
    display: flex;
    flex-direction: column;
}

.info-brand {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.info-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 15px;
}

.info-meta-row {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.info-price-box {
    background-color: var(--bg-gray);
    border-radius: var(--border-radius);
    padding: 20px 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border-color-light);
}

.price-current-large {
    color: var(--primary-color);
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
}

.price-old-large {
    color: var(--text-muted);
    font-size: 1.2rem;
    text-decoration: line-through;
    margin-top: 5px;
}

.price-save {
    display: inline-block;
    background-color: var(--primary-color-light);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 4px;
    margin-top: 8px;
}

.info-description {
    font-size: 0.95rem;
    color: #424242;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Purchase actions block */
.info-actions-box {
    border-top: 1px solid var(--border-color);
    padding-top: 25px;
    margin-bottom: 30px;
}

.quantity-selector-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.quantity-selector-row label {
    font-weight: 600;
    font-size: 0.95rem;
}

.qty-control {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    width: 120px;
    height: 40px;
}

.btn-qty {
    background-color: var(--bg-gray);
    border: none;
    width: 35px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-speed);
}

.btn-qty:hover {
    background-color: #e0e0e0;
}

.qty-control input {
    width: 50px;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    text-align: center;
    font-weight: 600;
}

.action-buttons-row {
    display: flex;
    gap: 15px;
}

.action-buttons-row .btn {
    flex: 1;
}

.out-of-stock-box {
    background-color: #fafafa;
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.detail-service-promises {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    border-top: 1px solid var(--border-color-light);
    padding-top: 25px;
    margin-top: 10px;
}

.promise-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.promise-item i {
    font-size: 1.4rem;
    color: var(--primary-color);
}

/* Tabs: Specs / Details */
.details-tab-section {
    margin-top: 50px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: white;
}

.tabs-header {
    display: flex;
    background-color: var(--bg-gray);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 30px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    border-right: 1px solid var(--border-color);
    color: var(--text-muted);
}

.tab-btn.active {
    background-color: white;
    color: var(--primary-color);
    position: relative;
}

.tabs-content {
    padding: 30px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Specs Table */
.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid var(--border-color-light);
}

.specs-table tr:last-child {
    border-bottom: none;
}

.specs-table td {
    padding: 12px 15px;
    font-size: 0.95rem;
}

.spec-label {
    font-weight: 600;
    width: 30%;
    color: #424242;
    background-color: #fafafa;
}

.spec-val {
    color: var(--text-dark);
}

/* Responsive grid adjustments */
@media (max-width: 1200px) {
    .products-grid-5 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .products-grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
    .products-grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    .catalog-layout {
        grid-template-columns: 1fr;
    }
    .product-details-grid {
        grid-template-columns: 1fr;
    }
    .main-image-wrapper {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .products-grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }
    .products-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .products-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .catalog-header-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .catalog-sorting {
        width: 100%;
        justify-content: space-between;
    }
    .action-buttons-row {
        flex-direction: column;
    }
    .action-buttons-row .btn {
        width: 100%;
    }
    .detail-service-promises {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .products-grid-5 {
        grid-template-columns: 1fr;
    }
    .products-grid-4 {
        grid-template-columns: 1fr;
    }
    .products-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Combo Details Modal
   ========================================================================== */
.combo-details-btn-wrapper {
    margin-top: 10px;
    width: 100%;
}

.btn-combo-details {
    width: 100%;
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-speed);
}

.btn-combo-details:hover {
    background-color: var(--primary-color-light);
}

.combo-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    overflow: auto;
}

.combo-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: var(--border-radius-large);
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.combo-modal-close {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.combo-modal-close:hover,
.combo-modal-close:focus {
    color: var(--primary-color);
    text-decoration: none;
}

.combo-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color-light);
}

.combo-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.combo-info-box {
    background-color: var(--bg-gray);
    padding: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.combo-info-box h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.combo-info-box p {
    font-size: 0.95rem;
    color: #424242;
    line-height: 1.5;
}

.combo-info-box ul {
    list-style: none;
    padding: 0;
}

.combo-info-box ul li {
    font-size: 0.95rem;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #424242;
}

.combo-modal-footer {
    margin-top: 25px;
    text-align: right;
    border-top: 1px solid var(--border-color-light);
    padding-top: 15px;
}

@media (max-width: 768px) {
    .combo-modal-body {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Combo Details Modal
   ========================================================================== */
.combo-details-btn-wrapper {
    margin-top: 10px;
    width: 100%;
}

.btn-combo-details {
    width: 100%;
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-speed);
}

.btn-combo-details:hover {
    background-color: var(--primary-color-light);
}

.combo-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    overflow: auto;
}

.combo-modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: var(--border-radius-large);
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.combo-modal-close {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.combo-modal-close:hover,
.combo-modal-close:focus {
    color: var(--primary-color);
    text-decoration: none;
}

.combo-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color-light);
}

.combo-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.combo-info-box {
    background-color: var(--bg-gray);
    padding: 20px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.combo-info-box h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.combo-info-box p {
    font-size: 0.95rem;
    color: #424242;
    line-height: 1.5;
}

.combo-info-box ul {
    list-style: none;
    padding: 0;
}

.combo-info-box ul li {
    font-size: 0.95rem;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #424242;
}

.combo-modal-footer {
    margin-top: 25px;
    text-align: right;
    border-top: 1px solid var(--border-color-light);
    padding-top: 15px;
}

@media (max-width: 768px) {
    .combo-modal-body {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Advanced Product Gallery
   ========================================================================== */
.advanced-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gallery-main-display {
    position: relative;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    aspect-ratio: 1 / 0.85;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: crosshair;
}

.gallery-main-display img {
    max-height: 92%;
    max-width: 92%;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-main-display:hover img {
    transform: scale(1.15);
}

.gallery-main-display .gallery-zoom-hint {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-main-display:hover .gallery-zoom-hint {
    opacity: 1;
}

/* Layout selector controls (Showcase / Technical / Diagram) */
.gallery-layout-controls {
    display: flex;
    gap: 6px;
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
}

.layout-ctrl-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: rgba(255,255,255,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #888;
    transition: all 0.25s;
    backdrop-filter: blur(4px);
}

.layout-ctrl-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #fff;
}

.layout-ctrl-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(229,57,53,0.3);
}

/* Thumbnails row */
.gallery-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
}

.gallery-thumb {
    flex: 0 0 72px;
    height: 72px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.25s, box-shadow 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
}

.gallery-thumb:hover {
    border-color: #bbb;
}

.gallery-thumb.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(229,57,53,0.2);
}

.gallery-thumb img {
    height: 90%;
    width: 90%;
    object-fit: contain;
}

/* Gallery view panels (Showcase / Technical / Diagram) */
.gallery-view-panel {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.gallery-view-panel.active {
    display: flex;
}

.gallery-view-panel img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ==========================================================================
   Technical Port Diagram (SVG-based)
   ========================================================================== */
.tech-port-diagram {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 16px;
}

.port-diagram-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.port-row {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.port-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.port-icon {
    width: 32px;
    height: 26px;
    border: 2px solid #666;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
    color: #555;
    background: #f0f0f0;
    position: relative;
}

.port-icon.wan { border-color: #1976d2; background: #e3f2fd; color: #1565c0; }
.port-icon.lan { border-color: #388e3c; background: #e8f5e9; color: #2e7d32; }
.port-icon.sfp { border-color: #f57c00; background: #fff3e0; color: #e65100; }
.port-icon.console { border-color: #7b1fa2; background: #f3e5f5; color: #6a1b9a; }
.port-icon.power { border-color: #d32f2f; background: #ffebee; color: #c62828; }
.port-icon.fortilink { border-color: #00838f; background: #e0f7fa; color: #006064; }
.port-icon.usb { border-color: #455a64; background: #eceff1; color: #37474f; }
.port-icon.ha { border-color: #e65100; background: #fff3e0; color: #bf360c; }

.port-label {
    font-size: 0.6rem;
    color: #888;
    font-weight: 600;
    text-align: center;
    max-width: 50px;
    line-height: 1.2;
}

.port-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: 1px dashed #ddd;
    border-radius: 8px;
    background: rgba(255,255,255,0.6);
}

.port-group-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ==========================================================================
   Network Topology Diagram
   ========================================================================== */
.network-diagram {
    width: 100%;
    height: 100%;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.net-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    min-width: 100px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: #444;
    transition: all 0.3s;
}

.net-node i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.net-node.firewall {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    color: var(--primary-color);
    box-shadow: 0 4px 14px rgba(229,57,53,0.15);
}

.net-node.firewall i { color: var(--primary-color); }

.net-connector {
    width: 2px;
    height: 20px;
    background: #ccc;
    position: relative;
}

.net-connector::after {
    content: '▼';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.5rem;
    color: #ccc;
}

.net-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

.net-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   Enhanced B2B Tab System
   ========================================================================== */
.b2b-tabs-enhanced {
    border-bottom: 2px solid #eee;
    margin-bottom: 25px;
    display: flex;
    gap: 0;
    overflow-x: auto;
}

.b2b-tab-btn-v2 {
    padding: 14px 28px;
    border: none;
    background: none;
    font-weight: 600;
    font-size: 1rem;
    color: #888;
    cursor: pointer;
    position: relative;
    transition: color 0.25s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.b2b-tab-btn-v2:hover {
    color: #555;
}

.b2b-tab-btn-v2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    border-radius: 3px 3px 0 0;
    transition: background 0.25s;
}

.b2b-tab-btn-v2.active {
    color: var(--primary-color);
    font-weight: 700;
}

.b2b-tab-btn-v2.active::after {
    background: var(--primary-color);
}

.b2b-tab-btn-v2 i {
    font-size: 0.9rem;
}

/* Specs Group Table */
.specs-group {
    margin-bottom: 30px;
}

.specs-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f2f5 100%);
    border-radius: 8px 8px 0 0;
    border: 1px solid #e8e8e8;
    border-bottom: none;
    margin-bottom: 0;
}

.specs-group-header i {
    font-size: 1rem;
    color: var(--primary-color);
}

.specs-group-header h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.specs-group-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e8e8e8;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.specs-group-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.specs-group-table tr:last-child {
    border-bottom: none;
}

.specs-group-table tr:hover {
    background-color: #fafcff;
}

.specs-group-table td {
    padding: 11px 18px;
    font-size: 0.9rem;
    vertical-align: top;
}

.specs-group-table td:first-child {
    font-weight: 600;
    color: #555;
    width: 38%;
    background: #fdfdfd;
    border-right: 1px solid #f0f0f0;
}

.specs-group-table td:last-child {
    color: #333;
}

/* Documentation & Support Card Grid */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.doc-card {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 22px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: #fff;
    transition: all 0.25s;
    text-decoration: none;
    color: inherit;
}

.doc-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(229,57,53,0.08);
    transform: translateY(-2px);
}

.doc-card-icon {
    flex: 0 0 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.doc-card-icon.pdf { background: #ffebee; color: #d32f2f; }
.doc-card-icon.guide { background: #e3f2fd; color: #1976d2; }
.doc-card-icon.release { background: #e8f5e9; color: #388e3c; }
.doc-card-icon.support { background: #fff3e0; color: #f57c00; }
.doc-card-icon.contact { background: #f3e5f5; color: #7b1fa2; }
.doc-card-icon.portal { background: #e0f7fa; color: #00838f; }

.doc-card-body h5 {
    font-size: 0.92rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 4px;
}

.doc-card-body p {
    font-size: 0.8rem;
    color: #888;
    margin: 0;
    line-height: 1.4;
}

/* B2B Info Fields */
.b2b-info-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 20px;
    padding: 18px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #eee;
}

.b2b-field {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
}

.b2b-field i {
    font-size: 1rem;
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.b2b-field .field-label {
    color: #888;
    font-weight: 500;
}

.b2b-field .field-value {
    font-weight: 700;
    color: #333;
}

/* Support section divider */
.docs-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #444;
    margin: 28px 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
}

.docs-section-title i {
    color: var(--primary-color);
}

/* ==========================================================================
   Responsive overrides for advanced gallery
   ========================================================================== */
@media (max-width: 992px) {
    .gallery-main-display {
        aspect-ratio: 1 / 0.75;
    }
    .gallery-thumb {
        flex: 0 0 60px;
        height: 60px;
    }
}

@media (max-width: 768px) {
    .b2b-tabs-enhanced {
        gap: 0;
    }
    .b2b-tab-btn-v2 {
        padding: 10px 16px;
        font-size: 0.88rem;
    }
    .specs-group-table td:first-child {
        width: 45%;
    }
    .docs-grid {
        grid-template-columns: 1fr;
    }
    .b2b-info-fields {
        grid-template-columns: 1fr;
    }
    .gallery-layout-controls {
        top: 8px;
        left: 8px;
    }
    .layout-ctrl-btn {
        width: 30px;
        height: 30px;
        font-size: 0.78rem;
    }
}
