/* Vendor Registration Page - Responsive & Performance Optimizations */
/* This file fixes mobile responsiveness and adds performance improvements */

/* Critical Performance & Layout Fixes */
body.tgp-vendor-reg-page {
    overflow-x: hidden;
}

/* Force full width on all devices */
body.page-template-page-vendor-registration .site,
body.page-template-page-vendor-registration .site-main,
body.page-template-page-vendor-registration #content,
body.tgp-vendor-reg-page .site,
body.tgp-vendor-reg-page .site-main,
body.tgp-vendor-reg-page #content,
body.tgp-vendor-reg-page main {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Responsive Image Optimization */
img {
    max-width: 100%;
    height: auto;
}

/* Lazy Loading Support */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

img[loading="lazy"].loaded,
img:not([loading]) {
    opacity: 1;
}

/* Performance - Reduce Paint */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Smooth Scrolling */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================
   MOBILE RESPONSIVE FIXES
   ======================================== */

/* Mobile: 320px - 767px */
@media (max-width: 767px) {
    /* Container fixes */
    .tgp-vendor-registration {
        padding: 20px 0 !important;
        width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    .tgp-registration-container {
        padding: 0 16px !important;
        max-width: 100% !important;
    }
    
    .tgp-registration-card {
        padding: 24px 16px !important;
        border-radius: 16px !important;
        margin: 0 !important;
    }
    
    /* Registration header */
    .tgp-registration-header {
        margin-bottom: 20px !important;
    }
    
    .tgp-registration-logo {
        width: 48px !important;
        height: 48px !important;
        margin-bottom: 12px !important;
    }
    
    .tgp-registration-logo svg {
        width: 24px !important;
        height: 24px !important;
    }
    
    .tgp-registration-title {
        font-size: 22px !important;
        line-height: 1.2 !important;
    }
    
    .tgp-registration-subtitle {
        font-size: 13px !important;
        line-height: 1.4 !important;
    }
    
    /* Content sections - full width */
    .tgp-seo-content,
    .tgp-comparison-section,
    .tgp-genres-section,
    .tgp-vendors-section,
    .tgp-quickstart-section,
    .tgp-cta-section {
        padding: 40px 16px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }
    
    /* FAQ section - rounded container on mobile */
    .tgp-faq-section {
        padding: 40px 16px !important;
        margin: 0 !important;
        width: 100% !important;
    }
    
    /* Section titles */
    .tgp-section-title,
    .tgp-cta-title {
        font-size: 28px !important;
        line-height: 1.2 !important;
        margin-bottom: 20px !important;
        padding: 0 !important;
    }
    
    .tgp-section-subtitle,
    .tgp-cta-subtitle {
        font-size: 15px !important;
        line-height: 1.4 !important;
        margin: 0 0 30px !important;
        padding: 0 !important;
    }
    
    /* Comparison table - stack vertically */
    .tgp-comparison-table {
        padding: 20px 16px !important;
        border-radius: 12px !important;
        overflow-x: hidden !important;
    }
    
    .tgp-comparison-header {
        display: none !important; /* Hide header on mobile */
    }
    
    .tgp-comparison-row {
        display: block !important;
        padding: 16px 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    }
    
    .tgp-comparison-feature {
        font-size: 15px !important;
        font-weight: 600 !important;
        margin-bottom: 12px !important;
        display: block !important;
    }
    
    .tgp-comparison-us,
    .tgp-comparison-other {
        display: block !important;
        text-align: left !important;
        padding: 8px 0 8px 20px !important;
        font-size: 14px !important;
    }
    
    .tgp-comparison-us::before {
        content: "Us: ";
        font-weight: 600;
        color: rgba(255, 255, 255, 0.7);
    }
    
    .tgp-comparison-other::before {
        content: "Others: ";
        font-weight: 600;
        color: rgba(255, 255, 255, 0.7);
    }
    
    /* Genres grid - 2 columns */
    .tgp-genres-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        width: 100% !important;
    }
    
    .tgp-genre-card {
        padding: 20px 16px !important;
        border-radius: 16px !important;
        min-height: 140px !important;
    }
    
    .tgp-genre-card h3 {
        font-size: 16px !important;
    }
    
    /* Vendors grid - 2 columns */
    .tgp-vendors-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        width: 100% !important;
    }
    
    .tgp-vendor-card {
        border-radius: 16px !important;
        min-height: 200px !important;
    }
    
    .tgp-vendor-bg-img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    .tgp-vendor-info {
        padding: 16px !important;
    }
    
    .tgp-vendor-info h4 {
        font-size: 15px !important;
        margin-bottom: 8px !important;
    }
    
    .tgp-vendor-stats {
        gap: 6px !important;
        flex-wrap: wrap !important;
    }
    
    .tgp-vendor-rating,
    .tgp-vendor-sold,
    .tgp-vendor-reviews {
        font-size: 11px !important;
        padding: 3px 6px !important;
    }
    
    /* Steps grid - single column */
    .tgp-steps-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        width: 100% !important;
    }
    
    .tgp-step-card {
        padding: 24px 20px !important;
        border-radius: 16px !important;
    }
    
    .tgp-step-number {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
        margin-bottom: 12px !important;
    }
    
    .tgp-step-card h3 {
        font-size: 16px !important;
        margin-bottom: 8px !important;
    }
    
    .tgp-step-card p {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }
    
    /* FAQ section - Full mobile optimization */
    .tgp-faq-section {
        padding: 40px 16px !important;
        width: 100% !important;
        overflow-x: hidden !important;
        margin: 0 !important;
    }
    
    .tgp-faq-container,
    .tgp-faq-container-new {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        overflow: hidden !important;
        border-radius: 0 !important;
        background: transparent !important;
        border: none !important;
    }
    
    .tgp-faq-title,
    .tgp-faq-title-new {
        font-size: 32px !important;
        line-height: 1.2 !important;
        margin-bottom: 24px !important;
        text-align: left !important;
        padding: 0 !important;
        word-wrap: break-word !important;
    }
    
    /* FAQ items - rounded cards on mobile */
    .tgp-faq-item,
    .tgp-faq-item-new {
        border-radius: 12px !important;
        margin-bottom: 8px !important;
        background: rgba(28, 28, 30, 0.4) !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .tgp-faq-item:last-child,
    .tgp-faq-item-new:last-child {
        margin-bottom: 0 !important;
    }
    
    /* Force all FAQ content to wrap */
    .tgp-faq-item-new .tgp-faq-btn,
    .tgp-faq-item-new .tgp-faq-btn *,
    .tgp-faq-item .tgp-faq-question,
    .tgp-faq-item .tgp-faq-question * {
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
    }
    
    body .tgp-faq-btn,
    body .tgp-faq-question,
    button.tgp-faq-btn,
    .tgp-faq-btn,
    .tgp-faq-question {
        border-radius: 12px !important;
        padding: 20px 55px 20px 16px !important;
        position: relative !important;
        display: block !important;
        text-align: left !important;
        line-height: 1.6 !important;
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        box-sizing: border-box !important;
        word-wrap: break-word !important;
        white-space: normal !important;
        overflow-wrap: break-word !important;
        overflow: visible !important;
    }
    
    body .tgp-faq-text,
    span.tgp-faq-text,
    .tgp-faq-text {
        display: inline !important;
        word-wrap: break-word !important;
        white-space: normal !important;
        overflow-wrap: break-word !important;
        padding-right: 0 !important;
        margin-right: 0 !important;
    }
    
    body .tgp-faq-plus,
    span.tgp-faq-plus,
    .tgp-faq-plus {
        position: absolute !important;
        right: 16px !important;
        top: 20px !important;
        transform: none !important;
        flex-shrink: 0 !important;
        font-size: 24px !important;
        width: 30px !important;
        height: 30px !important;
    }
    
    body .tgp-faq-item-new.active .tgp-faq-plus,
    .tgp-faq-item-new.active .tgp-faq-plus {
        transform: rotate(45deg) !important;
    }
    
    .tgp-faq-accordion {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .tgp-faq-item {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .tgp-faq-question {
        font-size: 15px !important;
        padding: 20px 40px 20px 0 !important;
        line-height: 1.4 !important;
        width: 100% !important;
        max-width: 100% !important;
        word-wrap: break-word !important;
        white-space: normal !important;
        overflow-wrap: break-word !important;
        text-align: left !important;
        display: block !important;
        box-sizing: border-box !important;
    }
    
    .tgp-faq-icon {
        position: absolute !important;
        right: 0 !important;
        top: 20px !important;
        width: 20px !important;
        height: 20px !important;
        flex-shrink: 0 !important;
        transform: none !important;
    }
    
    .tgp-faq-item.active .tgp-faq-icon {
        transform: rotate(45deg) !important;
    }
    
    .tgp-faq-answer {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    .tgp-faq-answer,
    .tgp-faq-content {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .tgp-faq-answer p,
    .tgp-faq-content p {
        font-size: 14px !important;
        line-height: 1.7 !important;
        padding: 0 !important;
        margin: 0 !important;
        word-wrap: break-word !important;
        white-space: normal !important;
        overflow-wrap: break-word !important;
    }
    
    .tgp-faq-item.active .tgp-faq-answer,
    .tgp-faq-item-new.active .tgp-faq-content {
        padding: 0 16px 20px 16px !important;
    }
    
    /* Article content */
    .tgp-article-content h2 {
        font-size: 26px !important;
        line-height: 1.2 !important;
        margin-bottom: 20px !important;
    }
    
    .tgp-article-content h3 {
        font-size: 20px !important;
        line-height: 1.3 !important;
        margin: 30px 0 16px !important;
    }
    
    .tgp-article-content h4 {
        font-size: 18px !important;
        margin: 24px 0 12px !important;
    }
    
    .tgp-article-content p,
    .tgp-article-content li {
        font-size: 15px !important;
        line-height: 1.6 !important;
    }
    
    .tgp-article-content ul,
    .tgp-article-content ol {
        padding-left: 20px !important;
        margin: 16px 0 !important;
    }
    
    /* CTA button - Mobile */
    .tgp-cta-button {
        padding: 16px 32px !important;
        font-size: 16px !important;
        border-radius: 999px !important;
        width: calc(100% - 32px) !important;
        max-width: 100% !important;
        display: block !important;
        margin: 0 auto !important;
        text-align: center !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5) !important;
        border: none !important;
        min-height: 50px !important;
    }
    
    .tgp-cta-button:hover,
    .tgp-cta-button:active {
        background: linear-gradient(135deg, #7689f0 0%, #8456b5 100%) !important;
        color: #ffffff !important;
    }
    
    .tgp-cta-note {
        font-size: 13px !important;
        margin-top: 16px !important;
    }
    
    /* View All Producers Button - Mobile */
    .tgp-vendors-more-btn-wrapper {
        margin-top: 30px !important;
    }
    
    .tgp-vendors-more-btn {
        padding: 12px 24px !important;
        font-size: 14px !important;
        width: 100% !important;
        max-width: 280px !important;
        justify-content: center !important;
    }
    
    /* Form elements */
    .tgp-vendor-registration .form-row {
        margin-bottom: 12px !important;
    }
    
    .tgp-vendor-registration label {
        font-size: 13px !important;
        margin-bottom: 6px !important;
    }
    
    .tgp-vendor-registration input,
    .tgp-vendor-registration select,
    .tgp-vendor-registration textarea {
        font-size: 16px !important; /* Prevents iOS zoom */
        padding: 12px 14px !important;
        border-radius: 8px !important;
    }
    
    /* Password toggle - Mobile */
    .tgp-vendor-registration .woocommerce-password-toggle {
        right: 10px !important;
        width: 40px !important;
        height: 40px !important;
        padding: 10px !important;
        border-radius: 8px !important;
        touch-action: manipulation;
    }
    
    .tgp-vendor-registration .woocommerce-password-toggle .dashicons {
        width: 22px !important;
        height: 22px !important;
        font-size: 22px !important;
    }
    
    .tgp-vendor-registration input[type="password"] {
        padding-right: 52px !important;
    }
    
    .tgp-vendor-registration .woocommerce-Button {
        font-size: 16px !important;
        padding: 14px 24px !important;
    }
    
    /* Step progress */
    .tgp-step-progress {
        padding: 0 8px !important;
        margin: 16px 0 !important;
    }
    
    .tgp-step-circle {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
    }
    
    .tgp-step-label {
        font-size: 9px !important;
    }
    
    .tgp-step-line {
        width: 30px !important;
    }
    
    /* Step navigation buttons */
    .tgp-step-navigation {
        gap: 8px !important;
        margin-top: 16px !important;
    }
    
    .tgp-btn-next,
    .tgp-btn-prev,
    button.tgp-btn-next,
    button.tgp-btn-prev {
        padding: 12px 16px !important;
        font-size: 14px !important;
        border-radius: 999px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        min-width: 0 !important;
    }
    
    /* Submit button specific mobile styling */
    #tgp-submit-btn {
        font-size: 14px !important;
        padding: 12px 20px !important;
    }
    
    /* Terms checkbox - Mobile */
    .tgp-terms-checkbox-wrapper {
        margin: 20px 0 !important;
        padding: 14px !important;
        border-radius: 10px !important;
    }
    
    .tgp-terms-checkbox-label {
        gap: 10px !important;
    }
    
    .tgp-terms-checkbox {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
    }
    
    .tgp-terms-text {
        font-size: 13px !important;
    }
    
    /* Touch targets - minimum 44x44px */
    button,
    a.tgp-cta-button,
    input[type="submit"],
    input[type="button"],
    .tgp-btn-next,
    .tgp-btn-prev,
    .tgp-faq-question {
        min-height: 44px !important;
        touch-action: manipulation;
    }
    
    /* Fix overflow issues */
    * {
        box-sizing: border-box;
    }
    
    .tgp-vendor-registration * {
        max-width: 100%;
    }
}

/* ========================================
   TABLET RESPONSIVE (768px - 1023px)
   ======================================== */

@media (min-width: 768px) and (max-width: 1023px) {
    .tgp-vendor-registration {
        padding: 30px 0 !important;
    }
    
    .tgp-registration-container {
        padding: 0 24px !important;
    }
    
    .tgp-registration-card {
        padding: 28px 24px !important;
        border-radius: 18px !important;
    }
    
    /* Content sections */
    .tgp-seo-content,
    .tgp-comparison-section,
    .tgp-genres-section,
    .tgp-vendors-section,
    .tgp-quickstart-section,
    .tgp-cta-section,
    .tgp-faq-section {
        padding: 60px 24px !important;
    }
    
    .tgp-section-title {
        font-size: 38px !important;
    }
    
    .tgp-section-subtitle {
        font-size: 18px !important;
    }
    
    /* Grids - 3 columns */
    .tgp-genres-grid,
    .tgp-vendors-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px !important;
    }
    
    /* Steps - 2 columns */
    .tgp-steps-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
    
    /* Comparison table - 3 columns */
    .tgp-comparison-header,
    .tgp-comparison-row {
        grid-template-columns: 2fr 1.5fr 1.5fr !important;
        gap: 20px !important;
    }
    
    .tgp-comparison-us::before,
    .tgp-comparison-other::before {
        content: none !important;
    }
    
    .tgp-comparison-us,
    .tgp-comparison-other {
        text-align: center !important;
    }
    
    .tgp-comparison-header {
        display: grid !important;
    }
    
    /* CTA button - Tablet */
    .tgp-cta-button {
        min-width: 300px !important;
        width: auto !important;
    }
    
    /* View All Producers Button - Tablet */
    .tgp-vendors-more-btn-wrapper {
        margin-top: 35px !important;
    }
    
    .tgp-vendors-more-btn {
        padding: 13px 26px !important;
        font-size: 14.5px !important;
    }
    
    /* Terms checkbox - Tablet */
    .tgp-terms-checkbox-wrapper {
        margin: 22px 0 !important;
        padding: 15px !important;
    }
    
    .tgp-terms-text {
        font-size: 13.5px !important;
    }
    
    /* Password toggle - Tablet */
    .tgp-vendor-registration .woocommerce-password-toggle {
        right: 11px !important;
        width: 38px !important;
        height: 38px !important;
    }
    
    .tgp-vendor-registration .woocommerce-password-toggle .dashicons {
        width: 21px !important;
        height: 21px !important;
        font-size: 21px !important;
    }
    
    .tgp-vendor-registration input[type="password"] {
        padding-right: 50px !important;
    }
}

/* CTA Section - All devices */
.tgp-cta-section {
    text-align: center;
}

.tgp-cta-title,
.tgp-cta-subtitle,
.tgp-cta-note {
    text-align: center !important;
}

/* Loading Performance */
.tgp-vendor-registration {
    contain: layout style paint;
}

/* GPU Acceleration for Animations */
.tgp-registration-card,
.tgp-genre-card,
.tgp-vendor-card,
.tgp-step-card {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Remove will-change after animation */
.tgp-registration-card:not(:hover),
.tgp-genre-card:not(:hover),
.tgp-vendor-card:not(:hover),
.tgp-step-card:not(:hover) {
    will-change: auto;
}

