/*
Theme Name: CalmTab Single Page
Theme URI: https://calmtab.co
Description: A single-page WooCommerce theme for CalmTab with integrated checkout. Works with any payment gateway including WooCommerce Payments.
Version: 5.4-QUERY-FIX
Author: CalmTab
Author URI: https://calmtab.co
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: calmtab-single-page
*/

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #667eea;
}

.header-cta {
    background: #667eea;
    color: #fff;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.header-cta:hover {
    background: #5568d3;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 100px 0;
    text-align: center;
}

.hero-section h1 {
    font-size: 48px;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-section p {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-cta {
    background: #fff;
    color: #667eea;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    display: inline-block;
    transition: transform 0.3s, box-shadow 0.3s;
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* Features Section */
.features-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.features-section h2 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 50px;
    color: #2c3e50;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.feature-item {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.feature-item h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.feature-item p {
    color: #666;
    line-height: 1.8;
}

/* Reviews Section */
.reviews-section {
    padding: 80px 0;
    background: #fff;
}

.reviews-section h2 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 50px;
    color: #2c3e50;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.review-item {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.review-rating {
    color: #f39c12;
    margin-bottom: 15px;
    font-size: 20px;
}

.review-text {
    font-style: italic;
    margin-bottom: 20px;
    color: #555;
    line-height: 1.8;
}

.review-author {
    font-weight: 600;
    color: #2c3e50;
}

/* Checkout Section */
.checkout-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.checkout-section h2 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 20px;
}

.checkout-subtitle {
    text-align: center;
    font-size: 18px;
    margin-bottom: 50px;
    opacity: 0.9;
}

.checkout-wrapper {
    background: #fff;
    border-radius: 15px;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

/* WooCommerce Overrides */
.woocommerce,
.woocommerce-page,
.woocommerce-checkout {
    color: #333;
}

.woocommerce form .form-row {
    margin-bottom: 20px;
}

.woocommerce form .form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.woocommerce form input.input-text,
.woocommerce form select,
.woocommerce form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.woocommerce form input.input-text:focus,
.woocommerce form select:focus,
.woocommerce form textarea:focus {
    border-color: #667eea;
    outline: none;
}

.woocommerce #payment {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 30px;
}

.woocommerce-checkout #payment ul.payment_methods {
    border: none;
    padding: 0;
    margin: 0 0 20px 0;
    list-style: none;
}

.woocommerce-checkout #payment ul.payment_methods li {
    margin-bottom: 10px;
}

.woocommerce-checkout #payment div.payment_box {
    background: #fff;
    border-radius: 5px;
    margin-top: 15px;
    padding: 20px;
}

.woocommerce #place_order,
.woocommerce-page #place_order {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s;
    margin-top: 20px;
}

.woocommerce #place_order:hover,
.woocommerce-page #place_order:hover {
    background: #5568d3;
}

.woocommerce-order-details,
.woocommerce-thankyou-order-received {
    text-align: center;
    padding: 40px;
}

/* Checkout form layout */
.woocommerce-billing-fields h3,
.woocommerce-additional-fields h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 24px;
}

.woocommerce table.shop_table {
    border: none;
    margin-bottom: 30px;
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    border: none;
    padding: 15px;
    text-align: left;
}

.woocommerce table.shop_table thead {
    background: #f8f9fa;
}

/* Order review */
.woocommerce-checkout-review-order {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* Stripe elements styling */
.woocommerce-checkout #payment .payment_method_stripe {
    background: #fff;
    padding: 15px;
    border-radius: 5px;
}

/* Make sure checkout is visible */
.checkout-wrapper .woocommerce {
    display: block !important;
    width: 100%;
}

/* Product Display */
.single-page-product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    align-items: start;
}

.single-page-product img {
    width: 100%;
    border-radius: 10px;
}

.product-info h3 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #2c3e50;
}

.product-price {
    font-size: 36px;
    color: #667eea;
    font-weight: 700;
    margin-bottom: 20px;
}

.product-description {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.8;
}

.product-description p {
    margin-bottom: 15px;
}

.product-description p:last-child {
    margin-bottom: 0;
}

.product-description ul,
.product-description ol {
    margin: 15px 0;
    padding-left: 25px;
}

.product-description li {
    margin-bottom: 8px;
}

.product-description br {
    display: block;
    margin: 5px 0;
    content: "";
}

.product-description strong,
.product-description b {
    font-weight: 600;
    color: #333;
}

.product-description em,
.product-description i {
    font-style: italic;
}

.woocommerce div.product form.cart {
    margin-bottom: 20px;
}

.woocommerce div.product form.cart .button {
    background: #667eea;
    color: #fff;
    padding: 15px 40px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        gap: 15px;
    }

    .header-nav {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-link {
        font-size: 14px;
    }

    .hero-section h1 {
        font-size: 32px;
    }

    .hero-section p {
        font-size: 16px;
    }

    .features-grid,
    .reviews-grid {
        grid-template-columns: 1fr;
    }

    .single-page-product {
        grid-template-columns: 1fr;
    }

    .checkout-wrapper {
        padding: 20px;
    }

    .product-price {
        font-size: 28px;
    }
}

/* Footer */
.site-footer {
    background: #2c3e50;
    color: #fff;
    padding: 40px 0;
    text-align: center;
}

.site-footer p {
    margin: 0;
    opacity: 0.8;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Thank You Modal */
.calmtab-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.calmtab-modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    margin: 10% auto;
    padding: 40px;
    border-radius: 15px;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    animation: slideIn 0.4s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.calmtab-modal-content h2 {
    margin-top: 0;
    font-size: 28px;
    margin-bottom: 20px;
}

.calmtab-modal-content p {
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.95;
    margin-bottom: 15px;
}

.calmtab-modal-order-details {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 10px;
    margin: 25px 0;
}

.calmtab-modal-order-details p {
    margin-bottom: 10px;
    font-size: 15px;
}

.calmtab-modal-order-details p:last-child {
    margin-bottom: 0;
}

.calmtab-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s;
    line-height: 1;
}

.calmtab-modal-close:hover,
.calmtab-modal-close:focus {
    opacity: 1;
}

.calmtab-modal-button {
    background: #fff;
    color: #667eea;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.calmtab-modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* License Key Display */
.calmtab-modal-license-keys {
    background: rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 10px;
    margin: 25px 0;
}

.calmtab-license-key {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.calmtab-license-key:last-child {
    margin-bottom: 0;
}

.calmtab-license-key code {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 15px;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    color: #fff;
    word-break: break-all;
    user-select: all;
}

.calmtab-copy-button {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.calmtab-copy-button:hover {
    background: rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
    .calmtab-modal-content {
        margin: 20% 20px;
        padding: 30px 20px;
    }

    .calmtab-modal-content h2 {
        font-size: 24px;
    }

    .calmtab-license-key {
        flex-direction: column;
        align-items: stretch;
    }

    .calmtab-copy-button {
        width: 100%;
    }
}
