/**
 * Global Styles
 * Loaded on all pages
 * 
 * @package Ecommerce_Pro
 * @since 1.0.0
 */

/* ========== CSS Reset & Base Styles ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========== Typography ========== */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

@media (min-width: 768px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.5rem; }
    h3 { font-size: 2rem; }
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover,
a:focus {
    text-decoration: underline;
}

/* ========== Utility Classes ========== */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container { max-width: 640px; }
}

@media (min-width: 768px) {
    .container { max-width: 768px; }
}

@media (min-width: 1024px) {
    .container { max-width: 1024px; }
}

@media (min-width: 1280px) {
    .container { max-width: 1280px; }
}

/* Screen reader text */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100001;
}

.skip-link:focus {
    top: 0;
}

/* ========== Buttons ========== */
.btn,
.button,
button[type="submit"],
input[type="submit"],
input[type="button"] {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.btn-primary,
.button-primary {
    background-color: var(--ep-primary, #3b82f6);
    color: #ffffff;
    border-color: var(--ep-primary, #3b82f6);
}

.btn-primary:hover,
.button-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    text-decoration: none;
}

.btn-secondary,
.button-secondary {
    background-color: var(--ep-secondary, #10b981);
    color: #ffffff;
    border-color: var(--ep-secondary, #10b981);
}

.btn-secondary:hover,
.button-secondary:hover {
    background-color: #059669;
    border-color: #059669;
    text-decoration: none;
}

.btn-outline {
    background-color: transparent;
    color: var(--ep-primary, #3b82f6);
    border-color: var(--ep-primary, #3b82f6);
}

.btn-outline:hover {
    background-color: var(--ep-primary, #3b82f6);
    color: #ffffff;
}

/* ========== Forms ========== */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #1f2937;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--ep-primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* ========== Content Styling ========== */
.entry-content,
.page-content,
.comment-content {
    line-height: 1.8;
}

.entry-content > *,
.page-content > *,
.comment-content > * {
    margin-bottom: 1.5rem;
}

.entry-content ul,
.entry-content ol,
.page-content ul,
.page-content ol {
    padding-left: 2rem;
}

.entry-content li,
.page-content li {
    margin-bottom: 0.5rem;
}

.entry-content blockquote,
.page-content blockquote {
    padding: 1.5rem;
    margin: 2rem 0;
    border-left: 4px solid var(--ep-primary, #3b82f6);
    background-color: #f9fafb;
    font-style: italic;
}

.entry-content code,
.page-content code {
    padding: 0.125rem 0.25rem;
    background-color: #f3f4f6;
    border-radius: 0.25rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875em;
}

.entry-content pre,
.page-content pre {
    padding: 1rem;
    background-color: #1f2937;
    color: #f9fafb;
    border-radius: 0.375rem;
    overflow-x: auto;
}

.entry-content pre code,
.page-content pre code {
    padding: 0;
    background-color: transparent;
    color: inherit;
}

/* ========== Images & Media ========== */
.wp-caption {
    max-width: 100%;
}

.wp-caption img {
    display: block;
    margin: 0 auto;
}

.wp-caption-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
}

.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1.5rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignwide {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
}

/* ========== Pagination ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: var(--ep-primary, #3b82f6);
    color: #ffffff;
    border-color: var(--ep-primary, #3b82f6);
    text-decoration: none;
}

.pagination .current {
    background-color: var(--ep-primary, #3b82f6);
    color: #ffffff;
    border-color: var(--ep-primary, #3b82f6);
}

.pagination .dots {
    border: none;
}

/* ========== Breadcrumbs ========== */
.breadcrumb {
    margin-bottom: 2rem;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: #9ca3af;
}

/* ========== Comments ========== */
.comments-area {
    margin-top: 3rem;
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-list .children {
    list-style: none;
    margin-left: 2rem;
    padding: 0;
}

.comment-respond {
    margin-top: 2rem;
}

.comment-form-comment label {
    display: block;
    margin-bottom: 0.5rem;
}

.comment-form-comment textarea {
    min-height: 150px;
}

/* ========== Widgets ========== */
.widget {
    margin-bottom: 2rem;
}

.widget-title {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--ep-primary, #3b82f6);
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    display: block;
    transition: color 0.3s ease;
}

.widget ul li a:hover {
    color: var(--ep-primary, #3b82f6);
    text-decoration: none;
}

/* ========== Post Meta ========== */
.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.entry-meta a {
    color: #6b7280;
}

.entry-meta a:hover {
    color: var(--ep-primary, #3b82f6);
}

/* ========== Post Thumbnail ========== */
.post-thumbnail {
    margin-bottom: 2rem;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

/* ========== Accessibility ========== */
:focus {
    outline: 2px solid var(--ep-primary, #3b82f6);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid var(--ep-primary, #3b82f6);
    outline-offset: 2px;
}

/* ========== Loading States ========== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--ep-primary, #3b82f6);
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* ========== Responsive Utilities ========== */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}