/* ProTechTrader Modern Product Page Design 2026 */

:root {
    --ptt-primary: #1a1a1a;
    --ptt-secondary: #4a5568;
    --ptt-muted: #94a3b8;
    --ptt-accent: #3b82f6;
    --ptt-accent-dark: #2563eb;
    --ptt-bg-card: #ffffff;
    --ptt-bg-body: #f8fafc;
    --ptt-border: #e2e8f0;
    --ptt-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --ptt-radius: 8px;
    --ptt-font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
}

/* Base Wrapper Override */
.s_modern_product {
    font-family: var(--ptt-font-sans) !important;
    color: var(--ptt-primary);
    padding: 10px 0 60px 0;
}

/* ==========================================================================
   LAYOUT GRID (2 COLUMNS)
   ========================================================================== */
.ptt-product-layout {
    display: grid;
    grid-template-columns: 65fr 35fr; /* Column 1 (65%) for gallery/tabs, Column 2 (35%) for payment/FBT */
    grid-template-rows: auto auto auto auto; /* Row 1: title, Row 2: gallery/payment, Row 3: tabs/FBT, Row 4: related */
    gap: 24px 32px; /* row-gap column-gap */
    margin-bottom: 24px;
    align-items: start; /* Align items to top of their grid area */
}

/* Product Title Row - Full Width */
.ptt-product-title-row {
    grid-column: 1 / -1; /* Span full width */
    margin-bottom: 8px;
}

.ptt-product-title-row h1 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    color: var(--ptt-primary);
}

/* Product Gallery - Column 1 (65% - wider on LEFT) */
.ptt-gallery {
    grid-column: 1; /* Column 1 at 65% */
    grid-row: 2; /* Row 2 */
}

/* Product Info - Column 2 (35% - narrower on RIGHT) */
.ptt-info {
    grid-column: 2; /* Column 2 at 35% */
    grid-row: 2; /* Row 2, same as gallery */
}

/* Frequently Bought Together - Column 2 below payment */
.ptt-fbt-section {
    grid-column: 2 !important; /* Column 2 at 35% */
    grid-row: 3 !important; /* Row 3, directly below payment */
}

/* Related Products - Column 2 below FBT */
.ptt-related-section {
    grid-column: 2 !important; /* Column 2 at 35% */
    grid-row: 4 !important; /* Row 4, below FBT */
}

@media (max-width: 960px) {
    .ptt-product-layout {
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .ptt-product-layout {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   LEFT COLUMN: IMAGES
   ========================================================================== */
.ptt-gallery {
    position: relative;
}

/* Gallery Arrow Buttons - positioned on edges of main image */
.ptt-arrow {
    position: absolute;
    top: 180px; /* Center vertically on main image area */
    z-index: 10;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.ptt-arrow:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.05);
}
.ptt-arrow-left {
    left: 8px; /* Right on left edge of main image */
}
.ptt-arrow-right {
    right: 8px; /* Right on right edge of main image */
}

.ptt-main-image {
    background: white;
    border: 1px solid var(--ptt-border);
    border-radius: var(--ptt-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px; /* Whitespace reduction */
    min-height: 350px;
}

.ptt-main-image img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.ptt-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px; /* Scrollbar space */
    margin-bottom: 0; /* Remove bottom margin */
}

.ptt-thumbs a {
    flex: 0 0 70px;
    height: 70px;
    border: 1px solid var(--ptt-border);
    border-radius: 6px;
    padding: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.ptt-thumbs a:hover, .ptt-thumbs a.active {
    border-color: var(--ptt-accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.ptt-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ==========================================================================
   RIGHT COLUMN: INFO
   ========================================================================== */
/* Note: h1 title now in .ptt-product-title-row above the grid */

.ptt-meta-row {
    display: flex;
    align-items: flex-start; /* Align to top for stacked layout */
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--ptt-secondary);
    border-bottom: 1px solid var(--ptt-border);
    padding-bottom: 16px;
}

.ptt-meta-item {
    display: flex;
    flex-direction: column; /* Stack label and value */
    gap: 2px;
}

.ptt-meta-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--ptt-muted);
    text-transform: uppercase;
}

.ptt-meta-value, .ptt-stock-badge, .ptt-meta-item > div {
    font-weight: 600;
    color: var(--ptt-primary);
}

.ptt-stock-badge {
    padding: 3px 10px;
    border-radius: 99px;
    font-weight: 600;
    font-size: 11px;
    background: #dcfce7;
    color: #166534;
    text-align: center;
}

.ptt-stock-badge.out {
    background: #fee2e2;
    color: #991b1b;
}

/* Price Box */
.ptt-price-section {
    margin-bottom: 24px;
}

.ptt-price-main {
    font-size: 32px;
    font-weight: 700;
    color: var(--ptt-primary);
    letter-spacing: -0.02em;
}

.ptt-price-promo {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.ptt-price-promo .ptt-price-main {
    color: #dc2626; /* Red-600 */
}

.ptt-price-old {
    text-decoration: line-through;
    color: var(--ptt-muted);
    font-size: 18px;
}

/* Options & Actions */
.ptt-options-box {
    background: #f8fafc;
    border: 1px solid var(--ptt-border);
    border-radius: var(--ptt-radius);
    padding: 16px;
    margin-bottom: 16px; /* Reduced from 20px */
}

.ptt-options-container {
    margin-bottom: 16px; /* Add spacing after options */
}

.ptt-option-group {
    margin-bottom: 12px;
}

.ptt-option-group:last-child {
    margin-bottom: 0;
}

.ptt-option-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.ptt-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ptt-radio-item input[type="radio"] {
    display: none;
}

.ptt-radio-item .ptt-radio-label {
    display: block;
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--ptt-border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.ptt-radio-item input[type="radio"]:checked + .ptt-radio-label {
    background-color: #eff6ff; /* blue-50 */
    border-color: var(--ptt-accent);
    color: var(--ptt-accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
    font-weight: 600;
}

.ptt-radio-label span {
    vertical-align: middle;
}

.ptt-radio-price {
    color: var(--ptt-muted);
    font-size: 12px;
    margin-left: 6px;
}

/* Modern Inputs */
.ptt-select, .ptt-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ptt-border);
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.ptt-select:focus, .ptt-input:focus {
    border-color: var(--ptt-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Express & Cart Buttons - Uniform sizing */
.ptt-express-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px;
    margin-bottom: 16px;
    width: 100%;
    position: relative;
    z-index: 100;
}

.ptt-express-row-1 {
    width: 100%;
}

.ptt-express-row-2 {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping */
    gap: 8px;
    width: 100%;
}

.ptt-btn-express {
    display: flex !important;
    align-items: center;
    justify-content: center;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    border-radius: 4px;
    transition: all 0.2s;
    background-color: #fff;
    border: 1px solid #dadce0;
    padding: 0; /* Remove padding for full image */
    text-decoration: none;
    flex: 1 0 150px; /* Grow, Don't Shrink, Min 150px */
    overflow: hidden;
}
.ptt-btn-express:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    border-color: #bbb;
}
.ptt-btn-express img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Fill container */
    max-height: none;
}

/* Google Pay Button Container - Match other express buttons */
#gpay-buynow-container {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: 42px !important;
    overflow: hidden !important;
}
#gpay-buynow-container button,
#gpay-buynow-container > div,
#gpay-buynow-container > div > div,
#gpay-buynow-container iframe,
#gpay-buynow-container .gpay-button {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    border-radius: 4px !important;
    width: 100% !important;
}

/* All express buttons get uniform flex sizing */
.ptt-express-buttons > * {
    /* Removed specific flex sizing to allow rows to handle it */
}

/* Amazon Pay Button Container (hidden, triggers via custom link) */
#AmazonPayButton {
    display: none !important;
}
.ptt-cart-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.ptt-qty-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--ptt-border);
    border-radius: 6px;
    padding: 4px;
}

.ptt-qty-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: var(--ptt-secondary);
}

.ptt-qty-btn:hover {
    color: var(--ptt-primary);
    background: #f1f5f9;
    border-radius: 4px;
}

.ptt-qty-input {
    width: 40px;
    height: 38px;
    text-align: center;
    border: none;
    font-weight: 600;
    font-size: 16px;
    padding: 0;
    margin: 0;
    background: transparent;
}
.ptt-qty-input:focus { outline: none; }

.ptt-btn-primary {
    flex: 1;
    min-width: 150px;
    background: var(--ptt-accent);
    color: white;
    border: none;
    height: 48px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
}

.ptt-btn-primary:hover {
    background: var(--ptt-accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(59, 130, 246, 0.3);
}

/* Secondary Actions (Wishlist/Compare) */
.ptt-secondary-actions {
    display: flex;
    gap: 24px;
    margin-top: 16px; /* Reduced from 24px */
    margin-bottom: 8px; /* Add small bottom margin */
    justify-content: center;
}

.ptt-link-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--ptt-secondary);
    text-decoration: none;
    cursor: pointer;
}

.ptt-link-btn:hover {
    color: var(--ptt-accent);
}

/* ==========================================================================
   TABS SECTION
   ========================================================================== */
.ptt-tabs-wrapper {
    grid-column: 1 !important; /* Column 1 (same as gallery, 65% - wider) */
    grid-row: 3 !important; /* Row 3 (below gallery) */
    margin-top: 8px; /* Reduced from 20px */
}

.ptt-tabs-nav {
    display: flex;
    gap: 32px;
    border-bottom: 1px solid var(--ptt-border);
    margin-bottom: 16px; /* Reduced from 20px */
    padding-top: 0; /* Remove top padding */
    flex-wrap: wrap;
}

.ptt-tab-link {
    padding: 12px 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--ptt-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    cursor: pointer;
}

.ptt-tab-link.active {
    color: var(--ptt-accent);
    border-bottom-color: var(--ptt-accent);
}

.ptt-tab-content {
    display: none;
    line-height: 1.7;
    color: var(--ptt-secondary);
    font-size: 16px;
    max-width: 800px;
}

.ptt-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.ptt-tab-content h3 {
    font-size: 20px;
    color: var(--ptt-primary);
    margin: 30px 0 16px;
}

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

/* Related Products Header */
.ptt-related-header {
    margin-top: 60px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ptt-border);
}

.ptt-related-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--ptt-primary);
    margin: 0;
}

/* Specs Table */
.ptt-specs-table {
    width: 100%;
    border-collapse: collapse;
}

.ptt-specs-table tr {
    border-bottom: 1px solid var(--ptt-border);
}

.ptt-specs-table td {
    padding: 12px 0;
}

.ptt-specs-table td:first-child {
    font-weight: 600;
    width: 200px;
    color: var(--ptt-primary);
}

/* Mobile Tweaks */
@media (max-width: 480px) {
    .ptt-cart-actions {
        flex-direction: column;
    }

    .ptt-qty-wrapper {
        width: 100%;
        justify-content: space-between;
        padding: 8px;
    }

    .ptt-btn-primary {
        width: 100%;
    }
}

/* ==========================================================================
   FREQUENTLY BOUGHT TOGETHER
   ========================================================================== */
.ptt-fbt-section {
    margin-top: 48px;
    padding: 32px;
    background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
    border: 1px solid #e0f2fe;
    border-radius: 12px;
}

.ptt-fbt-header {
    margin-bottom: 24px;
}

.ptt-fbt-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--ptt-primary);
    margin: 0 0 4px 0;
}

.ptt-fbt-subtitle {
    font-size: 14px;
    color: var(--ptt-secondary);
    margin: 0;
}

.ptt-fbt-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ptt-fbt-items {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ptt-fbt-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--ptt-border);
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 0;
    flex: 1 1 200px;
    max-width: 320px;
    transition: opacity 0.3s, box-shadow 0.2s;
}

.ptt-fbt-item:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.ptt-fbt-current {
    border-color: var(--ptt-accent);
    background: #eff6ff;
}

.ptt-fbt-plus {
    font-size: 28px;
    font-weight: 700;
    color: var(--ptt-accent);
    flex-shrink: 0;
    transition: opacity 0.3s;
}

.ptt-fbt-check {
    flex-shrink: 0;
}

.ptt-fbt-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--ptt-accent);
    cursor: pointer;
}

.ptt-fbt-check label {
    display: none;
}

.ptt-fbt-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ptt-fbt-thumb img {
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
    border-radius: 6px;
}

.ptt-fbt-detail {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ptt-fbt-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ptt-accent);
}

.ptt-fbt-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--ptt-primary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ptt-fbt-name a {
    color: inherit;
    text-decoration: none;
}

.ptt-fbt-name a:hover {
    color: var(--ptt-accent);
}

.ptt-fbt-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--ptt-primary);
}

.ptt-fbt-price-old {
    font-size: 12px;
    color: var(--ptt-muted);
    text-decoration: line-through;
}

.ptt-fbt-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 2px solid var(--ptt-accent);
    border-radius: 10px;
    padding: 16px 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.ptt-fbt-total {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.ptt-fbt-total-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--ptt-secondary);
}

.ptt-fbt-total-price {
    font-size: 26px;
    font-weight: 800;
    color: var(--ptt-primary);
}

.ptt-fbt-items-count {
    font-size: 13px;
    color: var(--ptt-muted);
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 20px;
}

.ptt-fbt-add-all {
    white-space: nowrap;
    font-size: 16px;
    padding: 12px 28px;
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
    .ptt-fbt-section {
        padding: 20px 16px;
    }
    .ptt-fbt-items {
        flex-direction: column;
        align-items: stretch;
    }
    .ptt-fbt-item {
        max-width: 100%;
    }
    .ptt-fbt-plus {
        text-align: center;
        font-size: 22px;
    }
    .ptt-fbt-summary {
        flex-direction: column;
        text-align: center;
    }
    .ptt-fbt-total {
        justify-content: center;
    }
    .ptt-fbt-add-all {
        width: 100%;
    }
}

/* ==========================================================================
   RELATED PRODUCTS SECTION
   ========================================================================== */
.ptt-related-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--ptt-border);
}

.ptt-related-header {
    margin-bottom: 24px;
}

.ptt-related-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--ptt-primary);
    margin: 0;
}
