/* Parts Portal CSS - Targeted Styling for Plugin Components */

/* Selective reset only for our main containers */
.parts-portal-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.parts-portal-container * {
    box-sizing: border-box;
}

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

/* FORCE FULL WIDTH - Override ALL WordPress Theme Constraints */

/* Force HTML and Body to use full width */
html,
body {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

/* WordPress Theme Body and Container Overrides */
body,
body.wp-admin,
body.twentytwentyfive,
body.twentytwentyfour,
body.twentytwentythree {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* WordPress Site Structure Overrides */
#page,
#main,
.site,
.site-content,
.site-main,
.wp-site-blocks,
.wp-block-group,
.wp-block-group__inner-container,
.wp-container,
.alignfull,
.alignwide {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Theme Specific Container Overrides */
.has-global-padding,
.wp-block-group.has-global-padding,
.wp-block-cover.has-global-padding,
.wp-block-columns.has-global-padding {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Content Area Overrides */
.entry-content,
.post-content,
.page-content,
.content-area,
.primary,
.main-content {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Twenty Twenty-Five Theme Specific Overrides */
body.wp-admin .wp-site-blocks,
body .wp-site-blocks,
.wp-block-post-content,
.wp-block-query,
.wp-block-group.is-layout-constrained {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Layout Constraint Overrides */
.is-layout-constrained,
.wp-block-group.is-layout-constrained > *,
.wp-block-group.is-layout-constrained .wp-block-group,
.is-layout-constrained > * {
    max-width: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Grid and Flex Layout Overrides */
.is-layout-grid,
.is-layout-flex,
.wp-block-columns,
.wp-block-column {
    max-width: none !important;
    width: 100% !important;
}

/* Wrapper and Container Overrides */
.wp-block-template-part,
.wp-block-site-title,
.wp-block-navigation,
.wp-block-header,
.wp-block-footer {
    max-width: none !important;
    width: 100% !important;
}

/* Plugin Content Containers - Force Full Width */
.parts-portal-container,
.thank-you-portal-container,
.search-result-container,
.iki-form-quote-submission-container,
.iki-search-results-container {
    max-width: 100vw !important;
    width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
}

/* Viewport Width Utility for Plugin Content */
.full-width-override {
    width: 100vw !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    max-width: none !important;
}

/* Remove any theme-imposed max widths on plugin pages */
body:has(.parts-portal-container),
body:has(.search-result-container),
body:has(.iki-form-quote-submission-container) {
    max-width: none !important;
    width: 100% !important;
}

/* Override any theme CSS variables that might limit width */
:root {
    --wp--style--global--content-size: none !important;
    --wp--style--global--wide-size: none !important;
}

/* Media Query Overrides for Responsive */
@media screen and (min-width: 1) {
    body,
    #page,
    .site,
    .wp-site-blocks,
    .entry-content {
        max-width: none !important;
        width: 100% !important;
    }
}

.parts-portal-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f1f8ff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1920px;
    margin: 0 auto;
    width: 100%;
}

.thank-you-portal-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1920px;
    margin: 0 auto;
    width: 100%;
}


.search-result-container{
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1920px;
    margin: 0 auto;
    width: 100%;
}


/* Header Styles */
.portal-header {
    background: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1920px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
}

.portal-logo {
    color: #0073e6;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.quote-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #e9ecef;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.quote-counter:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    text-decoration: none;
    color: inherit;
}

.top-search-form {
    display: flex;
    align-items: center;
}

.quote-text {
    color: #6c757d;
    font-size: 14px;
}

.quote-number {
    background: #343a40;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

/* Main Content */
.portal-main {
    flex: 1;
    padding: 60px 40px;
}

/* Search Hero Section */
.search-hero {
    max-width: 1920px;
    margin: 0 auto;
}

.search-content {
    display: grid;
    grid-template-columns: 2fr 400px;
    gap: 80px;
    align-items: center;
    padding: 0 20px;
}

.search-text {
    max-width: 1200px;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-description {
    font-size: 19px;
    color: #222324;
    margin-bottom: 40px;
    line-height: 1.5;
}

.search-form-container {
    margin-bottom: 40px;
}

.serial-search-form {
    display: flex;
    gap: 0;
    max-width: 800px;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #0073e6;
}

.search-button {
    padding: 16px 32px;
    background: #0073e6;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.search-button:hover {
    background: #0056b3;
}

.qr-section {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #333;
}

.qr-icon {
    color: #0073e6;
}

.qr-text {
    font-size: 24px;
    font-weight: 1000;
}

/* Search Visual */
.search-visual {
    position: relative;
    height: 300px;
    display: flex;
    align-items: left;
    justify-content: left;
}

.search-illustration {
    position: relative;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #06b6d4 100%);
    width: 300px;
    height: 200px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.search-device {
    background: rgba(255,255,255,0.1);
    width: 200px;
    height: 120px;
    border-radius: 12px;
    position: relative;
    backdrop-filter: blur(10px);
}

.device-screen {
    background: white;
    margin: 20px;
    height: 80px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-bar-demo {
    background: #f8f9fa;
    width: 80%;
    height: 20px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.search-hand {
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 60px;
    height: 60px;
    background: #ffd6cc;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
}

.search-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.effect-ring {
    position: absolute;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.ring-1 {
    width: 100px;
    height: 100px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ring-2 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 0.5s;
}

.ring-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 1s;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Search Results Styles */
.search-results-main {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 40px;
}

.results-header {
    text-align: center;
    margin-bottom: 40px;
}

.results-title {
    font-size: 32px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.results-count {
    font-size: 16px;
    color: #6c757d;
}

.results-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table thead {
    background: #f8f9fa;
}

.results-table th {
    padding: 20px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
}

.results-table td {
    padding: 20px;
    border-bottom: 1px solid #f8f9fa;
    vertical-align: top;
}

.result-row:hover {
    background: #f8f9fa;
}

.product-link {
    color: #0073e6;
    text-decoration: none;
    font-weight: 600;
}

.product-link:hover {
    text-decoration: underline;
}

.qty-selector {
    width: 60px;
}

.qty-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 30px;
}

.add-to-quote-btn1 {
    background: #0073e6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.add-to-quote-btn:hover {
    background: #0056b3;
}

/* Quote List Styles */
.quote-list-main {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 40px;
}

.quote-header {
    text-align: center;
    margin-bottom: 40px;
}

.quote-title {
    font-size: 32px;
    font-weight: 600;
    color: #333;
}

.quote-items-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 40px;
}

.quote-table {
    width: 100%;
    border-collapse: collapse;
}

.quote-table thead {
    background: #f8f9fa;
}

.quote-table th {
    padding: 20px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
}

.quote-table td {
    padding: 20px;
    border-bottom: 1px solid #f8f9fa;
}

.suggested-parts-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 40px;
}

.suggested-header {
    background: #e9ecef;
    padding: 15px 20px;
}

.suggested-title {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.suggested-items {
    padding: 20px;
}

.suggested-item {
    display: grid;
    grid-template-columns: 100px 200px 1fr 60px;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #f8f9fa;
    align-items: center;
}

.suggested-item:last-child {
    border-bottom: none;
}

.suggested-actions {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.add-suggested-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.add-suggested-btn:hover {
    background: #1e7e34;
}

.skip-proceed-btn {
    background: #0073e6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.skip-proceed-btn:hover {
    background: #0056b3;
}

.quote-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.edit-quote-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
}

.edit-quote-btn:hover {
    background: #c82333;
}

.proceed-quote-btn {
    background: #0073e6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
}

.proceed-quote-btn:hover {
    background: #0056b3;
}

/* Quote Submission Form Styles */
.submission-header {
    position: relative;
}

.search-mini {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

.mini-search-form {
    display: flex;
    gap: 0;
}

.mini-search-input {
    padding: 10px 16px;
    border: 1px solid #dee2e6;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 14px;
    outline: none;
    width: 200px;
}

.mini-search-btn {
    padding: 10px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    cursor: pointer;
}

.submission-main {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 40px;
}

.submission-header-section {
    text-align: center;
    margin-bottom: 40px;
}

.submission-title {
    font-size: 32px;
    font-weight: 600;
    color: #333;
}

.quote-form {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 40px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
}

.optional {
    font-weight: normal;
    color: #6c757d;
}

.form-input, .form-textarea {
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.form-input:focus, .form-textarea:focus {
    border-color: #0073e6;
    box-shadow: 0 0 0 3px rgba(0, 115, 230, 0.1);
}

.form-textarea {
    resize: vertical;
    font-family: inherit;
}

.form-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.edit-quote-btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.edit-quote-btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.submit-quote-btn {
    background: #0073e6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-quote-btn:hover {
    background: #0056b3;
}

/* Footer Styles */
.portal-footer {
    background: white;
    /* border-top: 1px solid #e9ecef; */
    padding: 40px 20px 20px;
    margin-top: auto;
}

.footer-content {
    max-width: 1920px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 40px;
}

.footer-logo .logo {
    color: #0073e6;
    font-size: 20px;
    font-weight: 600;
}

.footer-links {
    display: flex;
    gap: 30px;
}

.footer-link {
    color: #6c757d;
    text-decoration: none;
    font-weight: 500;
}

.footer-link:hover {
    color: #0073e6;
}

.footer-bottom {
    max-width: 1920px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px 0;
    border-top: 1px solid #e9ecef;
}

.copyright {
    color: #6c757d;
    font-size: 14px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 32px;
    height: 32px;
    background: #f8f9fa;
    color: #6c757d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.social-link:hover {
    background: #0073e6;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        font-size: 36px;
    }

    .serial-search-form {
        max-width: none;
    }

    .results-table-container {
        overflow-x: auto;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .footer-content, .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .quote-actions, .form-actions {
        flex-direction: column;
    }
}

/* Loading and Success States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}


/* ── Serial Finder form: align right & shrink-wrap ─────────────────────────── */
#serial-search-form {
  display: inline-flex;     /* shrink to input+button size */
  gap: 0;
  margin-left: auto;        /* push to the right inside its parent */
  max-width: none;
  width: auto;
  border: 0 !important;     /* remove the red debug border */
}

/* make the inner group a row (in case it's not already) */
#serial-search-form .search-input-group {
  display: flex;
}

/* match heights and remove the seam */
#serial-search-form .search-input {
  width: 400px;
  height: 48px;
  padding: 0 16px;
  border: 1px solid #e0e5ec;
  border-right: 0;
  border-radius: 8px 0 0 8px;
}

#serial-search-form .search-button {
  height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 0 8px 8px 0;
}

/* Comprehensive Responsive Design */

/* Large Desktop - 1200px+ */
@media (min-width: 1200px) {
    .search-content {
        padding: 0 40px;
        max-width: 1400px;
        margin: 0 auto;
    }

    .hero-title {
        font-size: 52px;
    }

    .search-input {
        font-size: 18px;
        padding: 18px 24px;
    }

    .search-button {
        font-size: 18px;
        padding: 18px 36px;
    }
}

/* Desktop - 992px to 1199px */
@media (max-width: 1199px) and (min-width: 992px) {
    .search-content {
        gap: 60px;
        padding: 0 30px;
    }

    .hero-title {
        font-size: 46px;
    }

    .search-visual {
        height: 280px;
    }
}

/* Tablet - 768px to 991px */
@media (max-width: 991px) and (min-width: 769px) {
    .search-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
        padding: 0 20px;
    }

    .search-visual {
        height: 250px;
        justify-content: center;
        align-items: center;
        order: -1; /* Move visual above text on tablet */
    }

    .hero-title {
        font-size: 42px;
        margin-bottom: 16px;
    }

    .hero-description {
        font-size: 16px;
        margin-bottom: 30px;
    }

    .serial-search-form {
        max-width: 600px;
        margin: 0 auto;
    }

    .search-input {
        font-size: 16px;
        padding: 16px 20px;
    }

    .search-button {
        padding: 16px 28px;
    }
}

/* Mobile Large - 481px to 768px */
@media (max-width: 768px) and (min-width: 481px) {
    .parts-portal-container {
        padding: 0;
    }

    .portal-header {
        padding: 12px 20px;
    }

    .portal-logo {
        font-size: 20px;
    }

    .quote-counter {
        font-size: 14px;
    }

    .search-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
        padding: 20px 20px 40px;
    }

    .search-visual {
        height: 220px;
        justify-content: center;
        align-items: center;
        order: -1;
    }

    .hero-title {
        font-size: 36px;
        margin-bottom: 16px;
        line-height: 1.1;
    }

    .hero-description {
        font-size: 15px;
        margin-bottom: 25px;
        br {
            display: none; /* Remove line breaks on mobile */
        }
    }

    .serial-search-form, #serial-search-form {
        display: flex;
        margin: 0 auto;
        width: 100%;
        max-width: 480px;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .search-input, #serial-search-form .search-input {
        flex: 1;
        font-size: 16px;
        padding: 14px 16px;
        border: 2px solid #e9ecef;
        border-right: none;
        border-radius: 8px 0 0 8px;
        min-width: 0; /* Allow input to shrink */
    }

    .search-button, #serial-search-form .search-button {
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 0 8px 8px 0;
        white-space: nowrap;
        min-width: 80px;
    }

    /* QR Code section responsive */
    .qr-search-section {
        margin-top: 20px;
        padding: 16px;
        border-radius: 12px;
        background: rgba(255,255,255,0.9);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .qr-search-section h2 {
        font-size: 18px;
        margin: 0;
    }

    .qr-search-section p {
        font-size: 13px;
        margin-top: 4px;
    }
}

/* Mobile Small - 320px to 480px */
@media (max-width: 480px) {
    .parts-portal-container {
        padding: 0;
        min-height: 100vh;
    }

    .portal-header {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .portal-logo {
        font-size: 18px;
    }

    .quote-counter {
        font-size: 12px;
        padding: 4px 8px;
    }

    .search-content {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 16px 16px 32px;
        text-align: center;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .search-visual {
        height: 180px;
        order: -1;
    }

    .search-illustration {
        transform: scale(0.8);
    }

    .hero-title {
        font-size: 28px;
        margin-bottom: 12px;
        line-height: 1.1;
    }

    .hero-description {
        font-size: 14px;
        margin-bottom: 20px;
        line-height: 1.4;
    }

    .hero-description br {
        display: none;
    }

    .serial-search-form, #serial-search-form {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        border-radius: 6px;
        overflow: hidden;
        box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    }

    /* Ensure search text container is centered */
    .search-text {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0 16px;
    }

    .search-text center {
        width: 100%;
        max-width: 100%;
    }

    .search-input, #serial-search-form .search-input {
        flex: 1;
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 14px;
        border: 2px solid #e9ecef;
        border-right: none;
        border-radius: 6px 0 0 6px;
        min-width: 0;
    }

    .search-button, #serial-search-form .search-button {
        padding: 12px 16px;
        font-size: 14px;
        border-radius: 0 6px 6px 0;
        min-width: 70px;
    }

    /* QR Code section for small mobile */
    .qr-search-section {
        margin-top: 16px;
        padding: 12px;
        border-radius: 8px;
    }

    .qr-search-section h2 {
        font-size: 16px;
    }

    .qr-search-section p {
        font-size: 12px;
    }

    .qr-search-section svg {
        width: 32px;
        height: 32px;
    }

    /* Footer responsive */
    .portal-footer {
        margin-top: 40px;
        padding: 20px 16px;
    }

    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .footer-links {
        gap: 20px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* Extra Small Mobile - below 360px */
@media (max-width: 359px) {
    .hero-title {
        font-size: 24px;
    }

    .search-input, #serial-search-form .search-input {
        padding: 10px 12px;
        font-size: 16px;
    }

    .search-button, #serial-search-form .search-button {
        padding: 10px 12px;
        font-size: 13px;
        min-width: 60px;
    }

    .qr-search-section {
        padding: 10px;
    }

    .qr-search-section h2 {
        font-size: 14px;
    }
}

/* QR Code Search Section */
.qr-search-section:hover {
    background-color: rgba(0,0,0,0.05);
}

.qr-search-section:active {
    background-color: rgba(0,0,0,0.1);
}

/* QR Scanner Modal Styles */
.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.qr-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.qr-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

/* High specificity overrides for desktop QR header container */
body .qr-modal .qr-modal-header,
body.wp-admin .qr-modal .qr-modal-header,
body.twentytwentyfive .qr-modal .qr-modal-header,
body.twentytwentyfour .qr-modal .qr-modal-header,
body.twentytwentythree .qr-modal .qr-modal-header {
    padding: 16px 20px !important;
    min-height: auto !important;
    max-height: 60px !important;
}

.qr-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

/* High specificity overrides for desktop QR header */
body .qr-modal .qr-modal-header h3,
body.wp-admin .qr-modal .qr-modal-header h3,
body.twentytwentyfive .qr-modal .qr-modal-header h3,
body.twentytwentyfour .qr-modal .qr-modal-header h3,
body.twentytwentythree .qr-modal .qr-modal-header h3 {
    font-size: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
    font-weight: 600 !important;
    color: #333 !important;
}

.qr-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.qr-close-btn:hover {
    background-color: #f5f5f5;
    color: #333;
}

.qr-scanner-container {
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-video {
    width: 100%;
    height: auto;
    border-radius: 0;
    background: #000;
}

.qr-canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.qr-loading {
    text-align: center;
    padding: 40px;
}

.qr-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: qr-spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes qr-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.qr-error {
    text-align: center;
    padding: 40px 24px;
    color: #d63638;
}

.qr-error ul {
    text-align: left;
    margin: 16px 0;
    display: inline-block;
}

.qr-error li {
    margin: 8px 0;
}

.qr-retry-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-top: 16px;
    transition: background-color 0.2s;
}

.qr-retry-btn:hover {
    background: #005a87;
}

.qr-result {
    text-align: center;
    padding: 40px 24px;
    color: #0a7c42;
}

.qr-success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #0a7c42;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    margin: 0 auto 16px;
}

.qr-result-text {
    background: #f0f8f4;
    border: 1px solid #0a7c42;
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
    font-family: monospace;
    word-break: break-all;
}

.qr-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #eee;
    text-align: center;
}

.qr-instructions {
    color: #666;
    margin: 0 0 12px 0;
    font-size: 14px;
}

.qr-switch-btn {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.qr-switch-btn:hover {
    background: #e0e0e0;
}

/* Mobile responsiveness for QR scanner */
@media (max-width: 480px) {
    body .qr-modal .qr-modal-content {
        width: 95vw !important;
        margin: 10px !important;
        max-height: 90vh !important;
    }

    body .qr-modal .qr-modal-header,
    body .qr-modal .qr-modal-footer {
        padding: 8px 12px !important;
    }

    body .qr-modal .qr-modal-header h3 {
        font-size: 16px !important;
        margin: 0 !important;
    }

    body .qr-modal .qr-video {
        max-height: 65vh !important;
    }
}

/* Extra specific mobile QR scanner overrides */
@media (max-width: 768px) {
    body.wp-admin .qr-modal .qr-modal-content,
    body.twentytwentyfive .qr-modal .qr-modal-content,
    body.twentytwentyfour .qr-modal .qr-modal-content,
    body.twentytwentythree .qr-modal .qr-modal-content {
        width: 95vw !important;
        margin: 10px !important;
        max-height: 90vh !important;
    }

    body.wp-admin .qr-modal .qr-modal-header,
    body.twentytwentyfive .qr-modal .qr-modal-header,
    body.twentytwentyfour .qr-modal .qr-modal-header,
    body.twentytwentythree .qr-modal .qr-modal-header {
        padding: 8px 12px !important;
        min-height: auto !important;
    }

    body.wp-admin .qr-modal .qr-modal-header h3,
    body.twentytwentyfive .qr-modal .qr-modal-header h3,
    body.twentytwentyfour .qr-modal .qr-modal-header h3,
    body.twentytwentythree .qr-modal .qr-modal-header h3 {
        font-size: 16px !important;
        margin: 0 !important;
        line-height: 1.2 !important;
    }

    body.wp-admin .qr-modal .qr-video,
    body.twentytwentyfive .qr-modal .qr-video,
    body.twentytwentyfour .qr-modal .qr-video,
    body.twentytwentythree .qr-modal .qr-video {
        max-height: 65vh !important;
        height: 65vh !important;
    }
}

