/* ===================================
   Responsive Styles - Lapify
   =================================== */

/* Mobile First Approach */

/* Small devices (landscape phones, 640px and up) */
@media (max-width: 640px) {
  /* 横スクロール防止 */
  html {
    overflow-x: hidden;
    width: 100%;
  }

  body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  /* すべてのセクションで幅制限 */
  section {
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* グローバルコンテナパディング */
  .container,
  .hero > div,
  .features > div,
  .improvement-info > div,
  .problems-solutions-wrapper > div,
  .pricing > div,
  .process > div,
  .faq > div,
  .contact > div,
  .footer > div {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    max-width: 100%;
  }

  /* 統一されたタイポグラフィ階層 */
  h1, .hero-title, .section-title {
    font-size: 2rem !important;
    line-height: 1.35;
    margin-bottom: 1.25rem;
  }

  h2, .section-subtitle, .improvement-solution-title, .contact-form-title {
    font-size: 1.375rem !important;
    line-height: 1.45;
    margin-bottom: 1rem;
  }

  h3, .feature-title, .improvement-title, .problems-column h3 {
    font-size: 1.25rem !important;
    line-height: 1.45;
    margin-bottom: 0.75rem;
  }

  h4, .footer-section h4 {
    font-size: 1.125rem !important;
    line-height: 1.5;
  }

  /* 統一されたテキストサイズ */
  p, .hero-description, .improvement-text, .feature-text {
    font-size: 1rem !important;
    line-height: 1.75;
    margin-bottom: 1.25rem;
  }

  /* 統一されたセクションパディング */
  section {
    padding: 4rem 0 !important;
  }

  /* Hero Section */
  .hero {
    min-height: auto;
    padding: 6rem 0 4rem !important;
  }

  .hero-wrapper {
    flex-direction: column;
    gap: 2rem;
    max-width: 100%;
  }

  .hero-title .highlight {
    font-size: 2rem !important;
  }

  .hero-subtitle {
    font-size: 1.375rem !important;
    margin-bottom: 1.25rem;
    line-height: 1.6;
    font-weight: 600;
  }

  .hero-cta {
    flex-direction: column;
    gap: 1.25rem;
    max-width: 100%;
  }

  .hero-cta .btn {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero-media {
    order: 0;
  }

  .iphone-mockup {
    max-width: 300px;
  }

  .mockup-iframe-container {
    top: 12.3% !important;
    height: 85% !important;
  }

  .hero-accent-image {
    width: 20px;
    bottom: -120px;
    right: -120px;
  }

  /* 統一されたカードパディング */
  .card, .feature-card, .improvement-card, .pricing-card {
    padding: 2rem 1.5rem !important;
  }

  /* Features Grid */
  .features-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
    max-width: 100%;
  }

  /* Improvement Grid */
  .improvement-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
    max-width: 100%;
  }

  /* Problems Section */
  .problems-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }

  .problems-solutions-container {
    padding: 2rem 1.5rem !important;
  }

  /* Pricing Grid */
  .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
    justify-items: center;
    max-width: 100%;
  }

  .pricing-card {
    margin: 0 auto;
    max-width: 400px;
    width: 100%;
    box-sizing: border-box;
    padding: 1.5rem 1.25rem !important;
  }

  .pricing-card.featured {
    transform: scale(1) !important;
    margin: 0 auto;
  }

  .pricing-card.featured:hover {
    transform: translateY(-4px) !important;
  }

  .pricing-header {
    margin-bottom: 0 !important;
  }

  .pricing-recommended {
    margin-top: 1rem !important;
    padding: 0.75rem !important;
  }

  .pricing-recommended-title {
    font-size: 0.9375rem !important;
    margin-bottom: 0.5rem;
  }

  .pricing-recommended ul {
    font-size: 0.875rem !important;
  }

  .pricing-recommended ul li {
    line-height: 1.5;
    margin-bottom: 0.25rem;
    padding: 0.125rem 0;
  }

  .pricing-card h3,
  .pricing-name {
    font-size: 1.125rem !important;
    margin-bottom: 0.75rem !important;
    padding: 0.875rem 1.125rem !important;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 3px solid var(--dark);
    border-bottom: 4px solid var(--dark);
    border-radius: 0;
    text-align: center;
    font-weight: 800 !important;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
  }

  .pricing-name::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 10%;
    right: 10%;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
  }

  .pricing-price {
    font-size: 2rem !important;
    margin-bottom: 0.25rem !important;
  }

  .pricing-duration {
    font-size: 0.8125rem !important;
    margin-bottom: 0 !important;
  }

  .pricing-description {
    font-size: 0.875rem !important;
    margin-bottom: 0 !important;
    line-height: 1.4;
  }

  .pricing-period {
    font-size: 0.9375rem !important;
  }

  .pricing-features {
    margin-bottom: 1rem !important;
  }

  .pricing-features li {
    font-size: 0.875rem !important;
    padding: 0.5rem 0;
    padding-left: 2rem !important;
    line-height: 1.5;
  }

  .pricing-features li::before {
    font-size: 1rem !important;
  }

  /* Pricing Features Toggle Button (Mobile Accordion) */
  .pricing-features-toggle {
    width: 100%;
    padding: 0.875rem 1rem;
    margin-bottom: 0;
    background: linear-gradient(135deg, #fde047 0%, #facc15 100%);
    color: var(--dark);
    border: 2px solid var(--dark);
    border-radius: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  }

  .pricing-features-toggle:hover {
    background: linear-gradient(135deg, #fef08a 0%, #fde047 100%);
    color: var(--dark);
    border-color: var(--dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  }

  .pricing-features-toggle:active {
    transform: translateY(0);
  }

  .pricing-features-toggle .toggle-icon {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
  }

  .pricing-features.collapsed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-bottom: 0 !important;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin-bottom 0.3s ease;
  }

  .pricing-features:not(.collapsed) {
    max-height: 1000px;
    opacity: 1;
    transition: max-height 0.4s ease, opacity 0.3s ease;
  }

  /* Pricing Recommended (Mobile Accordion) */
  .pricing-recommended.collapsed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0 !important;
    padding: 0 !important;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.3s ease, padding 0.3s ease;
  }

  .pricing-recommended:not(.collapsed) {
    max-height: 500px;
    opacity: 1;
    transition: max-height 0.4s ease, opacity 0.3s ease;
  }

  /* Pricing Card Button (Mobile Accordion) */
  .pricing-card .btn.collapsed {
    display: none !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }

  .pricing-card .btn:not(.collapsed) {
    display: block !important;
    max-height: 100px;
    opacity: 1;
    transition: max-height 0.4s ease, opacity 0.3s ease;
  }

  /* Timeline */
  .timeline {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    padding: 0 !important;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  .timeline::before {
    display: none;
  }

  .timeline-item {
    padding: 2rem 1.5rem !important;
    flex-direction: column !important;
    margin-bottom: 0 !important;
    position: relative;
    box-sizing: border-box;
    max-width: 100%;
    align-items: flex-start;
  }

  .timeline-item::after {
    display: none !important;
  }

  .timeline-content {
    width: 100% !important;
    padding: 0 !important;
    position: relative;
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
  }

  .timeline-content h3 {
    font-size: 1.25rem !important;
    margin-bottom: 0.75rem !important;
    line-height: 1.45;
    font-weight: 700;
  }

  .timeline-content p {
    font-size: 1rem !important;
    line-height: 1.75;
    margin-bottom: 0;
  }

  .timeline-duration {
    font-size: 0.875rem !important;
    margin-top: 0;
    margin-bottom: 0.75rem;
  }

  .timeline-number {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 50px !important;
    height: 50px !important;
    font-size: 1.5rem !important;
    flex-shrink: 0;
    margin-bottom: 1rem;
  }

  /* Header */
  .header-container {
    padding-left: 0.5rem !important;
    padding-right: 1rem !important;
  }

  .header-nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: block !important;
  }

  .mobile-menu.active {
    display: flex !important;
  }

  /* FAQ */
  .faq-item {
    margin-bottom: 1rem;
  }

  .faq-question {
    font-size: 1.125rem !important;
    padding: 1.25rem 1.5rem;
    line-height: 1.5;
  }

  .faq-answer-content {
    padding: 0 1.5rem 1.25rem 1.5rem;
    font-size: 1rem !important;
    line-height: 1.75;
  }

  /* Contact Form */
  .contact-form-section {
    padding: 4rem 0 !important;
  }

  .contact-form-container {
    padding: 0 1rem;
  }

  .contact-form-title {
    font-size: 2rem !important;
    margin-top: 2rem !important;
  }

  .contact-form-subtitle {
    font-size: 1rem !important;
    line-height: 1.75;
  }

  .contact-form-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-form {
    order: -1;
  }

  .contact-sidebar {
    order: 0;
  }

  .contact-form {
    padding: 2rem 1.5rem;
  }

  .form-group {
    margin-bottom: 2rem;
  }

  .form-group label {
    font-size: 1rem !important;
    margin-bottom: 0.5rem;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 1rem !important;
    padding: 0.875rem !important;
    line-height: 1.5;
  }

  .contact-info-card {
    padding: 2rem 1.5rem;
  }

  /* Improvement Solution */
  .improvement-solution {
    padding: 2rem !important;
  }

  .improvement-solution-content {
    flex-direction: column;
    gap: 2rem;
  }

  .improvement-solution-image {
    max-width: 120px;
    margin: 0 auto;
  }

  .improvement-solution-title {
    font-size: 1.375rem !important;
    text-align: center;
    line-height: 1.5;
  }

  .improvement-solution-text {
    font-size: 1rem !important;
    text-align: center;
    line-height: 1.75;
  }

  /* Problems & Solutions */
  .problems-solutions-container {
    padding: 1rem 0.75rem !important;
    gap: 1rem;
    max-width: 100%;
    box-sizing: border-box;
  }

  .problems-content {
    gap: 1rem;
    max-width: 100%;
  }

  .problems-image {
    max-width: 220px;
  }

  .problems-column h3 {
    font-size: 1.375rem !important;
    margin-bottom: 0.5rem;
  }

  .problems-column ul {
    font-size: 1.0625rem !important;
  }

  .problems-column ul li {
    font-size: 1.0rem !important;
    line-height: 1.6;
    margin-bottom: 0.25rem;
    padding: 0.5rem 0;
  }

  /* Check List & Cross List - Mobile Adjustments */
  .problems-column .check-list li,
  .check-list li {
    padding: 0.75rem 0 !important;
    padding-left: 2rem !important;
    font-size: 1.125rem !important;
    line-height: 1.6 !important;
  }

  .check-list li::before {
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 1.5rem !important;
    left: 0 !important;
  }

  .cross-list li {
    padding: 0.75rem 0 !important;
    padding-left: 2rem !important;
    font-size: 0.75rem !important;
    line-height: 1.6 !important;
  }

  .cross-list li::before {
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 1.5rem !important;
    left: 0 !important;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer {
    padding: 3rem 0 1.5rem;
  }

  /* Contact CTA */
  .contact-cta {
    flex-direction: column;
    gap: 1.25rem;
  }

  .contact-cta .btn {
    width: 100%;
    max-width: 100%;
    font-size: 1rem !important;
    padding: 1rem 1.5rem !important;
    min-height: 52px;
  }

  /* 統一されたボタンサイズ */
  .btn {
    padding: 1rem 1.5rem !important;
    font-size: 1rem !important;
    min-height: 48px;
    font-weight: 600;
  }

  /* セクションヘッダーの統一 */
  .section-header {
    margin-bottom: 2.5rem !important;
    text-align: center;
  }

  .section-subtitle {
    font-size: 1rem !important;
    line-height: 1.75;
    margin-top: 1rem;
  }

  /* 画像の最大幅制限 */
  img {
    max-width: 100%;
    height: auto;
    display: block;
  }

  /* すべてのカードタイプ */
  .card,
  .feature-card,
  .improvement-card,
  .pricing-card,
  .timeline-item,
  .faq-item {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Arrow Connector */
  .arrow-connector {
    padding: 1rem 0 !important;
  }

  .arrow-head {
    width: 50px !important;
    height: 50px !important;
  }

  .arrow-head::before {
    font-size: 1.5rem !important;
  }

  /* Additional mobile optimizations */
  .underlined-heading::after {
    height: 2px;
  }

  .highlight-marker {
    padding: 0 0.1em;
  }

  /* Scroll to top button */
  .scroll-top {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.25rem !important;
    bottom: 1rem !important;
    right: 1rem !important;
  }
}

/* デスクトップではアコーディオンボタンを非表示 */
@media (min-width: 641px) {
  .pricing-features-toggle {
    display: none !important;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 641px) and (max-width: 768px) {
  .section-title {
    font-size: 2.25rem;
  }

  .hero {
    min-height: 60vh;
  }

  .hero-wrapper {
    flex-direction: column;
    gap: 3rem;
  }

  .hero-title {
    font-size: 2.5rem !important;
  }

  .hero-title .highlight {
    font-size: 2.5rem !important;
  }

  .hero-media {
    order: -1;
  }

  .iphone-mockup {
    max-width: 350px;
  }

  .features-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }

  .improvement-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }

  .improvement-solution-content {
    flex-direction: column;
    gap: 2rem;
  }

  .improvement-solution-image {
    max-width: 250px;
    margin: 0 auto;
  }

  .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
    justify-items: center;
  }

  .pricing-card {
    margin: 0 auto;
    max-width: 450px;
    width: 100%;
  }

  .pricing-card.featured {
    transform: scale(1) !important;
  }

  .timeline-item {
    flex-direction: column !important;
    padding-left: 80px;
  }

  .timeline-content {
    width: 100% !important;
  }

  .timeline-number {
    left: 40px !important;
    transform: translateX(0) !important;
  }

  .timeline::before {
    left: 40px;
  }

  /* Contact Form */
  .contact-form-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-sidebar {
    order: -1;
  }

  .contact-form-title {
    font-size: 2rem;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  /* Contact CTA */
  .contact-cta {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Large devices (desktops, 1024px and up) */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero {
    min-height: 70vh;
  }

  .hero-wrapper {
    gap: 3rem;
  }

  .hero-title {
    font-size: 3rem !important;
  }

  .hero-title .highlight {
    font-size: 3rem !important;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .improvement-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .pricing-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    justify-items: center;
  }

  .pricing-card {
    max-width: 450px;
    width: 100%;
  }

  .pricing-card.featured {
    grid-column: 1 / -1;
    max-width: 500px;
    margin: 0 auto;
  }

  /* Contact Form */
  .contact-form-wrapper {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .contact-sidebar {
    order: -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Extra large devices (large desktops, 1280px and up) */
@media (min-width: 1025px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
    justify-items: center;
  }

  .pricing-card {
    max-width: 450px;
    width: 100%;
  }
}

/* Utility Classes for Responsive Display */
.mobile-only {
  display: block;
}

.desktop-only {
  display: none;
}

@media (min-width: 769px) {
  .mobile-only {
    display: none;
  }

  .desktop-only {
    display: block;
  }
}

/* Responsive Typography */
@media (max-width: 640px) {
  html {
    font-size: 15px;
  }

  /* 統一された行間とマージン */
  p + p {
    margin-top: 1rem;
  }

  /* リストの統一されたスタイル */
  ul, ol {
    padding-left: 1.5rem;
    font-size: 1rem !important;
  }

  li {
    margin-bottom: 0.75rem;
    line-height: 1.75;
  }

  /* テキストブロックの最大幅設定（読みやすさ向上） */
  .hero-description,
  .improvement-text,
  .improvement-solution-text,
  .timeline-description,
  .pricing-description {
    max-width: 100%;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  html {
    font-size: 15px;
  }
}

@media (min-width: 1025px) {
  html {
    font-size: 16px;
  }
}

/* Responsive Spacing */
@media (max-width: 768px) {
  section {
    padding: var(--section-spacing-mobile) 0;
  }

  .section-header {
    margin-bottom: var(--spacing-2xl);
  }
}

@media (min-width: 769px) {
  section {
    padding: var(--section-spacing) 0;
  }
}

/* Print Styles */
@media print {
  .header,
  .mobile-menu-toggle,
  .hero-cta,
  .btn {
    display: none;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  .card,
  .pricing-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
