/* General Styling */
:root {
    --grid-mobile: repeat(2, 1fr);
    --grid-small: repeat(3, 1fr);
    --grid-large: repeat(4, 1fr);
    --gap: 2rem;
    --COLOR-BG: #ffffff;
    --COLOR-TEXT: #333;
    --COLOR-TEXT-LIGHT: #737373;
    --COLOR-TEXT-DARK: #000000;
    --COLOR-HOVER: #c8102e;
}

body {
    font-family: "Poppins", Arial, sans-serif;
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    background-color: #ffffff;
    color: var(--COLOR-TEXT);
}

*::before, *::after {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 35px 16px;
    transform: scaleY(0.875) !important;
    transform-origin: top;
}

/* Policy Grid */
.policy-grid {
    display: grid;
    gap: var(--gap);
    grid-template-columns: var(--grid-mobile);
    padding: 0;
    margin: 0;
    align-content: start;
}

/* Policy Card */
.policy-card {
    position: relative;
    background: var(--COLOR-BG);
    border: none;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 0;
    cursor: pointer;
}

.policy-info {
    padding: 0 12px;
    margin-top: 0.3rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    z-index: 10;
    line-height: 1.2;
    text-align: center;
}

.policy-info a {
    text-decoration: none !important;
}

.policy-title {
    font-size: 1rem;
    margin: 0.2rem;
    color: var(--COLOR-TEXT);
    text-decoration: none !important;
    font-weight: 400;
}

.policy-content {
    font-size: 0.8rem;
    color: var(--COLOR-TEXT-LIGHT);
    margin: 0.2rem;
    text-decoration: none !important;
    font-weight: 400;
}

.action-buttons {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.25rem;
}

/* Single Policy Content */
.policy-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: var(--COLOR-BG);
    border-radius: 0;
}

.policy-content h2 {
    font-size: 2rem;
    color: #000000;
    margin-bottom: 1rem;
    text-align: center;
}

.policy-content p {
    font-size: 1rem;
    color: #000;
    line-height: 1.6;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background-color: #000000;
    color: #ffffff;
    border-radius: 0;
    width: auto;
    z-index: 10;
    text-decoration: none;
}

.back-to-top:hover {
    background-color: var(--COLOR-HOVER);
}

/* Custom Dropdown */
.sort-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-family: "Poppins", Arial, sans-serif;
    justify-content: flex-end;
    position: relative;
}

.sort-container.sort-right {
    width: 100%;
}

.custom-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: #000000;
    font-size: 0.9rem;
    font-family: "Poppins", Arial, sans-serif;
    font-weight: 400;
}

.dropdown-toggle:hover {
    color: var(--COLOR-HOVER);
}

.dropdown-toggle i {
    font-size: 1rem;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #ffffff;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    min-width: 150px;
    padding: 0.5rem;
}

.sort-container .custom-dropdown .dropdown-menu.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    z-index: 10000 !important;
}

.dropdown-option {
    padding: 0.5rem;
    font-size: 0.9rem;
    color: #000000;
    font-family: "Poppins", Arial, sans-serif;
    font-weight: 400;
    cursor: pointer;
    border: none;
}

.dropdown-option:hover {
    color: var(--COLOR-HOVER);
}

.dropdown-option[data-selected="true"] {
    color: var(--COLOR-HOVER);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    outline: none;
    border: none;
    font-size: 1rem;
    color: #ffffff;
    white-space: nowrap;
    background-color: #000000;
    border-radius: 0;
    transition: background-color 0.3s;
    cursor: pointer;
    width: 100%;
}

.btn:hover {
    background-color: var(--COLOR-HOVER);
}

.hero-btn, .details-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.hero-btn {
    background-color: #000000 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 0;
}

.hero-btn:hover {
    background-color: var(--COLOR-HOVER) !important;
}

.details-btn {
    background-color: #ffffff;
    color: #000000;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 0;
}

.details-btn:hover {
    background-color: #f0f0f0;
    color: #000000;
}

.details-btn:disabled {
    background-color: #ccc;
    color: #737373;
    cursor: not-allowed;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    :root {
        --gap: 1rem;
    }
    .container {
        padding: 35px 16px;
    }
    .policy-grid {
        grid-template-columns: var(--grid-mobile);
    }
    .policy-title {
        font-size: 1rem;
        margin: 0.2rem;
    }
    .policy-content {
        font-size: 0.8rem;
        margin: 0.2rem;
    }
    .policy-content h2 {
        font-size: 1.2rem;
    }
    .policy-content p {
        font-size: 0.9rem;
    }
    .hero-btn, .details-btn {
        font-size: 0.8rem;
        padding: 0.25rem 1rem;
    }
    .dropdown-toggle {
        font-size: 0.8rem;
    }
    .dropdown-toggle i {
        font-size: 0.9rem;
    }
    .dropdown-option {
        font-size: 11.2px;
        padding: 0.15rem 0.4rem;
    }
    .dropdown-menu {
        min-width: 120px;
        right: 0;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 70px 40px;
    }
    .policy-grid {
        grid-template-columns: var(--grid-small);
    }
}

@media (min-width: 992px) {
    .policy-grid {
        grid-template-columns: var(--grid-large);
    }
}

@media (max-width: 480px) {
    .policy-title {
        font-size: 0.9rem;
        margin: 0.2rem;
    }
    .policy-content {
        font-size: 0.7rem;
        margin: 0.2rem;
    }
    .hero-btn, .details-btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.8rem;
    }
    .dropdown-toggle {
        font-size: 0.7rem;
    }
    .dropdown-toggle i {
        font-size: 0.8rem;
    }
    .dropdown-option {
        font-size: 11.2px;
        padding: 0.15rem 0.3rem;
    }
    .dropdown-menu {
        min-width: 100px;
    }
}