/* 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: 5fr 6fr; /* Give more space to info */
    grid-template-rows: auto 1fr; /* Title row + content row */
    gap: 24px 32px; /* row-gap column-gap */
    margin-bottom: 24px;
    align-items: start; /* Prevent gallery from stretching to match info height */
}

/* 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);
}

@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 {
    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%;
    }
}
