/* ===== RESPONSIVE DESIGN ===== */

/* For large devices */
@media screen and (max-width: 992px) {
  .container {
    margin-left: 1.5rem;
    margin-right: 1.5rem;
  }

  .hero__title {
    font-size: 3rem;
  }

  .hero__container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .hero__image {
    order: -1;
  }

  .services__container {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }

  .templates__container {
    grid-template-columns: repeat(auto-fill);
    justify-content: center;
  }

  .features__container {
    grid-template-columns: repeat(auto-fit, 1fr);
  }

  .footer__container {
    grid-template-columns: repeat(auto-fit, 1fr);
  }

  .featured-article__container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .featured-article__image {
    order: -1;
  }

  .blog-articles__container {
    grid-template-columns: repeat(auto-fill);
    justify-content: center;
  }

  .newsletter__input-group {
    flex-direction: column;
  }

  /* Team member responsive */
  .team__member {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .team__member-image {
    order: -1;
  }

  /* About section responsive */
  .about__container {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .about__image {
    order: -1;
  }

  .about__image-img {
    width: 250px;
    height: 250px;
  }

  .about__title {
    font-size: 2rem;
  }

  .about__description {
    font-size: 1rem;
  }

  /* Customization section responsive */
  .customization__content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .customization__image {
    order: -1;
  }

  .customization__title {
    font-size: 2rem;
  }

  .customization__description {
    font-size: 1rem;
  }

  /* Custom project section responsive */
  .custom__content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .custom__image {
    order: -1;
  }

  .custom__title {
    font-size: 2rem;
  }

  .custom__description {
    font-size: 1rem;
  }

  /* Contact section responsive */
  .contact__container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact__form-container {
    padding: 1.5rem;
  }

  .contact__info-container {
    padding: 1.5rem;
  }

  .contact__form-title,
  .contact__info-title {
    font-size: 1.5rem;
  }

  .contact__form-subtitle,
  .contact__info-subtitle {
    font-size: 0.875rem;
  }
}

/* ===== NAVBAR RESPONSIVE DESIGN ===== */

/* Hide menu and show toggle on devices smaller than 992px */
@media screen and (max-width: 991px) {
  /* Hide desktop menu */
  .nav__menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 350px;
    height: 100vh;
    background: #ffffff;
    padding: 5rem 2rem 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    border-left: 1px solid rgba(30, 58, 138, 0.1);
    overflow-y: auto;
    z-index: 1001;
  }

  .nav__menu.show-menu {
    right: 0;
    transform: translateX(0);
  }

  /* RTL Support - Menu slides from right in Arabic (sticking to right edge) */
  [dir="rtl"] .nav__menu {
    right: -100%;
    left: auto;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    border-left: 1px solid rgba(30, 58, 138, 0.1);
    border-right: none;
  }

  [dir="rtl"] .nav__menu.show-menu {
    right: 0;
    left: auto;
  }

  /* Mobile navigation list */
  .nav__list {
    flex-direction: column;
    row-gap: 0;
    margin-top: 1rem;
    width: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .nav__list--center {
    justify-content: flex-start;
    flex: none;
  }

  .nav__list--right {
    justify-content: flex-start;
    flex: none;
    margin-top: 1rem;
  }

  .nav__item {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  /* Mobile navigation links */
  .nav__link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    font-weight: var(--font-medium);
    color: var(--neutral-dark);
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
  }

  .nav__link:hover {
    color: var(--primary-color);
    background-color: #f8fafc;
  }

  .nav__link::after {
    display: none;
  }

  /* Mobile button styles */
  .nav__link-btn {
    background-color: var(--primary-color);
    color: white;
    margin-top: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    font-weight: var(--font-medium);
    font-size: 1rem;
    transition: background-color 0.2s ease;
  }

  /* Mobile language switcher */
  .nav__link[type="submit"] {
    background-color: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    text-align: center;
    font-weight: var(--font-medium);
    font-size: 1rem;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
    width: 100%;
  }

  .nav__link[type="submit"]:hover,
  .nav__link[type="submit"]:focus {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
  }

  /* Show toggle buttons */
  .nav__toggle,
  .nav__close {
    display: block;
    position: relative;
    z-index: 1002;
  }

  /* Close button styling */
  .nav__close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    background-color: #6b7280;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    font-size: 1.125rem;
  }

  /* RTL close button positioning */
  [dir="rtl"] .nav__close {
    right: 1.5rem;
    left: auto;
  }

  /* Toggle button styling */
  .nav__toggle {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    z-index: 1002;
  }

  /* Hide toggle when menu is open */
  .nav__menu.show-menu ~ .nav__toggle,
  .nav__menu.show-menu + .nav__toggle {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
  }

  /* Active link indicator */
  .nav__link.active-link {
    color: var(--primary-color);
    background-color: #f8fafc;
  }

  .nav__link.active-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--primary-color);
  }

  /* Mobile currency switcher styles (match Contact/Language buttons exactly) */
  .nav__menu .currency-switcher {
    width: 100%;
    margin-top: 0.5rem;
  }

  .nav__menu .currency-dropdown {
    width: 100%;
  }

  .nav__menu .currency-dropdown__button {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: var(--font-medium);
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
    border: none;
  }

  .nav__menu .currency-dropdown__button:hover,
  .nav__menu .currency-dropdown__button:focus {
    background-color: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
  }

  .nav__menu .currency-dropdown__button[aria-expanded="true"] {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
  }

  .nav__menu .currency-dropdown__list {
    position: static;
    width: 100%;
    margin-top: 0.5rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    box-shadow: none;
    padding: 0.25rem;
  }

  .nav__menu .currency-dropdown__option {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
  }

  .nav__menu .currency-dropdown__option:hover,
  .nav__menu .currency-dropdown__option.is-active,
  .nav__menu .currency-dropdown__option[aria-selected="true"] {
    background: var(--primary-color);
    color: white;
  }

  /* Ensure caret remains visible on colored button */
  .nav__menu .currency-dropdown__caret {
    border-color: #fff;
  }
}

/* For medium devices */
@media screen and (max-width: 768px) {
  :root {
    --h1-font-size: 2.5rem;
    --h2-font-size: 2rem;
    --h3-font-size: 1.5rem;
  }

  .hero {
    padding-top: calc(var(--header-height) + 1rem);
  }

  .hero__title {
    font-size: 2.5rem;
  }

  .hero__description {
    font-size: 1rem;
  }

  .section__title {
    font-size: 2rem;
  }

  .section__subtitle {
    font-size: 1.125rem;
  }

  .services__container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .templates__container {
    grid-template-columns: repeat(auto-fill);
    gap: 1.5rem;
    justify-content: center;
  }

  .features__container {
    grid-template-columns: repeat(auto-fit, 1fr);
    gap: 1.5rem;
  }

  .cta__title {
    font-size: 2rem;
  }

  .cta__description {
    font-size: 1.125rem;
  }

  /* CTA buttons responsive */
  .cta__buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }

  .cta__buttons .button {
    width: 100%;
    max-width: 300px;
  }

  .featured-article__title {
    font-size: 1.75rem;
  }

  .blog-articles__container {
    grid-template-columns: repeat(auto-fill);
    gap: 1.5rem;
    justify-content: center;
  }

  .blog-categories__buttons {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .blog-category-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .footer__container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .footer__social {
    justify-content: center;
  }

  .floating-buttons {
    bottom: 1rem;
    align-items: center;
    gap: 0.75rem;
  }

  .whatsapp-button {
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
  }

  .scrollup {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }

  /* Package cards responsive styles */
  .package-splide .splide__arrow {
    display: none;
  }

  .package-splide .splide__pagination {
    display: flex;
  }

  .package-splide .splide__arrow--prev {
    left: -1rem;
  }

  .package-splide .splide__arrow--next {
    right: -1rem;
  }

  /* Packages component responsive adjustments */
  .package-splide .services__card {
    padding: 1.5rem;
  }

  .package-splide .services__card-title {
    font-size: 1.25rem;
  }

  .package-splide .services__card-amount {
    font-size: 2rem;
  }

  .templates__card-content {
    padding: 1rem;
  }

  .templates__card-title {
    font-size: 1.125rem;
  }

  .features__card {
    padding: 1.5rem 1rem;
  }

  .features__card-icon {
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
  }

  .cta__title {
    font-size: 1.75rem;
  }

  .cta__description {
    font-size: 1rem;
  }

  /* CTA buttons responsive for small screens */
  .cta__buttons {
    flex-direction: column;
    gap: 0.75rem;
  }

  .cta__buttons .button {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }

  .featured-article__title {
    font-size: 1.5rem;
  }

  .blog-article__title {
    font-size: 1.125rem;
  }

  .newsletter__title {
    font-size: 1.75rem;
  }

  .footer__logo {
    font-size: 1.25rem;
  }

  .footer__logo-img {
    height: 3rem;
  }

  /* Package splide adjustments for small screens */
  .package-splide .splide__arrow--prev {
    left: -0.5rem;
  }

  .package-splide .splide__arrow--next {
    right: -0.5rem;
  }

  .package-splide .splide__pagination {
    bottom: -1.5rem;
  }

  /* RTL adjustments for splide carousels */
  [dir="rtl"] .package-splide .splide__arrow--prev {
    left: auto;
    right: -0.5rem;
  }

  [dir="rtl"] .package-splide .splide__arrow--next {
    right: auto;
    left: -0.5rem;
  }

  [dir="rtl"] .team-splide .splide__arrow--prev {
    left: auto;
    right: -0.5rem;
  }

  [dir="rtl"] .team-splide .splide__arrow--next {
    right: auto;
    left: -0.5rem;
  }

  /* About section responsive for small screens */
  .about__title {
    font-size: 1.5rem;
  }

  .about__description {
    font-size: 0.875rem;
  }

  /* Customization section responsive for medium screens */
  .customization__content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }

  .customization__title {
    font-size: 1.75rem;
  }

  .customization__description {
    font-size: 1rem;
  }

  .customization__features {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .customization__feature {
    padding: 1rem;
  }

  .customization__feature-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }

  .customization__feature-title {
    font-size: 1.125rem;
  }

  .customization__feature-description {
    font-size: 0.875rem;
  }

  /* Contact section responsive for medium screens */
  .contact__container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact__form {
    order: -1;
  }

  .contact__info {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .contact__info-item {
    padding: 1.5rem;
  }

  .contact__info-icon {
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
  }

  .contact__info-title {
    font-size: 1.125rem;
  }

  .contact__info-description {
    font-size: 0.875rem;
  }

  .contact__form-group {
    margin-bottom: 1rem;
  }

  .contact__form-input,
  .contact__form-textarea {
    padding: 0.75rem;
    font-size: 0.875rem;
  }

  .contact__form-button {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
}

.whatsapp-button {
  width: 3rem;
  height: 3rem;
  font-size: 1.25rem;
}

.scrollup {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1rem;
}

/* Package cards responsive styles */
.package-splide .splide__arrow {
  display: none;
}

.package-splide .splide__pagination {
  display: flex;
}

.package-splide .splide__arrow--prev {
  left: -1rem;
}

.package-splide .splide__arrow--next {
  right: -1rem;
}

/* Packages component responsive adjustments */
.package-splide .services__card {
  padding: 1.5rem;
}

.package-splide .services__card-title {
  font-size: 1.25rem;
}

.package-splide .services__card-amount {
  font-size: 2rem;
}

/* About section responsive for medium screens */
.about__title {
  font-size: 1.75rem;
}

.about__image {
  order: -1;
}

/* Customization section responsive for medium screens */
.customization__title {
  font-size: 1.75rem;
}

.customization__description {
  font-size: 0.875rem;
}

/* Custom project section responsive for medium screens */
.custom__title {
  font-size: 1.75rem;
}

.custom__description {
  font-size: 0.875rem;
}

/* Contact section responsive for medium screens */
.contact__form-container,
.contact__info-container {
  padding: 1.25rem;
}

.contact__form-title,
.contact__info-title {
  font-size: 1.25rem;
}

.contact__form-subtitle,
.contact__info-subtitle {
  font-size: 0.8rem;
}

.contact__info-item {
  padding: 1rem;
}

.contact__info-icon {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1rem;
}

/* For small devices */
@media screen and (max-width: 576px) {
  .container {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .nav__menu {
    width: 100%;
    max-width: 100%;
    padding: 5rem 1.5rem 2rem;
  }

  .nav__link {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
  }

  .nav__link-btn {
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
  }

  .nav__close {
    top: 1rem;
    right: 1rem;
    width: 2.25rem;
    height: 2.25rem;
  }

  .hero__title {
    font-size: 2rem;
  }

  .hero__description {
    font-size: 0.875rem;
  }

  .section__title {
    font-size: 1.75rem;
  }

  .section__subtitle {
    font-size: 1rem;
  }

  .services__card {
    padding: 1.5rem;
  }

  .services__card-title {
    font-size: 1.25rem;
  }

  .services__card-amount {
    font-size: 2rem;
  }

  .templates__card-content {
    padding: 1rem;
  }

  .templates__card-title {
    font-size: 1.125rem;
  }

  .templates__card-description {
    font-size: 0.875rem;
    line-height: 1.6;
  }

  .templates__card-tags {
    gap: 0.5rem;
    margin-top: 1rem;
  }

  .templates__card-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  .templates__card-button {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }

  .features__card {
    padding: 1.5rem 1rem;
  }

  .features__card-icon {
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
  }

  .cta__title {
    font-size: 1.75rem;
  }

  .cta__description {
    font-size: 1rem;
  }

  /* CTA buttons responsive for small screens */
  .cta__buttons {
    flex-direction: column;
    gap: 0.75rem;
  }

  .cta__buttons .button {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }

  .featured-article__title {
    font-size: 1.5rem;
  }

  .blog-article__title {
    font-size: 1.125rem;
  }

  .newsletter__title {
    font-size: 1.75rem;
  }

  .footer__logo {
    font-size: 1.25rem;
  }

  .footer__logo-img {
    height: 3rem;
  }

  /* Package splide adjustments for small screens */
  .package-splide .splide__arrow--prev {
    left: -0.5rem;
  }

  .package-splide .splide__arrow--next {
    right: -0.5rem;
  }

  .package-splide .splide__pagination {
    bottom: -1.5rem;
  }

  /* RTL adjustments for splide carousels */
  [dir="rtl"] .package-splide .splide__arrow--prev {
    left: auto;
    right: -0.5rem;
  }

  [dir="rtl"] .package-splide .splide__arrow--next {
    right: auto;
    left: -0.5rem;
  }

  [dir="rtl"] .team-splide .splide__arrow--prev {
    left: auto;
    right: -0.5rem;
  }

  [dir="rtl"] .team-splide .splide__arrow--next {
    right: auto;
    left: -0.5rem;
  }

  /* About section responsive for small screens */
  .about__title {
    font-size: 1.5rem;
  }

  .about__description {
    font-size: 0.875rem;
  }

  .about__image {
    order: -1;
  }

  .about__image-img {
    width: 180px;
    height: 180px;
  }

  /* Customization section responsive for small screens */
  .customization__title {
    font-size: 1.5rem;
  }

  .customization__description {
    font-size: 0.875rem;
  }

  /* Custom project section responsive for small screens */
  .custom__title {
    font-size: 1.5rem;
  }

  .custom__description {
    font-size: 0.875rem;
  }

  /* Contact section responsive for small screens */
  .contact__form-container,
  .contact__info-container {
    padding: 1rem;
  }

  .contact__form-title,
  .contact__info-title {
    font-size: 1.125rem;
  }

  .contact__form-subtitle,
  .contact__info-subtitle {
    font-size: 0.75rem;
  }

  .contact__info-item {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .contact__info-icon {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
  }

  .contact__info-label {
    font-size: 1rem;
  }

  .contact__info-value {
    font-size: 1rem;
  }

  .button {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    min-height: 2.5rem;
  }

  .button--large {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    min-height: 3rem;
  }
}

/* For very small devices */
@media screen and (max-width: 350px) {
  .hero__title {
    font-size: 1.75rem;
  }

  .section__title {
    font-size: 1.5rem;
  }

  .services__card {
    padding: 1rem;
  }

  .templates__card-content {
    padding: 0.75rem;
  }

  .features__card {
    padding: 1rem 0.75rem;
  }

  .cta__title {
    font-size: 1.5rem;
  }

  .cta__description {
    font-size: 0.875rem;
  }

  /* About section responsive for very small screens */
  .about__title {
    font-size: 1.25rem;
  }

  .about__description {
    font-size: 0.8rem;
  }

  .about__image {
    order: -1;
  }

  .about__image-img {
    width: 150px;
    height: 150px;
  }

  /* Customization section responsive for very small screens */
  .customization__title {
    font-size: 1.25rem;
  }

  .customization__description {
    font-size: 0.8rem;
  }

  /* Custom project section responsive for very small screens */
  .custom__title {
    font-size: 1.25rem;
  }

  .custom__description {
    font-size: 0.8rem;
  }

  /* Contact section responsive for very small screens */
  .contact__form-container,
  .contact__info-container {
    padding: 0.75rem;
  }

  .contact__form-title,
  .contact__info-title {
    font-size: 1rem;
  }

  .contact__form-subtitle,
  .contact__info-subtitle {
    font-size: 0.7rem;
  }

  .contact__info-item {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .contact__info-icon {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.75rem;
  }

  .contact__info-label {
    font-size: 0.875rem;
  }

  .contact__info-value {
    font-size: 0.875rem;
  }

  .button {
    padding: 0.625rem 1.25rem;
    font-size: 0.8rem;
    min-height: 2.25rem;
  }

  .button--large {
    padding: 0.75rem 1.75rem;
    font-size: 0.9rem;
    min-height: 2.75rem;
  }
}

/* Landscape orientation adjustments */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-top: calc(var(--header-height) + 1rem);
    padding-bottom: 2rem;
  }

  .hero__title {
    font-size: 2rem;
  }

  .hero__description {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .section {
    padding: 2rem 0;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero__img,
  .templates__card-img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero__img {
    animation: none;
  }

  .services__card:hover,
  .templates__card:hover,
  .features__card:hover {
    transform: none;
  }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
  /* Dark mode styles can be added here */
}

/* Print styles */
@media print {
  .header,
  .footer,
  .whatsapp-button,
  .scrollup {
    display: none !important;
  }

  .main {
    margin-top: 0;
  }

  .section {
    padding: 1rem 0;
    page-break-inside: avoid;
  }

  .hero {
    min-height: auto;
    background: white !important;
  }

  .services__card,
  .templates__card,
  .features__card {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}

/* Blog detail responsive */
@media screen and (max-width: 768px) {
  .article-main {
    grid-column: 1 / -1;
  }

  .article-sidebar {
    grid-column: 1 / -1;
    order: -1;
  }

  .article-sidebar .sidebar-card {
    margin-bottom: 1.5rem;
  }

  .social-share {
    justify-content: center;
    padding: 1.5rem;
  }

  .social-share-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
  }

  .related-articles-grid {
    grid-template-columns: 1fr;
  }

  .article-content {
    padding: 2rem;
  }

  .article-featured-image img {
    height: 300px;
  }
}

/* Extra small devices (phones, 480px and down) */
@media screen and (max-width: 480px) {
  /* Template cards for very small screens */
  .templates__container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
    min-width: 0;
  }

  .templates__card {
    min-height: auto;
    display: flex;
    flex-direction: column;
    height: auto;
    flex-shrink: 0;
    min-width: 0;
    width: 100%;
  }

  .templates__card-image {
    aspect-ratio: unset !important;
    min-height: 200px !important;
    flex-shrink: 0 !important;
    height: 200px !important;
  }

  .templates__card-img {
    width: 100% !important;
    height: 200px !important;
    min-height: 200px !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
  }

  .templates__card-content {
    padding: 1.5rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .templates__card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
  }

  .templates__card-description {
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
  }

  .templates__card-tags {
    gap: 0.5rem;
    margin-top: auto;
    flex-wrap: wrap;
  }

  .templates__card-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
  }

  .templates__card-button {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
  }

  .templates__card-overlay {
    padding: 1rem;
  }

  /* Force image protection on very small screens */
  .templates__card .templates__card-image {
    aspect-ratio: unset !important;
    min-height: 200px !important;
    height: 200px !important;
    flex-shrink: 0 !important;
  }

  .templates__card .templates__card-img {
    min-height: 200px !important;
    height: 200px !important;
    width: 100% !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
  }

  /* General responsive improvements for very small screens */
  .container {
    padding: 0 1rem;
  }

  .section {
    padding: 3rem 0;
  }

  .section__title {
    font-size: 1.75rem;
  }

  .section__subtitle {
    font-size: 1rem;
  }
}
