/**
 * Gigatek Product Page — Stylesheet
 *
 * @package Gigatek\ProductPage
 * @version 1.0.0
 */

/* ═══════════════════════════════════════════════════
   1. CSS Custom Properties
   ═══════════════════════════════════════════════════ */

:root {
    --gpp-primary: #0b2a48;
    --gpp-primary-light: #1a3d5c;
    --gpp-accent: #e8491d;
    --gpp-accent-hover: #cf3d14;
    --gpp-green: #27ae60;
    --gpp-orange: #f39c12;
    --gpp-red: #e74c3c;
    --gpp-bg: #ffffff;
    --gpp-bg-alt: #f8f9fa;
    --gpp-bg-muted: #f0f2f5;
    --gpp-text: #222222;
    --gpp-text-muted: #6c757d;
    --gpp-text-light: #999999;
    --gpp-border: #e0e0e0;
    --gpp-radius: 8px;
    --gpp-radius-sm: 4px;
    --gpp-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --gpp-shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.12);
    --gpp-transition: 0.2s ease;
    --gpp-max-width: 1200px;
    --gpp-gap: 24px;
    --gpp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* ═══════════════════════════════════════════════════
   2. Base / Reset
   ═══════════════════════════════════════════════════ */

.gpp-product-page {
    font-family: var(--gpp-font);
    color: var(--gpp-text);
    max-width: var(--gpp-max-width);
    margin: 0 auto;
    padding: 0 16px 80px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.gpp-product-page *,
.gpp-product-page *::before,
.gpp-product-page *::after {
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════
   3. Breadcrumb — Black links (user tweak)
   ═══════════════════════════════════════════════════ */

.gpp-breadcrumb {
    padding: 12px 0;
    font-size: 13px;
    color: #222222;
}

.gpp-bc-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}

.gpp-breadcrumb a {
    color: #222222;
    text-decoration: none;
    transition: color var(--gpp-transition);
}

.gpp-breadcrumb a:hover {
    color: var(--gpp-primary);
    text-decoration: underline;
}

.gpp-bc-sep {
    margin: 0 6px;
    color: var(--gpp-text-light);
}

/* ═══════════════════════════════════════════════════
   4. Trust Topbar (Variant B)
   ═══════════════════════════════════════════════════ */

.gpp-topbar {
    background: var(--gpp-primary);
    color: #ffffff;
    font-size: 13px;
    padding: 8px 16px;
    margin: 0 -16px 0;
    text-align: center;
}

.gpp-topbar-inner {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    max-width: var(--gpp-max-width);
    margin: 0 auto;
}

.gpp-topbar-inner span {
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════
   5. Grid Layout
   ═══════════════════════════════════════════════════ */

.gpp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gpp-gap);
    align-items: start;
}

@media (max-width: 768px) {
    .gpp-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════
   6. Custom Gallery
   ═══════════════════════════════════════════════════ */

.gpp-gallery-col {
    position: relative;
}

.gpp-gallery-main {
    position: relative;
    overflow: hidden;
    border-radius: var(--gpp-radius);
    background: var(--gpp-bg-alt);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gpp-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gpp-main-img:hover {
    transform: scale(1.02);
}

.gpp-gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.gpp-thumb-btn {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    padding: 2px;
    border: 2px solid transparent;
    border-radius: var(--gpp-radius-sm);
    background: var(--gpp-bg-alt);
    cursor: pointer;
    transition: border-color var(--gpp-transition);
}

.gpp-thumb-btn:hover,
.gpp-thumb-btn.active {
    border-color: var(--gpp-primary);
}

.gpp-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

/* Scarcity overlay (variant B) */
.gpp-scarcity-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
}

/* ═══════════════════════════════════════════════════
   7. Summary Column
   ═══════════════════════════════════════════════════ */

.gpp-summary-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gpp-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--gpp-primary);
    margin: 0;
    line-height: 1.3;
}

@media (min-width: 769px) {
    .gpp-title {
        font-size: 28px;
    }
}

/* Condition label */
.gpp-condition {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 0;
}

.gpp-condition-badge {
    display: inline-block;
    background: var(--gpp-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--gpp-radius-sm);
    letter-spacing: 0.5px;
}

.gpp-condition-a1 .gpp-condition-badge {
    background: var(--gpp-green);
}

.gpp-condition-b .gpp-condition-badge {
    background: var(--gpp-orange);
}

.gpp-condition-c .gpp-condition-badge {
    background: var(--gpp-red);
}

/* Spec summary */
.gpp-spec-summary {
    font-size: 14px;
    color: var(--gpp-text-muted);
}

/* ═══════════════════════════════════════════════════
   8. Price & Stock — Price bigger (user tweak)
   ═══════════════════════════════════════════════════ */

.gpp-price-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.gpp-price {
    font-size: 34px;
    font-weight: 800;
    color: var(--gpp-primary);
}

@media (min-width: 769px) {
    .gpp-price {
        font-size: 38px;
    }
}

.gpp-price del {
    font-size: 20px;
    font-weight: 400;
    color: var(--gpp-text-muted);
}

.gpp-price ins {
    text-decoration: none;
}

/* Stock messaging */
.gpp-stock-msg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.gpp-stock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.gpp-dot-green { background: var(--gpp-green); }
.gpp-dot-orange { background: var(--gpp-orange); }
.gpp-dot-red { background: var(--gpp-red); }

.gpp-stock-available { color: var(--gpp-green); }
.gpp-stock-low { color: var(--gpp-orange); }
.gpp-stock-last { color: var(--gpp-orange); font-weight: 700; }
.gpp-stock-out { color: var(--gpp-red); }

/* ═══════════════════════════════════════════════════
   9. Key Benefits
   ═══════════════════════════════════════════════════ */

.gpp-key-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gpp-key-benefits li {
    position: relative;
    padding: 4px 0 4px 24px;
    font-size: 14px;
    line-height: 1.5;
}

.gpp-key-benefits li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 4px;
    color: var(--gpp-green);
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════
   10. Add-to-Cart Form
   ═══════════════════════════════════════════════════ */

.gpp-cart-form {
    padding: 16px 0;
}

.gpp-cart-form .cart {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.gpp-cart-form .quantity {
    display: flex;
    align-items: center;
}

.gpp-cart-form .quantity .qty {
    width: 64px;
    height: 48px;
    text-align: center;
    font-size: 16px;
    border: 2px solid var(--gpp-border);
    border-radius: var(--gpp-radius);
    background: var(--gpp-bg);
    -moz-appearance: textfield;
    appearance: textfield;
}

.gpp-cart-form .quantity .qty::-webkit-inner-spin-button,
.gpp-cart-form .quantity .qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.gpp-cart-form .single_add_to_cart_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 32px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    background: var(--gpp-accent);
    border: none;
    border-radius: var(--gpp-radius);
    cursor: pointer;
    transition: background var(--gpp-transition), transform var(--gpp-transition);
    white-space: nowrap;
}

.gpp-cart-form .single_add_to_cart_button:hover {
    background: var(--gpp-accent-hover);
    transform: translateY(-1px);
}

.gpp-cart-form .single_add_to_cart_button:active {
    transform: translateY(0);
}

/* Variations form */
.gpp-cart-form .variations_form .variations {
    margin-bottom: 12px;
}

.gpp-cart-form .variations_form .single_variation_wrap .woocommerce-variation-add-to-cart {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ═══════════════════════════════════════════════════
   11. Trust Badges
   ═══════════════════════════════════════════════════ */

.gpp-trust-badges {
    list-style: none;
    padding: 12px 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.gpp-trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--gpp-text-muted);
}

.gpp-badge-icon {
    color: var(--gpp-green);
    font-weight: 700;
}

.gpp-badge-emphasized {
    color: var(--gpp-primary);
    font-weight: 600;
}

.gpp-trust-block {
    padding: 12px 16px;
    background: var(--gpp-bg-alt);
    border-radius: var(--gpp-radius);
    border-left: 3px solid var(--gpp-green);
}

.gpp-trust-statement {
    font-size: 13px;
    color: var(--gpp-text-muted);
    margin: 0;
}

/* ═══════════════════════════════════════════════════
   12. CRO Messages
   ═══════════════════════════════════════════════════ */

.gpp-scarcity {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff3cd;
    color: #856404;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--gpp-radius);
}

.gpp-value-msg {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--gpp-green);
    font-weight: 500;
}

.gpp-social-proof {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--gpp-text-muted);
}

.gpp-guarantee-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gpp-bg-alt);
    border: 1px solid var(--gpp-border);
    border-radius: var(--gpp-radius);
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gpp-primary);
}

.gpp-urgency-note {
    font-size: 13px;
    font-weight: 600;
    color: var(--gpp-orange);
    padding: 6px 0;
}

/* ═══════════════════════════════════════════════════
   13. Tabs
   ═══════════════════════════════════════════════════ */

.gpp-tabs {
    margin-top: 48px;
}

.gpp-tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gpp-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.gpp-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    color: var(--gpp-text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--gpp-transition), border-color var(--gpp-transition);
}

.gpp-tab-btn:hover {
    color: var(--gpp-primary);
}

.gpp-tab-btn.active {
    color: var(--gpp-primary);
    border-bottom-color: var(--gpp-primary);
    font-weight: 600;
}

.gpp-tab-panel {
    display: none;
    padding: 24px 0;
}

.gpp-tab-panel.active {
    display: block;
}

.gpp-tab-content h2,
.gpp-tab-content h3,
.gpp-tab-content h4 {
    color: var(--gpp-primary);
}

.gpp-tab-content p {
    margin: 0 0 12px;
}

.gpp-tab-content p:last-child {
    margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════
   14. Specs Table
   ═══════════════════════════════════════════════════ */

.gpp-specs-table {
    width: 100%;
    border-collapse: collapse;
}

.gpp-specs-table th,
.gpp-specs-table td {
    padding: 10px 14px;
    font-size: 14px;
    text-align: left;
    border-bottom: 1px solid var(--gpp-border);
}

.gpp-specs-table th {
    width: 35%;
    font-weight: 600;
    color: var(--gpp-primary);
    background: var(--gpp-bg-alt);
}

.gpp-specs-table tr:last-child th,
.gpp-specs-table tr:last-child td {
    border-bottom: none;
}

/* ═══════════════════════════════════════════════════
   15. Kunto & Takuu / Testimonial
   ═══════════════════════════════════════════════════ */

.gpp-testimonial {
    margin: 20px 0;
    padding: 16px 20px;
    background: var(--gpp-bg-alt);
    border-left: 3px solid var(--gpp-primary);
    border-radius: 0 var(--gpp-radius) var(--gpp-radius) 0;
    font-style: italic;
}

.gpp-testimonial p {
    margin: 0 0 6px;
}

.gpp-testimonial cite {
    font-size: 13px;
    color: var(--gpp-text-muted);
    font-style: normal;
}

/* ═══════════════════════════════════════════════════
   16. Related Products
   ═══════════════════════════════════════════════════ */

.gpp-related {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--gpp-border);
}

.gpp-related .related.products > h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gpp-primary);
    margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════
   17. Sticky Add-to-Cart Bar
   ═══════════════════════════════════════════════════ */

.gpp-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    background: var(--gpp-bg);
    border-top: 1px solid var(--gpp-border);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gpp-sticky-bar.visible {
    transform: translateY(0);
}

.gpp-sticky-inner {
    max-width: var(--gpp-max-width);
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.gpp-sticky-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.gpp-sticky-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gpp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gpp-sticky-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--gpp-primary);
}

.gpp-sticky-price del {
    font-size: 13px;
    font-weight: 400;
    color: var(--gpp-text-muted);
}

.gpp-sticky-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    background: var(--gpp-accent);
    border: none;
    border-radius: var(--gpp-radius);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--gpp-transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.gpp-sticky-btn:hover {
    background: var(--gpp-accent-hover);
    color: #ffffff;
    text-decoration: none;
}

/* ═══════════════════════════════════════════════════
   18. Responsive
   ═══════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .gpp-product-page {
        padding: 0 12px 100px;
    }

    .gpp-title {
        font-size: 20px;
    }

    .gpp-price {
        font-size: 28px;
    }

    .gpp-topbar {
        margin: 0 -12px 0;
        font-size: 11px;
    }

    .gpp-topbar-inner {
        gap: 12px;
    }

    .gpp-tab-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .gpp-cart-form .cart {
        flex-direction: column;
        align-items: stretch;
    }

    .gpp-cart-form .single_add_to_cart_button {
        width: 100%;
    }

    /* Sticky bar mobile */
    .gpp-sticky-title {
        font-size: 12px;
    }

    .gpp-sticky-price {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .gpp-sticky-info {
        display: none;
    }

    .gpp-sticky-btn {
        flex: 1;
        text-align: center;
    }
}

/* ═══════════════════════════════════════════════════
   19. Accessibility
   ═══════════════════════════════════════════════════ */

.gpp-tab-btn:focus-visible,
.gpp-sticky-btn:focus-visible,
.gpp-thumb-btn:focus-visible,
.gpp-cart-form .single_add_to_cart_button:focus-visible {
    outline: 2px solid var(--gpp-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .gpp-sticky-bar,
    .gpp-main-img {
        transition: none;
    }

    .gpp-cart-form .single_add_to_cart_button:hover {
        transform: none;
    }
}

/* ═══════════════════════════════════════════════════
   20. Print
   ═══════════════════════════════════════════════════ */

@media print {
    .gpp-sticky-bar,
    .gpp-topbar {
        display: none !important;
    }

    .gpp-product-page {
        padding: 0;
    }

    .gpp-grid {
        display: block;
    }
}
