/* =====================================================
   PTN Electronics — Product detail page (Amazon-style)
   ===================================================== */

.product-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .product-detail-grid { grid-template-columns: 1fr; }
}

.product-gallery-amazon {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 16px;
    align-items: start;
}

.gallery-thumbs-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow-y: auto;
}

.gallery-thumb-vertical {
    width: 80px;
    height: 80px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s;
    background: #f5f5f5;
}

.gallery-thumb-vertical:hover { border-color: #ccc; }

.gallery-thumb-vertical.active {
    border-color: #009944;
    box-shadow: 0 0 0 1px #009944;
}

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

.gallery-main-amazon {
    position: relative;
    width: 100%;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.gallery-main-amazon img#main-product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    display: block;
}

@media (max-width: 900px) {
    .product-gallery-amazon { grid-template-columns: 1fr; }
    .gallery-thumbs-vertical {
        flex-direction: row;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
    }
    .gallery-thumb-vertical { flex-shrink: 0; }
}

.product-detail-info { padding: 8px 0; }

.product-detail-info .product-cat {
    display: inline-block;
    color: #009944;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.product-detail-info h1.product-title {
    font-size: 28px;
    line-height: 1.3;
    margin: 0 0 8px;
    color: #1a1a1a;
}

.product-model-detail {
    color: #666;
    font-size: 14px;
    margin: 0 0 16px;
}

.product-model-detail strong { color: #1a1a1a; }

.product-detail-desc {
    color: #444;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 15px;
}

.product-meta-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    padding: 12px 16px;
    background: #f7f9fa;
    border-radius: 6px;
    margin: 16px 0 24px;
    font-size: 13px;
    color: #555;
}

.product-meta-strip .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-meta-strip .meta-item i {
    color: #009944;
    width: 16px;
}

.product-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 24px 0 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    color: #333;
    line-height: 1.5;
    font-size: 14px;
}

.feature-list li i {
    color: #009944;
    flex-shrink: 0;
    margin-top: 3px;
}

.product-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.btn-inquiry-now {
    background: #009944;
    color: #fff;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-inquiry-now:hover { background: #007a3a; color: #fff; }

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
    z-index: 2;
}

.badge-new { background: #2196F3; }
.badge-hot { background: #FF5722; }

.product-tabs {
    margin-top: 40px;
    border-top: 1px solid #eee;
    padding-top: 24px;
}

.tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #009944;
    margin-bottom: 24px;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}

.tab-btn:hover { color: #009944; }
.tab-btn.active {
    color: #009944;
    border-bottom-color: #009944;
}

.tab-panel { display: none; line-height: 1.7; color: #333; }
.tab-panel.active { display: block; }

.tab-panel table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.tab-panel th, .tab-panel td {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.tab-panel th {
    background: #f5f5f5;
    font-weight: 600;
    width: 30%;
}

.section-title-small {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 40px 0 20px;
}

.related-products {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Admin gallery edit grid ---------- */
.gallery-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.gallery-edit-item {
    position: relative;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 4px;
    text-align: center;
}

.gallery-edit-item img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
    margin-bottom: 4px;
}

.gallery-edit-item .del-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    color: #c00;
    cursor: pointer;
}
