/* ============================================
   BOCHI CILACAP - MOBILE ALIGNMENT FIXES
   ============================================ */

/* Tablet & Mobile (991px and below) */
@media (max-width: 991px) {
  /* Footer Link Hover Effect - Center aligned */
  .main-footer .footer-nav a.link::after {
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  .main-footer .footer-nav a.link:hover::after {
    width: 50% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  /* Read More Button - Center alignment */
  .agency .text-center {
    text-align: center !important;
    width: 100%;
    display: block;
    margin-top: 30px;
  }

  .agency .text-center .btn {
    display: inline-block;
    margin: 0 auto;
  }

  /* Agency Section - Center all text */
  .agency .section-title {
    text-align: center !important;
    margin: 0 auto 30px !important;
  }

  .agency p {
    text-align: center !important;
  }

  /* CTA Section - "You think we're cool" text */
  .green-section .white-text {
    text-align: center !important;
    display: block !important;
  }

  .green-section .col-md-6 .row {
    text-align: center;
  }

  .green-section .btn {
    margin: 0 auto;
    display: inline-block;
  }

  /* Footer - Center everything */
  .main-footer {
    text-align: center !important;
    padding: 40px 0 !important;
  }

  .main-footer .container {
    text-align: center !important;
  }

  .main-footer .row {
    text-align: center !important;
    margin: 0 !important;
  }

  .main-footer .col-xs-12 {
    text-align: center !important;
    width: 100% !important;
    padding: 0 15px !important;
  }

  .main-footer .footer-nav {
    text-align: center !important;
    width: 100% !important;
    display: block !important;
  }

  .main-footer .footer-nav ul {
    text-align: center !important;
    padding: 0 !important;
    margin: 0 auto 20px !important;
    width: 100% !important;
    display: block !important;
    list-style: none !important;
  }

  .main-footer .footer-nav ul li {
    text-align: center !important;
    display: inline-block !important;
    margin: 0 10px 10px !important;
    list-style: none !important;
    float: none !important;
  }

  .main-footer .footer-nav ul li a {
    display: inline-block !important;
    padding: 5px 10px !important;
    text-align: center !important;
  }

  .main-footer .gray-text {
    text-align: center !important;
    margin: 0 auto 20px !important;
    display: block !important;
    width: 100% !important;
  }

  .main-footer .social-icons {
    justify-content: center !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    text-align: center !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 auto 20px !important;
    list-style: none !important;
  }

  .main-footer .social-icons li {
    display: inline-block !important;
    float: none !important;
    list-style: none !important;
    margin: 0 6px !important;
    flex: 0 0 auto !important;
  }

  /* Newsletter/Contact Person Section - Center */
  .newsletter-section {
    text-align: center;
  }

  .newsletter-section .white-section {
    text-align: center;
  }

  .newsletter-section .contact-person {
    text-align: center;
  }

  .newsletter-section .person-info {
    text-align: center;
  }

  .newsletter-section .text-center {
    text-align: center !important;
  }

  /* Portfolio Items - Force visible on mobile and fix spacing */
  section.portfolio {
    margin-bottom: 50px !important;
    padding-bottom: 0 !important;
  }

  .portfolio_container {
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .portfolio_container .col-md-4,
  .portfolio_container .col-sm-6,
  .portfolio_container .col-xs-12 {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    margin-bottom: 20px !important;
    padding: 0 15px !important;
    width: 100% !important;
    float: none !important;
    left: 0 !important;
    top: 0 !important;
    transform: none !important;
  }

  .portfolio_item {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    margin-bottom: 0 !important;
    width: 100% !important;
  }

  .portfolio_item img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  /* Force CTA section to have proper spacing */
  .green-section {
    margin-top: 0 !important;
    clear: both !important;
  }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
  /* Read More Button */
  .agency .text-center {
    padding: 0 20px;
  }

  .agency .btn {
    width: auto !important;
    min-width: 150px;
    display: inline-block !important;
    margin: 0 auto !important;
  }

  /* CTA Section */
  .green-section {
    padding: 40px 0 !important;
  }

  .green-section .white-text {
    font-size: 20px !important;
    line-height: 1.4;
    margin-bottom: 20px !important;
    padding: 0 15px;
  }

  .green-section .btn {
    width: auto !important;
    display: inline-block !important;
    margin: 0 auto !important;
  }

  .green-section .col-md-6 {
    margin-bottom: 25px;
    padding: 0 15px;
  }

  /* Footer */
  .main-footer {
    padding: 40px 15px !important;
    text-align: center !important;
  }

  .main-footer .footer-nav ul {
    margin: 0 auto 20px !important;
  }

  .main-footer .footer-nav ul li {
    margin: 0 8px 8px !important;
  }

  .main-footer .footer-nav ul li a {
    font-size: 13px !important;
  }

  .main-footer .gray-text {
    font-size: 12px !important;
    line-height: 1.6 !important;
    padding: 0 20px !important;
    margin: 0 auto 20px !important;
  }

  .main-footer .social-icons {
    margin: 0 auto 20px !important;
    flex-wrap: nowrap !important;
  }

  .main-footer .social-icons li {
    margin: 0 5px !important;
  }

  /* Contact Person */
  .contact-person {
    padding: 0 10px;
  }

  .person-info {
    margin-bottom: 20px !important;
  }

  .person-info h4 {
    text-align: center;
  }

  .person-info p {
    text-align: center;
  }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
  /* Read More Button */
  .agency .text-center {
    padding: 0 15px;
    margin-top: 25px;
  }

  .agency .btn {
    width: 90% !important;
    max-width: 280px;
    display: block !important;
    margin: 0 auto !important;
    font-size: 12px;
    height: 45px;
    line-height: 45px;
  }

  /* Agency Text */
  .agency p {
    padding: 0 15px !important;
    text-align: center !important;
  }

  /* CTA Section */
  .green-section {
    padding: 30px 0 !important;
  }

  .green-section .white-text {
    font-size: 18px !important;
    line-height: 1.3;
    margin-bottom: 15px !important;
    padding: 0 10px;
  }

  .green-section .btn {
    width: 90% !important;
    max-width: 280px;
    display: block !important;
    margin: 0 auto !important;
    font-size: 12px;
    height: 45px;
    line-height: 45px;
  }

  .green-section .col-md-6 {
    margin-bottom: 20px;
    padding: 0 10px;
  }

  .green-section .white-section {
    padding: 20px 15px !important;
    margin-top: 15px !important;
  }

  .green-section .white-section .montserrat-text {
    font-size: 18px !important;
    margin-bottom: 12px !important;
  }

  .green-section .white-section p {
    margin-bottom: 15px !important;
    font-size: 13px;
    line-height: 1.5;
  }

  /* Footer */
  .main-footer {
    padding: 30px 10px 20px 10px !important;
    text-align: center !important;
  }

  .main-footer .footer-nav ul {
    margin: 0 auto 15px !important;
  }

  .main-footer .footer-nav ul li {
    display: block !important;
    margin: 0 0 10px 0 !important;
    width: 100% !important;
  }

  .main-footer .footer-nav ul li a {
    font-size: 13px !important;
    padding: 8px 0 !important;
    display: block !important;
  }

  .main-footer .gray-text {
    font-size: 11px !important;
    line-height: 1.5 !important;
    padding: 0 15px !important;
    margin: 0 auto 15px !important;
  }

  /* Social Icons - Force 6 in one row */
  .main-footer .social-icons {
    margin: 0 auto 15px !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    padding: 0 10px !important;
  }

  .main-footer .social-icons li {
    margin: 0 3px !important;
    flex: 0 0 auto !important;
  }

  .main-footer .social-icons li a {
    font-size: 16px !important;
    padding: 0 !important;
  }

  /* Contact Person */
  .contact-person {
    padding: 0 5px;
  }

  .person-info {
    margin-bottom: 15px !important;
  }

  .person-info h4 {
    font-size: 16px;
    margin-bottom: 8px !important;
  }

  .person-info p {
    font-size: 14px;
  }

  .contact-person + .text-center {
    margin-top: 15px;
  }

  .contact-person + .text-center .btn {
    width: 90% !important;
    max-width: 280px;
    margin: 0 auto !important;
  }

  /* Portfolio spacing tighter on small mobile */
  section.portfolio {
    margin-bottom: 40px !important;
  }

  .portfolio_container .col-md-4,
  .portfolio_container .col-sm-6,
  .portfolio_container .col-xs-12 {
    margin-bottom: 20px !important;
    padding: 0 15px !important;
  }
}

/* Extra Small Mobile (375px - iPhone 11 and below) */
@media (max-width: 375px) {
  .green-section .white-text {
    font-size: 16px !important;
  }

  .agency .btn,
  .green-section .btn {
    font-size: 11px;
    height: 42px;
    line-height: 42px;
    padding: 0 15px;
  }

  .main-footer .footer-nav ul li a {
    font-size: 12px;
  }

  .main-footer .gray-text {
    font-size: 10px;
  }

  /* Social Icons - Tighter spacing for iPhone 11 */
  .main-footer .social-icons {
    padding: 0 5px !important;
  }

  .main-footer .social-icons li {
    margin: 0 2px !important;
  }

  .main-footer .social-icons li a {
    font-size: 15px !important;
  }
}

/* Extra Extra Small Mobile (360px and below) */
@media (max-width: 360px) {
  /* Social Icons - Even tighter for very small screens */
  .main-footer .social-icons {
    padding: 0 3px !important;
  }

  .main-footer .social-icons li {
    margin: 0 1px !important;
  }

  .main-footer .social-icons li a {
    font-size: 14px !important;
  }
}

/* Portfolio Filter Fix for Mobile */
@media (max-width: 768px) {
  .portfolio_filter {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-bottom: 20px !important;
  }

  .portfolio_filter li {
    display: inline-block !important;
    margin: 0 !important;
    float: none !important;
  }

  .portfolio_filter a {
    display: inline-block !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    border-radius: 20px !important;
    background-color: #f0f0f0 !important;
    color: #333 !important;
    transition: all 0.3s ease !important;
  }

  .portfolio_filter a.active {
    background-color: #4caf50 !important;
    color: white !important;
  }

  /* Force portfolio items to show correctly */
  .portfolio_container {
    display: block !important;
    height: auto !important;
    position: relative !important;
  }

  .portfolio_container [class*="col-"] {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 15px !important;
    margin-bottom: 20px !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: all 0.3s ease !important;
  }

  /* CRITICAL FIX: Force hide items that should be hidden */
  .portfolio_container [class*="col-"][data-portfolio-visible="false"] {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
  }

  /* Override WOW.js animations on mobile portfolio */
  .portfolio_container .portfolio_item.wow {
    animation-name: none !important;
    -webkit-animation-name: none !important;
  }

  .portfolio_container .portfolio_item.animated {
    animation-name: none !important;
    -webkit-animation-name: none !important;
  }
}

/* Dark mode support for portfolio filter */
@media (max-width: 768px) {
  body.dark-mode .portfolio_filter a {
    background-color: #333 !important;
    color: #eee !important;
  }

  body.dark-mode .portfolio_filter a.active {
    background-color: #4caf50 !important;
    color: white !important;
  }
}
