/* Responsive Styles for Trademark Directory Theme */

/* Base responsive rules */
html {
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

img, video, iframe, object, embed {
  max-width: 100%;
  height: auto;
}

/* =================================
   GLOBAL RESPONSIVE UTILITIES
   ================================= */

/* Responsive container for all pages */
.container,
.global-container {
  width: 100%;
  padding-right: 1rem;
  padding-left: 1rem;
  margin-right: auto;
  margin-left: auto;
}

/* Responsive tables */
table {
  width: 100%;
  border-collapse: collapse;
}

@media (max-width: 767px) {
  table, 
  tbody, 
  tr, 
  td {
    display: block;
    width: 100%;
  }
  
  thead {
    display: none;
  }
  
  tr {
    margin-bottom: 1rem;
    border: 1px solid #ddd;
  }
  
  td {
    position: relative;
    padding-left: 50%;
    text-align: right;
    border-bottom: 1px solid #ddd;
  }
  
  td:before {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    content: attr(data-label);
    font-weight: 600;
    text-align: left;
  }
}

/* =================================
   TYPOGRAPHY RESPONSIVE
   ================================= */

/* Base responsive typography */
@media (max-width: 1199px) {
  html {
    font-size: 16px;
  }
}

@media (max-width: 991px) {
  html {
    font-size: 15px;
  }
  
  h1, .h1 {
    font-size: 2.75rem;
  }
  
  h2, .h2 {
    font-size: 2.25rem;
  }
  
  h3, .h3 {
    font-size: 1.5rem;
  }
}

@media (max-width: 767px) {
  html {
    font-size: 14px;
  }
  
  h1, .h1 {
    font-size: 2.25rem;
  }
  
  h2, .h2 {
    font-size: 1.75rem;
  }
  
  h3, .h3 {
    font-size: 1.25rem;
  }
  
  h4, .h4 {
    font-size: 1.1rem;
  }
  
  p {
    font-size: 1rem;
  }
}

@media (max-width: 575px) {
  h1, .h1 {
    font-size: 1.75rem;
    line-height: 1.3;
  }
  
  h2, .h2 {
    font-size: 1.5rem;
    line-height: 1.3;
  }
  
  .hero-title {
    font-size: 1.75rem !important;
    line-height: 1.3 !important;
  }
  
  .hero-subtitle {
    font-size: 1rem !important;
  }
  
  .search-title {
    font-size: 1.75rem !important;
  }
  
  .animated-word {
    display: inline !important;
  }
}

/* =================================
   LAYOUT COMPONENTS
   ================================= */

/* 1. Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .container,
  .global-container {
    max-width: 1140px;
  }
}

/* 2. Large devices (desktops, 992px to 1199px) */
@media (max-width: 1199px) {
  .container,
  .global-container {
    max-width: 960px;
  }
  
  /* Grid adjustments */
  .resources-grid,
  .features-grid,
  .testimonial-grid,
  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  
  /* Form adjustments */
  .form-row {
    flex-direction: row;
  }
  
  /* Button adjustments */
  .btn-common {
    padding: 0.75rem 1.5rem !important;
  }
  
  /* Header adjustments */
  .nav-links {
    gap: 20px;
  }
  
  .logo-text {
    font-size: 18px;
  }
}

/* 3. Medium devices (tablets, 768px to 991px) */
@media (max-width: 991px) {
  .container,
  .global-container {
    max-width: 720px;
  }
  
  /* Grid adjustments */
  .resources-grid,
  .features-grid,
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Hero sections */
  .hero-container,
  .service-row {
    flex-direction: column;
  }
  
  .hero-content,
  .hero-image {
    width: 100%;
    max-width: 100% !important;
    text-align: center;
  }
  
  .hero-image img {
    margin: 0 auto;
    max-width: 300px !important;
    height: auto !important;
  }
  
  /* Services Layout */
  .service-row {
    margin-bottom: 2rem !important;
    max-height: unset !important;
  }
  
  .service-row > div {
    margin-bottom: 1.5rem;
  }
  
  /* Form adjustments */
  .form-row {
    flex-direction: column;
  }
  
  .form-group {
    width: 100%;
    margin-right: 0;
  }
  
  /* Phone field styling */
  .phone-field-container {
    flex-direction: row;
  }
  
  /* Step containers */
  .steps-container,
  .steps-section-unique-xyz .container {
    flex-direction: column;
  }
  
  .step-item {
    width: 100%;
    margin-bottom: 20px;
  }
  
  /* Navigation improvements */
  .dropdown-menu {
    max-width: 100%;
  }
  
  .dropdown-item {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .item-title, 
  .item-description {
    width: 100%;
    overflow: visible;
    text-overflow: initial;
    white-space: normal;
  }
  
  /* Steps section adjustments */
  .steps-section-unique-xyz .steps-left {
    text-align: center;
    margin-bottom: 2rem;
  }
  
  .steps-section-unique-xyz .steps-right {
    width: 100%;
  }
  
  /* Footer adjustments */
  footer .grid,
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  /* Why Choose Us section */
  .features-grid {
    gap: 1rem;
  }
  
  /* Global Reach section */
  .floating-flag {
    width: 50px;
    height: 50px;
  }
  
  /* Commitment section */
  .commitment-section > div {
    flex-direction: column;
    gap: 1.5rem;
  }
}

/* 4. Small devices (landscape phones, 576px to 767px) */
@media (max-width: 767px) {
  .container,
  .global-container {
    max-width: 540px;
    padding: 0 1rem;
  }
  
  /* Grid adjustments */
  .resources-grid,
  .features-grid,
  .testimonial-grid,
  .pricing-grid,
  .footer-grid,
  footer .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Form elements */
  .form-section {
    padding: 15px;
  }
  
  /* Registration forms */
  .registration-step {
    padding: 15px;
  }
  
  /* Buttons */
  .btn, .btn-primary, .btn-secondary, .btn-outline, .btn-common {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px 15px !important;
    font-size: 14px !important;
  }
  
  .hero-cta {
    flex-direction: column;
  }
  
  /* Phone field styling */
  .phone-field-container {
    flex-direction: column;
    gap: 10px;
  }
  
  .country-code-dropdown, 
  .phone-input {
    width: 100%;
  }
  
  /* Mobile navigation improvements */
  .dropdown-menu.services-dropdown,
  .dropdown-menu.resources-dropdown {
    width: 100%;
    max-width: 100%;
  }
  
  .dropdown-grid {
    display: flex;
    flex-direction: column;
  }
  
  .dropdown-item {
    padding: 10px;
  }
  
  /* Search section */
  .search-section {
    padding: 3rem 1rem !important;
  }
  
  .search-card {
    padding: 1.5rem 1.5rem 2rem !important;
  }
  
  .search-form {
    flex-direction: column;
  }
  
  /* How It Works section */
  .steps-section-unique-xyz {
    padding: 3rem 1rem !important;
  }
  
  /* Core Services section */
  .services-section {
    padding: 3rem 0 !important;
  }
  
  /* Global Reach section */
  .floating-flags-container {
    height: 200px !important;
  }
  
  /* Why Choose Us section */
  .why-choose-section {
    padding: 3rem 1rem !important;
  }
  
  /* Commitment section */
  .commitment-section {
    padding: 3rem 1.5rem !important;
  }
  
  /* Resources section */
  .resources-section > div {
    padding: 3rem 1rem !important;
  }
  
  /* FAQ section */
  .faq-section {
    padding: 3rem 0 !important;
  }
  
  .faq-section .container {
    padding: 0 1rem;
  }
  
  /* Final CTA section */
  .final-cta-section {
    padding: 3rem 0 !important;
  }
  
  .final-cta-container {
    padding: 2rem 1rem !important;
  }
  
  /* Review styles */
  .review-slide {
    width: 200px !important;
  }
}

/* 5. Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575px) {
  .container,
  .global-container {
    padding: 0 1rem;
  }
  
  /* Navigation adjustments */
  .nav-links {
    padding: 10px 0;
  }
  
  .dropdown-menu {
    padding-left: 10px;
  }
  
  .dropdown-item {
    padding: 8px;
  }
  
  .item-title {
    font-size: 14px;
  }
  
  .item-description {
    font-size: 12px;
  }
  
  /* Form elements */
  input, select, textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
  
  /* Step elements */
  .step-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .step-description {
    font-size: 14px;
  }
  
  /* Progress indicators */
  .step-progress {
    width: 100%;
    margin-top: 15px;
  }
  
  .progress {
    height: 10px;
  }
  
  /* Phone fields */
  .phone-field-container {
    flex-direction: column;
  }
  
  /* Search section */
  .search-card {
    border-radius: 12px !important;
  }
  
  .search-input {
    font-size: 16px !important;
    padding: 0.8rem 1rem !important;
  }
  
  .btn-search {
    font-size: 16px !important;
    padding: 0.8rem 1.5rem !important;
  }
  
  /* Step numbers */
  .steps-section-unique-xyz .step-number {
    width: 25px;
    height: 25px;
    font-size: 14px;
  }
  
  /* Feature cards */
  .feature-card {
    padding: 1.5rem !important;
  }
  
  /* Commitment quote */
  blockquote {
    padding-left: 0.5rem !important;
  }
  
  /* Resource cards */
  .resource-card > div:first-child {
    height: 140px !important;
  }
  
  /* FAQ */
  .faq-question {
    padding: 1rem !important;
    font-size: 16px !important;
  }
  
  .faq-item.open .faq-answer {
    padding: 1rem !important;
  }
}

/* =================================
   SPECIFIC PAGE COMPONENTS 
   ================================= */

/* Dashboard pages */
@media (max-width: 991px) {
  .dashboard-container {
    grid-template-columns: 1fr;
  }
  
  .dashboard-sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 1000;
    transition: left 0.3s ease;
  }
  
  .dashboard-sidebar.active {
    left: 0;
  }
  
  .dashboard-content {
    margin-left: 0;
  }
  
  .sidebar-toggle {
    display: flex;
  }
}

/* Registration process */
@media (max-width: 991px) {
  .registration-container {
    flex-direction: column;
  }
  
  .registration-sidebar {
    width: 100%;
    height: auto;
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .registration-content {
    padding: 1rem;
  }
  
  .progress-indicator {
    flex-direction: row;
    overflow-x: auto;
    padding: 0.5rem 0;
  }
  
  .progress-step {
    flex: 0 0 auto;
    margin-right: 1rem;
  }
}

/* Trademark registration pages */
@media (max-width: 991px) {
  .registration-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .cost-summary {
    margin-top: 1rem;
  }
  
  .service-options {
    grid-template-columns: 1fr;
  }
  
  .option-card {
    margin-bottom: 1rem;
  }
}

/* ================================= 
   NAVIGATION RESPONSIVE
   ================================= */

/* Mobile Navigation */
@media (max-width: 992px) {
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background-color: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 70px 0 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    z-index: 1000;
    margin-left: 0;
    overflow-y: auto;
    transform: translateX(-100%);
    visibility: hidden;
  }
  
  .nav-links.active {
    transform: translateX(0);
    visibility: visible;
  }
  
  .nav-item {
    width: 100%;
    padding: 0;
  }
  
  .nav-link {
    width: 100%;
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
  }
  
  .nav-item.active .dropdown-menu {
    display: block !important;
    opacity: 1;
    visibility: visible;
    position: static;
    box-shadow: none;
    transform: none;
    width: 100%;
    padding: 0 0 0 20px;
    margin: 0;
  }
  
  .menu-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
  }
  
  .menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  
  .mobile-only {
    display: block;
  }
  
  .mobile-menu-toggle {
    display: flex !important;
  }
}

/* ================================= 
   CUSTOM PAGE COMPONENTS
   ================================= */

/* Update hero section responsiveness */
@media (max-width: 767px) {
  .hero-section {
    padding: 2rem 0 !important;
    text-align: center;
  }
  
  .hero-cta {
    justify-content: center;
  }
}

/* Fix specific height issues */
@media (max-width: 767px) {
  .service-row,
  .service-row > div {
    max-height: unset !important;
    height: auto !important;
  }
  
  .service-row img {
    max-height: 250px !important;
    object-fit: contain !important;
  }
} 