/* ============================================================
   Masha Allah Enterprise — Content & Policy Pages Stylesheet
   Used by: About, Contact, Privacy, Terms, Return & Refund,
            Shipping & Delivery pages.
   Standalone: works without header/footer components.
   ============================================================ */

:root {
    --primary: #0e7a3d;
    --primary-dark: #0a5c2e;
    --primary-light: #e8f5ee;
    --accent: #f5a623;
    --text: #1f2937;
    --text-muted: #6b7280;
    --bg: #f7faf8;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --danger: #dc2626;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(15, 60, 35, 0.07);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
}

img {
    max-width: 100%;
}

/* ---------- Layout ---------- */

.page-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-section {
    padding: 48px 0;
}

/* ---------- Hero ---------- */

.page-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, #12934e 100%);
    background-size: 200% 200%;
    animation: heroGradient 10s ease infinite;
    color: #fff;
    text-align: center;
    padding: 78px 20px;
}

@keyframes heroGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Floating decorative orbs */
.page-hero::before,
.page-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.page-hero::before {
    width: 260px;
    height: 260px;
    top: -90px;
    left: -70px;
    animation: floatOrb 9s ease-in-out infinite;
}

.page-hero::after {
    width: 190px;
    height: 190px;
    bottom: -80px;
    right: -40px;
    animation: floatOrb 11s ease-in-out infinite reverse;
}

@keyframes floatOrb {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(22px) scale(1.08); }
}

.page-hero .page-container {
    position: relative;
    z-index: 1;
    animation: fadeUp 0.7s ease both;
}

.page-hero h1 {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
}

.page-hero p {
    margin-top: 8px;
    font-size: 1.1rem;
    opacity: 0.92;
    animation: fadeUp 0.7s ease 0.15s both;
}

/* ---------- Section headings ---------- */

.section-title {
    font-size: 1.55rem;
    color: var(--primary-dark);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 56px;
    height: 4px;
    border-radius: 4px;
    background: var(--accent);
}

.section-title.centered {
    text-align: center;
}

.section-title.centered::after {
    left: 50%;
    transform: translateX(-50%);
}

/* ---------- Cards ---------- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
}

.card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 22px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 26px rgba(15, 60, 35, 0.14);
    border-color: rgba(14, 122, 61, 0.25);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    font-size: 1.9rem;
    display: block;
    margin-bottom: 12px;
}

.card h3 {
    font-size: 1.08rem;
    color: var(--primary-dark);
    margin-bottom: 6px;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ---------- Text blocks / prose ---------- */

.text-block {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}

.text-block p + p {
    margin-top: 14px;
}

.text-block p {
    color: #374151;
}

.highlight-box {
    background: var(--primary-light);
    border-left: 5px solid var(--primary);
    border-radius: 8px;
    padding: 18px 22px;
    margin-top: 18px;
}

.highlight-box strong {
    color: var(--primary-dark);
}

/* ---------- Lists ---------- */

.check-list,
.cross-list {
    list-style: none;
}

.check-list li,
.cross-list li {
    position: relative;
    padding: 8px 0 8px 36px;
    border-bottom: 1px dashed var(--border);
}

.check-list li:last-child,
.cross-list li:last-child {
    border-bottom: none;
}

.check-list li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    top: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cross-list li::before {
    content: "\2715";
    position: absolute;
    left: 0;
    top: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fdecec;
    color: var(--danger);
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plain-list {
    list-style: none;
}

.plain-list li {
    position: relative;
    padding: 6px 0 6px 26px;
}

.plain-list li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

/* ---------- Steps (numbered process) ---------- */

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px;
    counter-reset: step;
}

.step-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 18px;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 24px rgba(15, 60, 35, 0.13);
}

.step-number {
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(14, 122, 61, 0.3);
    transition: transform 0.3s ease;
}

.step-card:hover .step-number {
    transform: scale(1.12) rotate(6deg);
}

.step-card h3 {
    font-size: 1rem;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.step-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* ---------- Tables ---------- */

.table-wrap {
    overflow-x: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 420px;
}

.data-table th,
.data-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.95rem;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: #f4f9f6;
}

/* ---------- Policy pages (TOC + content) ---------- */

.policy-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: start;
}

.policy-toc {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    position: sticky;
    top: 20px;
}

.policy-toc h2 {
    font-size: 1.05rem;
    color: var(--primary-dark);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.policy-toc ol {
    list-style: none;
    counter-reset: toc;
}

.policy-toc li {
    counter-increment: toc;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
}

.policy-toc li:last-child {
    border-bottom: none;
}

.policy-toc a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.93rem;
    display: block;
}

.policy-toc a::before {
    content: counter(toc) ". ";
    color: var(--primary);
    font-weight: 600;
}

.policy-toc a:hover {
    color: var(--primary);
}

.policy-content {
    min-width: 0;
}

.policy-content .policy-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 22px;
    scroll-margin-top: 20px;
}

.policy-section h2 {
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}

.policy-section p {
    color: #374151;
    margin-bottom: 10px;
}

.policy-section ul {
    margin: 10px 0 10px 22px;
    color: #374151;
}

.policy-section li {
    margin-bottom: 6px;
}

.last-updated {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 999px;
    padding: 6px 18px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ---------- Contact page ---------- */

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 30px;
    align-items: start;
}

.contact-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.contact-form-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}

.contact-form-card h2 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.93rem;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group .required {
    color: var(--danger);
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.97rem;
    font-family: inherit;
    background: #fbfdfc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 122, 61, 0.15);
    background: #fff;
}

textarea.form-input {
    resize: vertical;
    min-height: 130px;
}

.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 5px;
}

ul.errorlist {
    list-style: none;
    margin-top: 6px !important;
}

ul.errorlist li {
    color: var(--danger);
    font-size: 0.85rem;
}

.social-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 26px;
}

/* ---------- Buttons ---------- */

.btn {
    position: relative;
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 0.98rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    text-align: center;
    overflow: hidden;
}

.btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.55s ease;
}

.btn:hover::after {
    left: 130%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(14, 122, 61, 0.3);
}

.btn:active {
    transform: translateY(0);
}

/* White buttons inside dark CTA bands keep their own shadow */
.cta-band .btn:hover,
.page-hero .btn:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    border-color: var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-block {
    display: block;
    width: 100%;
    border: none;
}

.btn-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 26px;
}

.cta-band {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-radius: var(--radius);
    color: #fff;
    text-align: center;
    padding: 42px 24px;
}

.cta-band h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.cta-band p {
    opacity: 0.92;
    margin-bottom: 4px;
}

/* ---------- Alerts (django messages) ---------- */

.page-messages {
    max-width: 1080px;
    margin: 16px auto 0;
    padding: 0 20px;
}

.alert {
    padding: 13px 18px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--primary-light);
    border-color: #bfe3cf;
    color: var(--primary-dark);
}

.alert-error,
.alert-danger {
    background: #fdecec;
    border-color: #f5c2c2;
    color: #a92222;
}

.alert-info,
.alert-debug {
    background: #e8f1fd;
    border-color: #c3dbf7;
    color: #1d4fa1;
}

.alert-warning {
    background: #fdf6e3;
    border-color: #f3e3b3;
    color: #8a6d1a;
}

/* ---------- Scroll-reveal animations (JS adds .is-visible) ---------- */

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children inside grids */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-stagger.is-visible > * {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.13s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.21s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.29s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.37s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.45s; }

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(26px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-hero,
    .page-hero::before,
    .page-hero::after,
    .page-hero .page-container,
    .page-hero p {
        animation: none;
    }

    .reveal,
    .reveal-stagger > * {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .policy-layout {
        grid-template-columns: 1fr;
    }

    .policy-toc {
        position: static;
    }

    .contact-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .page-hero {
        padding: 46px 18px;
    }

    .page-hero h1 {
        font-size: 1.8rem;
    }

    .page-section {
        padding: 34px 0;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .btn-row .btn {
        width: 100%;
    }
}

/* ---------- Rich Text (CKEditor HTML) ---------- */
.rich-text p {
    margin: 0 0 12px;
    color: #374151;
    line-height: 1.7;
}
.rich-text p:last-child {
    margin-bottom: 0;
}
.rich-text strong, .rich-text b {
    font-weight: 700;
    color: #111827;
}
.rich-text em, .rich-text i {
    font-style: italic;
}
.rich-text ul, .rich-text ol {
    margin: 10px 0 14px 22px;
    list-style: disc;
}
.rich-text ol {
    list-style: decimal;
}
.rich-text li {
    margin: 4px 0;
    color: #374151;
}
.rich-text a {
    color: var(--primary);
    text-decoration: underline;
}
.rich-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}
.rich-text h1, .rich-text h2, .rich-text h3, .rich-text h4 {
    margin: 18px 0 10px;
    font-weight: 700;
    color: #111827;
}
.rich-text blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 14px;
    margin: 14px 0;
    color: #4b5563;
    font-style: italic;
}
.rich-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
}
.rich-text th, .rich-text td {
    border: 1px solid var(--border);
    padding: 8px 10px;
    text-align: left;
}
.rich-text hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}
.text-block .rich-text {
    margin: 0;
}
.text-block .rich-text + .rich-text {
    margin-top: 14px;
}
.hero-desc.rich-text p { color: inherit; }
